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
6a6697c3
Commit
6a6697c3
authored
Jul 21, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add README to list of files in project page if activity feed setting in use
Closes #2044
parent
77f37fa9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
30 deletions
+29
-30
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+20
-24
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+9
-6
No files found.
app/helpers/projects_helper.rb
View file @
6a6697c3
...
@@ -231,37 +231,20 @@ module ProjectsHelper
...
@@ -231,37 +231,20 @@ module ProjectsHelper
end
end
end
end
def
readme_path
(
project
)
filename_path
(
project
,
:readme
)
end
def
changelog_path
(
project
)
def
changelog_path
(
project
)
if
project
&&
changelog
=
project
.
repository
.
changelog
filename_path
(
project
,
:changelog
)
namespace_project_blob_path
(
project
.
namespace
,
project
,
tree_join
(
project
.
default_branch
,
changelog
.
name
)
)
end
end
end
def
license_path
(
project
)
def
license_path
(
project
)
if
project
&&
license
=
project
.
repository
.
license
filename_path
(
project
,
:license
)
namespace_project_blob_path
(
project
.
namespace
,
project
,
tree_join
(
project
.
default_branch
,
license
.
name
)
)
end
end
end
def
version_path
(
project
)
def
version_path
(
project
)
if
project
&&
version
=
project
.
repository
.
version
filename_path
(
project
,
:version
)
namespace_project_blob_path
(
project
.
namespace
,
project
,
tree_join
(
project
.
default_branch
,
version
.
name
)
)
end
end
end
def
hidden_pass_url
(
original_url
)
def
hidden_pass_url
(
original_url
)
...
@@ -331,4 +314,17 @@ module ProjectsHelper
...
@@ -331,4 +314,17 @@ module ProjectsHelper
count
count
end
end
end
end
private
def
filename_path
(
project
,
filename
)
if
project
&&
blob
=
project
.
repository
.
send
(
filename
)
namespace_project_blob_path
(
project
.
namespace
,
project
,
tree_join
(
project
.
default_branch
,
blob
.
name
)
)
end
end
end
end
app/views/projects/show.html.haml
View file @
6a6697c3
...
@@ -23,18 +23,21 @@
...
@@ -23,18 +23,21 @@
=
link_to
namespace_project_tags_path
(
@project
.
namespace
,
@project
)
do
=
link_to
namespace_project_tags_path
(
@project
.
namespace
,
@project
)
do
=
pluralize
(
number_with_delimiter
(
@repository
.
tag_names
.
count
),
'tag'
)
=
pluralize
(
number_with_delimiter
(
@repository
.
tag_names
.
count
),
'tag'
)
-
if
!
prefer_readme?
&&
@repository
.
readme
%li
=
link_to
'Readme'
,
readme_path
(
@project
)
-
if
@repository
.
changelog
-
if
@repository
.
changelog
%li
%li
=
link_to
changelog_path
(
@project
)
do
=
link_to
'Changelog'
,
changelog_path
(
@project
)
Changelog
-
if
@repository
.
license
-
if
@repository
.
license
%li
%li
=
link_to
license_path
(
@project
)
do
=
link_to
'License'
,
license_path
(
@project
)
License
-
if
@repository
.
contribution_guide
-
if
@repository
.
contribution_guide
%li
%li
=
link_to
contribution_guide_path
(
@project
)
do
=
link_to
'Contribution guide'
,
contribution_guide_path
(
@project
)
Contribution guide
-
if
current_user
&&
can_push_branch?
(
@project
,
@project
.
default_branch
)
-
if
current_user
&&
can_push_branch?
(
@project
,
@project
.
default_branch
)
-
unless
@repository
.
changelog
-
unless
@repository
.
changelog
...
...
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