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
Boxiang Sun
gitlab-ce
Commits
61a2ce41
Commit
61a2ce41
authored
Dec 30, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanin
parent
0f627a65
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
22 deletions
+33
-22
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-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
-2
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+1
-1
app/views/projects/files.html.haml
app/views/projects/files.html.haml
+14
-12
No files found.
app/controllers/projects_controller.rb
View file @
61a2ce41
...
@@ -73,7 +73,7 @@ class ProjectsController < ApplicationController
...
@@ -73,7 +73,7 @@ class ProjectsController < ApplicationController
end
end
def
files
def
files
@notes
=
@project
.
notes
.
where
(
"attachment != 'NULL'"
).
order
(
"created_at DESC"
)
@notes
=
@project
.
notes
.
where
(
"attachment != 'NULL'"
).
order
(
"created_at DESC"
)
.
limit
(
100
)
end
end
def
info
def
info
...
...
app/helpers/projects_helper.rb
View file @
61a2ce41
...
@@ -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 @
61a2ce41
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
.project-sidebar
.project-sidebar
.fixed
.fixed
%aside
%aside
=
link_to
"Project"
,
project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"show"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"snippets"
||
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
||
current_page?
(
project_path
(
@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
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
...
...
app/views/projects/edit.html.haml
View file @
61a2ce41
...
@@ -64,6 +64,6 @@
...
@@ -64,6 +64,6 @@
:javascript
:javascript
$
(
function
(){
$
(
function
(){
$
(
'
form
#project_default_branch
'
).
chosen
();
$
(
'
#project_default_branch
'
).
chosen
();
})
})
app/views/projects/files.html.haml
View file @
61a2ce41
=
render
"project_head"
=
render
"project_head"
%div
{
:class
=>
"update-data ui-box ui-box-small ui-box-big"
}
-
unless
@notes
.
empty?
.data
%div
.update-data.ui-box.ui-box-small
-
@notes
.
each
do
|
note
|
.data
%a
.update-item
{
:href
=>
note
.
attachment
.
url
}
-
@notes
.
each
do
|
note
|
=
image_tag
gravatar_icon
(
note
.
author_email
),
:class
=>
"left"
,
:width
=>
16
%a
.update-item
{
:href
=>
note
.
attachment
.
url
}
%span
.update-title
{
:style
=>
"margin-bottom:0px;"
}
=
image_tag
gravatar_icon
(
note
.
author_email
),
:class
=>
"left"
,
:width
=>
16
=
note
.
attachment_identifier
%span
.update-title
{
:style
=>
"margin-bottom:0px;"
}
%span
.update-author.right
=
note
.
attachment_identifier
Added
%span
.update-author.right
=
time_ago_in_words
(
note
.
created_at
)
Added
ago
=
time_ago_in_words
(
note
.
created_at
)
ago
-
else
%h3
All files attached to project wall, issues etc will be displayed here
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