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
Tatuya Kamada
gitlab-ce
Commits
6581aea3
Commit
6581aea3
authored
Mar 17, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link project version to changelog if there is one.
parent
31e48408
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
app/models/repository.rb
app/models/repository.rb
+8
-1
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+2
-1
No files found.
app/models/repository.rb
View file @
6581aea3
...
@@ -122,7 +122,7 @@ class Repository
...
@@ -122,7 +122,7 @@ class Repository
def
expire_cache
def
expire_cache
%i(size branch_names tag_names commit_count graph_log
%i(size branch_names tag_names commit_count graph_log
readme version contribution_guide)
.
each
do
|
key
|
readme version contribution_guide
changelog
)
.
each
do
|
key
|
cache
.
expire
(
key
)
cache
.
expire
(
key
)
end
end
end
end
...
@@ -203,6 +203,13 @@ class Repository
...
@@ -203,6 +203,13 @@ class Repository
end
end
end
end
end
end
def
changelog
cache
.
fetch
(
:changelog
)
do
tree
(
:head
).
blobs
.
find
do
|
file
|
file
.
name
=~
/^(changelog|history)/i
end
end
end
end
def
head_commit
def
head_commit
...
...
app/views/projects/show.html.haml
View file @
6581aea3
...
@@ -52,7 +52,8 @@
...
@@ -52,7 +52,8 @@
-
if
@repository
.
version
-
if
@repository
.
version
-
version
=
@repository
.
version
-
version
=
@repository
.
version
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@repository
.
root_ref
,
version
.
name
)),
class:
'btn btn-block'
do
-
detail_file
=
@repository
.
changelog
.
try
(
:name
)
||
version
.
name
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@repository
.
root_ref
,
detail_file
)),
class:
'btn btn-block'
do
Version:
Version:
%span
.count
%span
.count
=
@repository
.
blob_by_oid
(
version
.
id
).
data
=
@repository
.
blob_by_oid
(
version
.
id
).
data
...
...
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