Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
6de7dc1e
Commit
6de7dc1e
authored
Mar 03, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New projects page
parent
9f1a5f41
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
77 deletions
+111
-77
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+41
-50
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+13
-3
app/views/projects/_show.html.haml
app/views/projects/_show.html.haml
+23
-0
app/views/projects/_tile.html.haml
app/views/projects/_tile.html.haml
+0
-13
app/views/projects/index.html.haml
app/views/projects/index.html.haml
+27
-11
app/views/projects/show.js.haml
app/views/projects/show.js.haml
+7
-0
No files found.
app/assets/stylesheets/common.scss
View file @
6de7dc1e
a
{
outline
:
none
;
color
:
$link_color
;
&
:hover
{
text-decoration
:none
;
...
...
@@ -10,6 +11,10 @@ a {
}
}
a
:focus
{
outline
:
none
;
}
.vlink
{
color
:
$link_color
!
important
;
}
...
...
@@ -442,36 +447,6 @@ input.git_clone_url {
background
:
#fff
!
important
;
}
.project_tile
{
@include
shade
;
@include
round-borders-all
(
4px
);
margin-bottom
:
20px
;
width
:
298px
;
float
:left
;
margin-left
:
20px
;
border
:
1px
solid
#DDD
;
padding-bottom
:
20px
;
.title
{
background
:
#f5f5f5
;
padding
:
5px
10px
2px
20px
;
border-bottom
:
1px
solid
#DDD
;
margin-bottom
:
15px
;
h3
{
&
:hover
{
text-decoration
:
underline
;
}
}
}
.data
{
margin
:
0
20px
;
}
.buttons
{
margin
:
0
20px
;
}
}
/**
*
* COMMIT SHOw
...
...
@@ -610,26 +585,6 @@ p.time {
.dashboard_category
{
margin-bottom
:
30px
;
.ico
{
background
:
url("images.png")
no-repeat
-85px
-77px
;
width
:
19px
;
height
:
16px
;
float
:
left
;
position
:
relative
;
margin-right
:
10px
;
top
:
8px
;
&
.project
{
background-position
:
-37px
-77px
;
}
&
.activities
{
background-position
:
-162px
-22px
;
}
&
.projects
{
background-position
:
-209px
-21px
;
}
}
h3
a
{
...
...
@@ -688,3 +643,39 @@ p.time {
.wll
:hover
{
background
:none
}
}
.projects_list
{
a
.project
{
h4
{
color
:
#888
;
}
&
.active
{
h4
{
color
:
#111
;
.ico.project
{
background-position
:
-209px
-21px
;
}
}
}
}
}
.ico
{
background
:
url("images.png")
no-repeat
-85px
-77px
;
width
:
19px
;
height
:
16px
;
float
:
left
;
position
:
relative
;
margin-right
:
10px
;
top
:
8px
;
&
.project
{
background-position
:
-37px
-77px
;
}
&
.activities
{
background-position
:
-162px
-22px
;
}
&
.projects
{
background-position
:
-209px
-21px
;
}
}
app/controllers/projects_controller.rb
View file @
6de7dc1e
...
...
@@ -11,8 +11,8 @@ class ProjectsController < ApplicationController
before_filter
:require_non_empty_project
,
:only
=>
[
:blob
,
:tree
,
:graph
]
def
index
@
limit
,
@offset
=
(
params
[
:limit
]
||
16
),
(
params
[
:offset
]
||
0
)
@projects
=
current_user
.
projects
.
limit
(
@limit
).
offset
(
@offset
)
@
projects
=
current_user
.
projects
@projects
=
@projects
.
select
(
&
:last_activity_date
).
sort_by
(
&
:last_activity_date
).
reverse
end
def
new
...
...
@@ -67,9 +67,19 @@ class ProjectsController < ApplicationController
end
def
show
return
render
"projects/empty"
unless
@project
.
repo_exists?
&&
@project
.
has_commits?
limit
=
(
params
[
:limit
]
||
20
).
to_i
@events
=
@project
.
events
.
recent
.
limit
(
limit
)
respond_to
do
|
format
|
format
.
html
do
if
@project
.
repo_exists?
&&
@project
.
has_commits?
render
:show
else
render
"projects/empty"
end
end
format
.
js
end
end
def
files
...
...
app/views/projects/_show.html.haml
0 → 100644
View file @
6de7dc1e
%h4
=
@project
.
name
%hr
%div
%a
.btn.info
{
:href
=>
tree_project_ref_path
(
@project
,
@project
.
root_ref
)}
Browse code
%a
.btn
{
:href
=>
project_commits_path
(
@project
)}
Commits
%strong
.right
=
link_to
project_path
(
@project
)
do
Switch to project
→
%hr
.alert-message.block-message.warning
.input
.input-prepend
%span
.add-on
git clone
=
text_field_tag
:project_clone
,
@project
.
url_to_repo
,
:class
=>
"xlarge one_click_select git_clone_url"
=
simple_format
@project
.
description
-
unless
@events
.
blank?
%h5
.cgray
Recent Activity
.content_list
=
render
@events
app/views/projects/_tile.html.haml
deleted
100644 → 0
View file @
9f1a5f41
-
@projects
.
in_groups_of
(
3
,
false
)
do
|
projects
|
.row
-
projects
.
each_with_index
do
|
project
,
i
|
%div
.project_tile
.title
=
link_to
project_path
(
project
)
do
%h3
=
truncate
(
project
.
name
,
:length
=>
28
)
.data
%p
%input
{
:value
=>
project
.
url_to_repo
,
:class
=>
[
'git-url'
,
'one_click_select'
,
'text'
,
'project_list_url'
],
:readonly
=>
'readonly'
}
.buttons
%a
.btn.info
{
:href
=>
tree_project_ref_path
(
project
,
project
.
root_ref
)}
Browse code
%a
.btn
{
:href
=>
project_commits_path
(
project
)}
Commits
app/views/projects/index.html.haml
View file @
6de7dc1e
...
...
@@ -7,17 +7,33 @@
New Project
%hr
-
unless
@projects
.
empty?
%div
.content_list
=
render
"tile"
.row
.span5
%div
.content_list.projects_list
-
@projects
.
each
do
|
project
|
=
link_to
project_path
(
project
),
:remote
=>
true
,
:class
=>
dom_class
(
project
)
do
%h4
%span
.ico.project
=
truncate
(
project
.
name
,
:length
=>
26
)
.span11.right.show_holder
.loading
-
else
%h2
Nothing here
-# If projects requris paging
-# We add ajax loader & init script
-
if
@projects
.
count
==
@limit
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
:javascript
$
(
function
(){
$
(
"
a.project
"
).
live
(
"
ajax:before
"
,
function
()
{
$
(
"
.show_holder
"
).
html
(
"
<div class='loading'>
"
);
$
(
'
a.project
'
).
removeClass
(
"
active
"
);
$
(
this
).
addClass
(
"
active
"
);
});
$
(
'
a.project:first-child
'
).
trigger
(
"
click
"
);
});
-
if
@projects
.
count
==
@limit
:javascript
$
(
function
(){
Pager
.
init
(
#{
@limit
}
);
});
-
else
%h2
Nothing here
app/views/projects/show.js.haml
0 → 100644
View file @
6de7dc1e
-
if
@project
.
repo_exists?
&&
@project
.
has_commits?
:plain
$(".show_holder").html("
#{
escape_javascript
(
render
(
:partial
=>
'projects/show'
))
}
");
-
else
:plain
$(".show_holder").html("
#{
escape_javascript
(
render
(
:template
=>
'projects/empty'
))
}
");
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment