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
81fe86b4
Commit
81fe86b4
authored
Nov 29, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README link from project home page
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
071de30f
Changes
2
Show 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 @
81fe86b4
...
@@ -133,6 +133,7 @@ class Repository
...
@@ -133,6 +133,7 @@ class Repository
Rails
.
cache
.
delete
(
cache_key
(
:tag_names
))
Rails
.
cache
.
delete
(
cache_key
(
:tag_names
))
Rails
.
cache
.
delete
(
cache_key
(
:commit_count
))
Rails
.
cache
.
delete
(
cache_key
(
:commit_count
))
Rails
.
cache
.
delete
(
cache_key
(
:graph_log
))
Rails
.
cache
.
delete
(
cache_key
(
:graph_log
))
Rails
.
cache
.
delete
(
cache_key
(
:readme
))
end
end
def
graph_log
def
graph_log
...
@@ -159,4 +160,10 @@ class Repository
...
@@ -159,4 +160,10 @@ class Repository
def
blob_at
(
sha
,
path
)
def
blob_at
(
sha
,
path
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
Gitlab
::
Git
::
Blob
.
find
(
self
,
sha
,
path
)
end
end
def
readme
Rails
.
cache
.
fetch
(
cache_key
(
:readme
))
do
Tree
.
new
(
self
,
self
.
root_ref
).
readme
end
end
end
end
app/views/projects/show.html.haml
View file @
81fe86b4
...
@@ -31,6 +31,12 @@
...
@@ -31,6 +31,12 @@
%span
Download
%span
Download
=
link_to
project_compare_index_path
(
@project
,
from:
@repository
.
root_ref
,
to:
@ref
||
@repository
.
root_ref
),
class:
'btn btn-block'
do
=
link_to
project_compare_index_path
(
@project
,
from:
@repository
.
root_ref
,
to:
@ref
||
@repository
.
root_ref
),
class:
'btn btn-block'
do
Compare code
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
.prepend-top-10
%p
%p
%span
.light
Created on
%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