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
8a650f5d
Commit
8a650f5d
authored
Nov 29, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/readme_link' of /home/git/repositories/gitlab/gitlabhq
parents
071de30f
81fe86b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/models/repository.rb
app/models/repository.rb
+7
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+6
-0
No files found.
app/models/repository.rb
View file @
8a650f5d
...
...
@@ -133,6 +133,7 @@ class Repository
Rails
.
cache
.
delete
(
cache_key
(
:tag_names
))
Rails
.
cache
.
delete
(
cache_key
(
:commit_count
))
Rails
.
cache
.
delete
(
cache_key
(
:graph_log
))
Rails
.
cache
.
delete
(
cache_key
(
:readme
))
end
def
graph_log
...
...
@@ -159,4 +160,10 @@ class Repository
def
blob_at
(
sha
,
path
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
end
def
readme
Rails
.
cache
.
fetch
(
cache_key
(
:readme
))
do
Tree
.
new
(
self
,
self
.
root_ref
).
readme
end
end
end
app/views/projects/show.html.haml
View file @
8a650f5d
...
...
@@ -31,6 +31,12 @@
%span
Download
=
link_to
project_compare_index_path
(
@project
,
from:
@repository
.
root_ref
,
to:
@ref
||
@repository
.
root_ref
),
class:
'btn btn-block'
do
Compare code
-
if
@repository
.
readme
-
readme
=
@repository
.
readme
=
link_to
project_blob_path
(
@project
,
tree_join
(
@repository
.
root_ref
,
readme
.
name
)),
class:
'btn btn-block'
do
=
readme
.
name
.prepend-top-10
%p
%span
.light
Created on
...
...
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