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
Léo-Paul Géneau
gitlab-ce
Commits
e33aab0b
Commit
e33aab0b
authored
Dec 30, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/project_tab'
parents
7279e8c1
61a2ce41
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
172 additions
and
33 deletions
+172
-33
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+7
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+8
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+15
-6
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+2
-12
app/views/projects/_project_head.html.haml
app/views/projects/_project_head.html.haml
+18
-0
app/views/projects/_team.html.haml
app/views/projects/_team.html.haml
+1
-3
app/views/projects/edit.html.erb
app/views/projects/edit.html.erb
+0
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+69
-0
app/views/projects/files.html.haml
app/views/projects/files.html.haml
+17
-0
app/views/projects/info.html.haml
app/views/projects/info.html.haml
+28
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+1
-3
app/views/projects/team.html.haml
app/views/projects/team.html.haml
+1
-0
app/views/projects/update.js.haml
app/views/projects/update.js.haml
+1
-1
app/views/snippets/index.html.haml
app/views/snippets/index.html.haml
+1
-3
config/routes.rb
config/routes.rb
+2
-0
spec/requests/projects_spec.rb
spec/requests/projects_spec.rb
+1
-1
No files found.
app/assets/stylesheets/projects.css.scss
View file @
e33aab0b
...
@@ -561,6 +561,7 @@ h4.middle-panel {
...
@@ -561,6 +561,7 @@ h4.middle-panel {
display
:none
;
display
:none
;
}
}
.merge-tabs
{
.merge-tabs
{
margin
:
0
;
margin
:
0
;
border
:
1px
solid
#ccc
;
border
:
1px
solid
#ccc
;
...
@@ -572,11 +573,10 @@ h4.middle-panel {
...
@@ -572,11 +573,10 @@ h4.middle-panel {
.tab
{
.tab
{
font-weight
:
bold
;
font-weight
:
bold
;
text-transform
:
uppercase
;
border-right
:
1px
solid
#ddd
;
border-right
:
1px
solid
#ddd
;
background
:none
;
background
:none
;
padding
:
10px
;
padding
:
10px
;
width
:
60px
;
min-
width
:
60px
;
float
:left
;
float
:left
;
position
:relative
;
position
:relative
;
top
:
-5px
;
top
:
-5px
;
...
@@ -598,6 +598,11 @@ h4.middle-panel {
...
@@ -598,6 +598,11 @@ h4.middle-panel {
}
}
}
}
}
}
.activities-tab
span
{
background
:
url("images.png")
no-repeat
-161px
-1px
;
}
.stat-tab
span
,
.team-tab
span
,
.snippets-tab
span
{
background
:
url("images.png")
no-repeat
-38px
-77px
;
}
.files-tab
span
{
background
:
url("images.png")
no-repeat
-112px
-23px
;
}
.merge-notes-tab
span
{
background
:
url("images.png")
no-repeat
-161px
-1px
;
}
.merge-notes-tab
span
{
background
:
url("images.png")
no-repeat
-161px
-1px
;
}
.merge-commits-tab
span
{
background
:
url("images.png")
no-repeat
-86px
1px
;
}
.merge-commits-tab
span
{
background
:
url("images.png")
no-repeat
-86px
1px
;
}
...
...
app/controllers/projects_controller.rb
View file @
e33aab0b
...
@@ -57,7 +57,7 @@ class ProjectsController < ApplicationController
...
@@ -57,7 +57,7 @@ class ProjectsController < ApplicationController
def
update
def
update
respond_to
do
|
format
|
respond_to
do
|
format
|
if
project
.
update_attributes
(
params
[
:project
])
if
project
.
update_attributes
(
params
[
:project
])
format
.
html
{
redirect_to
project
,
:notice
=>
'Project was successfully updated.'
}
format
.
html
{
redirect_to
info_project_path
(
project
)
,
:notice
=>
'Project was successfully updated.'
}
format
.
js
format
.
js
else
else
format
.
html
{
render
action:
"edit"
}
format
.
html
{
render
action:
"edit"
}
...
@@ -72,6 +72,13 @@ class ProjectsController < ApplicationController
...
@@ -72,6 +72,13 @@ class ProjectsController < ApplicationController
@activities
=
@project
.
cached_updates
(
limit
)
@activities
=
@project
.
cached_updates
(
limit
)
end
end
def
files
@notes
=
@project
.
notes
.
where
(
"attachment != 'NULL'"
).
order
(
"created_at DESC"
).
limit
(
100
)
end
def
info
end
#
#
# Wall
# Wall
#
#
...
...
app/helpers/projects_helper.rb
View file @
e33aab0b
...
@@ -16,12 +16,21 @@ module ProjectsHelper
...
@@ -16,12 +16,21 @@ module ProjectsHelper
nil
nil
end
end
# expires in 360 days
def
project_tab_class
def
switch_colorscheme_link
(
opts
)
[
:show
,
:files
,
:team
,
:edit
,
:update
,
:info
].
each
do
|
action
|
if
cookies
[
:colorschema
].
blank?
return
"current"
if
current_page?
(
:controller
=>
"projects"
,
:action
=>
action
,
:id
=>
@project
)
link_to_function
"paint it black!"
,
"$.cookie('colorschema','black', {expires:360}); window.location.reload()"
,
opts
end
else
link_to_function
"paint it white!"
,
"$.cookie('colorschema','', {expires:360}); window.location.reload()"
,
opts
if
controller
.
controller_name
==
"snippets"
||
controller
.
controller_name
==
"team_members"
"current"
end
end
end
end
def
tree_tab_class
current_page?
(
:controller
=>
"refs"
,
:action
=>
"tree"
,
:project_id
=>
@project
,
:id
=>
@ref
||
@project
.
root_ref
)
?
"current"
:
nil
end
end
end
app/views/layouts/project.html.haml
View file @
e33aab0b
...
@@ -23,14 +23,10 @@
...
@@ -23,14 +23,10 @@
.project-sidebar
.project-sidebar
.fixed
.fixed
%aside
%aside
=
link_to
"
Activities"
,
project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"show"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"
Project"
,
project_path
(
@project
),
:class
=>
project_tab_class
=
link_to
"Tree"
,
tree_project_ref_path
(
@project
,
@project
.
root_ref
),
:class
=>
current_page?
(
:controller
=>
"refs"
,
:action
=>
"tree"
,
:project_id
=>
@project
,
:id
=>
@ref
||
@project
.
root_ref
)
?
"current"
:
nil
=
link_to
"Tree"
,
tree_project_ref_path
(
@project
,
@project
.
root_ref
),
:class
=>
tree_tab_class
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
"Network graph"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Network graph"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
team_project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
)
?
"current"
:
nil
do
Team
-
if
@project
.
users_projects
.
count
>
0
%span
{
:class
=>
"number"
}=
@project
.
users_projects
.
count
=
link_to
project_issues_filter_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
=
link_to
project_issues_filter_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"issues"
)
?
"current"
:
nil
do
Issues
Issues
-
if
@project
.
issues
.
open_for
(
current_user
).
count
>
0
-
if
@project
.
issues
.
open_for
(
current_user
).
count
>
0
...
@@ -43,13 +39,7 @@
...
@@ -43,13 +39,7 @@
Merge Requests
Merge Requests
-
if
@project
.
merge_requests
.
opened
.
count
>
0
-
if
@project
.
merge_requests
.
opened
.
count
>
0
%span
{
:class
=>
"number"
}=
@project
.
merge_requests
.
opened
.
count
%span
{
:class
=>
"number"
}=
@project
.
merge_requests
.
opened
.
count
=
link_to
project_snippets_path
(
@project
),
:class
=>
(
controller
.
controller_name
==
"snippets"
)
?
"current"
:
nil
do
Snippets
-
if
@project
.
snippets
.
non_expired
.
count
>
0
%span
{
:class
=>
"number"
}=
@project
.
snippets
.
non_expired
.
count
-
if
can?
current_user
,
:admin_project
,
@project
=
link_to
"Admin"
,
edit_project_path
(
@project
),
:class
=>
(
current_page?
(
edit_project_path
(
@project
)))
?
"current"
:
nil
.medium-tags
{
:style
=>
'padding: 10px 0 0 10px; width: 210px;'
}=
tag_list
@project
.medium-tags
{
:style
=>
'padding: 10px 0 0 10px; width: 210px;'
}=
tag_list
@project
...
...
app/views/projects/_project_head.html.haml
0 → 100644
View file @
e33aab0b
.merge-tabs
=
link_to
project_path
(
@project
),
:class
=>
"activities-tab tab
#{
'active'
if
current_page?
(
project_path
(
@project
))
}
"
do
%span
Activities
=
link_to
info_project_path
(
@project
),
:class
=>
"stat-tab tab
#{
'active'
if
current_page?
(
info_project_path
(
@project
))
||
current_page?
(
edit_project_path
(
@project
))
}
"
do
%span
Info
=
link_to
team_project_path
(
@project
),
:class
=>
"team-tab tab
#{
'active'
if
current_page?
(
team_project_path
(
@project
))
}
"
do
%span
Team
=
link_to
files_project_path
(
@project
),
:class
=>
"files-tab tab
#{
'active'
if
current_page?
(
files_project_path
(
@project
))
}
"
do
%span
Files
=
link_to
project_snippets_path
(
@project
),
:class
=>
"snippets-tab tab
#{
'active'
if
current_page?
(
project_snippets_path
(
@project
))
}
"
do
%span
Snippets
app/views/projects/_team.html.haml
View file @
e33aab0b
%h2
.icon
%span
>
Team
-
if
can?
current_user
,
:admin_team_member
,
@project
-
if
can?
current_user
,
:admin_team_member
,
@project
%div
#new-member-holder
%div
#new-member-holder
.right
=
link_to
"Add new"
,
new_project_team_member_path
(
@project
),
:remote
=>
true
,
:class
=>
"grey-button"
.right
=
link_to
"Add new"
,
new_project_team_member_path
(
@project
),
:remote
=>
true
,
:class
=>
"grey-button"
.clear
%br
%br
%table
.round-borders
#team-table
%table
.round-borders
#team-table
%thead
%thead
...
...
app/views/projects/edit.html.erb
deleted
100644 → 0
View file @
7279e8c1
<%=
render
'form'
%>
app/views/projects/edit.html.haml
0 → 100644
View file @
e33aab0b
=
render
"project_head"
=
form_for
(
@project
,
:remote
=>
true
)
do
|
f
|
%div
%span
.entity-info
=
link_to
info_project_path
(
@project
)
do
.entity-button
Info
%i
%h2
=
@project
.
name
%hr
%table
.no-borders
-
if
@project
.
errors
.
any?
%tr
%td
{
:colspan
=>
2
}
#error_explanation
-
@project
.
errors
.
full_messages
.
each
do
|
msg
|
%span
=
msg
%br
%tr
%td
=
f
.
label
:name
%td
=
f
.
text_field
:name
,
:placeholder
=>
"Example Project"
%tr
%td
.left
=
f
.
label
:path
%cite
.right
=
"git@
#{
GIT_HOST
[
"host"
]
}
:"
%td
=
f
.
text_field
:path
,
:placeholder
=>
"example_project"
,
:disabled
=>
!
@project
.
new_record?
%tr
%td
.left
=
f
.
label
:code
%cite
.right
=
"http://
#{
GIT_HOST
[
"host"
]
}
/"
%td
=
f
.
text_field
:code
,
:placeholder
=>
"example"
-
unless
@project
.
new_record?
||
@project
.
heads
.
empty?
%tr
%td
=
f
.
label
:default_branch
,
"Default Branch"
%td
=
f
.
select
(
:default_branch
,
@project
.
heads
.
map
(
&
:name
),
{},
:style
=>
"width:300px;"
)
%tr
%td
=
f
.
label
:description
%td
=
f
.
text_area
:description
,
:placeholder
=>
"project description"
,
:style
=>
"height:50px"
%br
.merge-tabs
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
-
unless
@project
.
new_record?
.right
=
link_to
'Remove'
,
@project
,
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"red-button"
%div
{
:class
=>
"ajax_loader"
,
:style
=>
"display:none;height:200px;"
}
%center
=
image_tag
"ajax-loader.gif"
,
:class
=>
"append-bottom"
%h3
.prepend-top
Updating project
&
repository. Please wait for few minutes
:javascript
$
(
'
.edit_project
'
).
bind
(
'
ajax:before
'
,
function
()
{
$
(
"
.edit_project
"
).
hide
();
$
(
'
.ajax_loader
'
).
show
();
});
:javascript
$
(
function
(){
$
(
'
#project_default_branch
'
).
chosen
();
})
app/views/projects/files.html.haml
0 → 100644
View file @
e33aab0b
=
render
"project_head"
-
unless
@notes
.
empty?
%div
.update-data.ui-box.ui-box-small
.data
-
@notes
.
each
do
|
note
|
%a
.update-item
{
:href
=>
note
.
attachment
.
url
}
=
image_tag
gravatar_icon
(
note
.
author_email
),
:class
=>
"left"
,
:width
=>
16
%span
.update-title
{
:style
=>
"margin-bottom:0px;"
}
=
note
.
attachment_identifier
%span
.update-author.right
Added
=
time_ago_in_words
(
note
.
created_at
)
ago
-
else
%h3
All files attached to project wall, issues etc will be displayed here
app/views/projects/info.html.haml
0 → 100644
View file @
e33aab0b
=
render
"project_head"
%div
%span
.entity-info
=
link_to
edit_project_path
(
@project
)
do
.entity-button
Edit
%i
%h2
=
@project
.
name
%hr
%table
.no-borders
%tr
%td
Name
%td
=
@project
.
name
%tr
%td
Slug
%td
=
@project
.
code
%tr
%td
Created
%td
=
@project
.
created_at
.
stamp
(
"Aug 21, 2011"
)
%tr
%td
{
:colspan
=>
2
}=
simple_format
@project
.
description
app/views/projects/show.html.haml
View file @
e33aab0b
-
content_for
(
:body_class
,
"project-page dashboard"
)
-
content_for
(
:body_class
,
"project-page dashboard"
)
=
render
"project_head"
#news-feed
.news-feed
#news-feed
.news-feed
%h2
.icon
%span
>
Activities
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
-
@activities
.
each
do
|
update
|
-
@activities
.
each
do
|
update
|
=
render
"projects/feed"
,
:update
=>
update
,
:project
=>
@project
=
render
"projects/feed"
,
:update
=>
update
,
:project
=>
@project
...
...
app/views/projects/team.html.haml
View file @
e33aab0b
=
render
"project_head"
%div
%div
=
render
:partial
=>
"team"
,
:locals
=>
{
:project
=>
@project
}
=
render
:partial
=>
"team"
,
:locals
=>
{
:project
=>
@project
}
app/views/projects/update.js.haml
View file @
e33aab0b
-
if
@project
.
valid?
-
if
@project
.
valid?
:plain
:plain
location.href = "
#{
project_path
(
@project
,
:notice
=>
'Project was successfully updated.'
)
}
";
location.href = "
#{
info_
project_path
(
@project
,
:notice
=>
'Project was successfully updated.'
)
}
";
-
else
-
else
:plain
:plain
$(".edit_project").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
$(".edit_project").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
app/views/snippets/index.html.haml
View file @
e33aab0b
%h2
.icon
=
render
"projects/project_head"
%span
>
Snippets
-
if
can?
current_user
,
:write_snippet
,
@project
-
if
can?
current_user
,
:write_snippet
,
@project
.right
=
link_to
'New Snippet'
,
new_project_snippet_path
(
@project
),
:class
=>
"grey-button append-bottom-10"
.right
=
link_to
'New Snippet'
,
new_project_snippet_path
(
@project
),
:class
=>
"grey-button append-bottom-10"
...
...
config/routes.rb
View file @
e33aab0b
...
@@ -42,6 +42,8 @@ Gitlab::Application.routes.draw do
...
@@ -42,6 +42,8 @@ Gitlab::Application.routes.draw do
get
"team"
get
"team"
get
"wall"
get
"wall"
get
"graph"
get
"graph"
get
"info"
get
"files"
end
end
resources
:refs
,
:only
=>
[],
:path
=>
"/"
do
resources
:refs
,
:only
=>
[],
:path
=>
"/"
do
...
...
spec/requests/projects_spec.rb
View file @
e33aab0b
...
@@ -140,7 +140,7 @@ describe "Projects" do
...
@@ -140,7 +140,7 @@ describe "Projects" do
end
end
it
"should be correct path"
do
it
"should be correct path"
do
current_path
.
should
==
project_path
(
@project
)
current_path
.
should
==
info_
project_path
(
@project
)
end
end
it
"should show project"
do
it
"should show project"
do
...
...
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