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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
88d3e97e
Commit
88d3e97e
authored
Oct 01, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'readme_tab' into 'master'
Add Readme tab to project show page Fixes #1533 See merge request !1140
parents
76aca721
ae88a9bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
55 deletions
+93
-55
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+9
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+61
-48
features/project/project.feature
features/project/project.feature
+8
-1
features/steps/project/project.rb
features/steps/project/project.rb
+14
-6
No files found.
CHANGELOG
View file @
88d3e97e
...
@@ -6,6 +6,7 @@ v 7.4.0
...
@@ -6,6 +6,7 @@ v 7.4.0
- Default branch is protected by default
- Default branch is protected by default
- Increase unicorn timeout to 60 seconds
- Increase unicorn timeout to 60 seconds
- Sort search autocomplete projects by stars count so most popular go first
- Sort search autocomplete projects by stars count so most popular go first
- Add README to tab on project show page
- Do not delete tmp/repositories itself during clean-up, only its contents
- Do not delete tmp/repositories itself during clean-up, only its contents
- Support for backup uploads to remote storage
- Support for backup uploads to remote storage
- Prevent notes polling when there are not notes
- Prevent notes polling when there are not notes
...
...
app/assets/javascripts/project.js.coffee
View file @
88d3e97e
...
@@ -51,3 +51,12 @@ $ ->
...
@@ -51,3 +51,12 @@ $ ->
$
(
@
).
toggleClass
(
'on'
).
find
(
'.count'
).
html
(
data
.
star_count
)
$
(
@
).
toggleClass
(
'on'
).
find
(
'.count'
).
html
(
data
.
star_count
)
.
on
'ajax:error'
,
(
e
,
xhr
,
status
,
error
)
->
.
on
'ajax:error'
,
(
e
,
xhr
,
status
,
error
)
->
new
Flash
(
'Star toggle failed. Try again later.'
,
'alert'
)
new
Flash
(
'Star toggle failed. Try again later.'
,
'alert'
)
$
(
"a[data-toggle='tab']"
).
on
"shown.bs.tab"
,
(
e
)
->
$
.
cookie
"default_view"
,
$
(
e
.
target
).
attr
(
"href"
)
defaultView
=
$
.
cookie
(
"default_view"
)
if
defaultView
$
(
"a[href="
+
defaultView
+
"]"
).
tab
"show"
else
$
(
"a[data-toggle='tab']:first"
).
tab
"show"
app/views/projects/show.html.haml
View file @
88d3e97e
=
render
"home_panel"
=
render
"home_panel"
-
readme
=
@repository
.
readme
%ul
.nav.nav-tabs
%ul
.nav.nav-tabs
%li
.active
%li
.active
=
link_to
project_path
(
@project
)
do
=
link_to
'#tab-activity'
,
'data-toggle'
=>
'tab'
do
Activity
Activity
-
if
readme
%li
=
link_to
'#tab-readme'
,
'data-toggle'
=>
'tab'
do
Readme
.project-home-links
.project-home-links
-
unless
@project
.
empty_repo?
-
unless
@project
.
empty_repo?
=
link_to
pluralize
(
number_with_delimiter
(
@repository
.
commit_count
),
'commit'
),
project_commits_path
(
@project
,
@ref
||
@repository
.
root_ref
)
=
link_to
pluralize
(
number_with_delimiter
(
@repository
.
commit_count
),
'commit'
),
project_commits_path
(
@project
,
@ref
||
@repository
.
root_ref
)
...
@@ -11,57 +16,65 @@
...
@@ -11,57 +16,65 @@
=
link_to
pluralize
(
number_with_delimiter
(
@repository
.
tag_names
.
count
),
'tag'
),
project_tags_path
(
@project
)
=
link_to
pluralize
(
number_with_delimiter
(
@repository
.
tag_names
.
count
),
'tag'
),
project_tags_path
(
@project
)
%span
.light.prepend-left-20
=
repository_size
%span
.light.prepend-left-20
=
repository_size
.row
.tab-content
%section
.col-md-9
.tab-pane.active
#tab-activity
=
render
"events/event_last_push"
,
event:
@last_push
.row
=
render
'shared/event_filter'
%section
.col-md-9
.content_list
=
render
"events/event_last_push"
,
event:
@last_push
=
spinner
=
render
'shared/event_filter'
%aside
.col-md-3.project-side.hidden-sm.hidden-xs
.content_list
.clearfix
=
spinner
-
if
@project
.
archived?
%aside
.col-md-3.project-side.hidden-sm.hidden-xs
.alert.alert-warning
.clearfix
%h4
-
if
@project
.
archived?
%i
.icon-warning-sign
.alert.alert-warning
Archived project!
%h4
%p
Repository is read-only
%i
.icon-warning-sign
Archived project!
%p
Repository is read-only
-
if
@project
.
forked_from_project
-
if
@project
.
forked_from_project
.alert.alert-success
.alert.alert-success
%i
.icon-code-fork.project-fork-icon
%i
.icon-code-fork.project-fork-icon
Forked from:
Forked from:
%br
%br
=
link_to
@project
.
forked_from_project
.
name_with_namespace
,
project_path
(
@project
.
forked_from_project
)
=
link_to
@project
.
forked_from_project
.
name_with_namespace
,
project_path
(
@project
.
forked_from_project
)
-
unless
@project
.
empty_repo?
-
unless
@project
.
empty_repo?
=
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
-
if
@repository
.
version
-
readme
=
@repository
.
readme
-
version
=
@repository
.
version
=
link_to
project_blob_path
(
@project
,
tree_join
(
@repository
.
root_ref
,
readme
.
name
)),
class:
'btn btn-block'
do
=
link_to
project_blob_path
(
@project
,
tree_join
(
@repository
.
root_ref
,
version
.
name
)),
class:
'btn btn-block'
do
=
readme
.
name
Version:
%span
.count
=
@repository
.
blob_by_oid
(
version
.
id
).
data
.prepend-top-10
%p
%span
.light
Created on
#{
@project
.
created_at
.
stamp
(
'Aug 22, 2013'
)
}
%p
%span
.light
Owned by
-
if
@project
.
group
#{
link_to
@project
.
group
.
name
,
@project
.
group
}
group
-
else
#{
link_to
@project
.
owner_name
,
@project
.
owner
}
-
if
@repository
.
version
-
version
=
@repository
.
version
=
link_to
project_blob_path
(
@project
,
tree_join
(
@repository
.
root_ref
,
version
.
name
)),
class:
'btn btn-block'
do
Version:
%span
.count
=
@repository
.
blob_by_oid
(
version
.
id
).
data
.prepend-top-10
-
if
@project
.
gitlab_ci?
%p
%hr
%span
.light
Created on
=
link_to
@project
.
gitlab_ci_service
.
builds_path
do
#{
@project
.
created_at
.
stamp
(
'Aug 22, 2013'
)
}
=
image_tag
@project
.
gitlab_ci_service
.
status_img_path
,
alt:
"build status"
%p
%span
.light
Owned by
-
if
@project
.
group
#{
link_to
@project
.
group
.
name
,
@project
.
group
}
group
-
else
#{
link_to
@project
.
owner_name
,
@project
.
owner
}
-
if
readme
.tab-pane
#tab-readme
%article
.readme-holder
#README
=
link_to
project_blob_path
(
@project
,
tree_join
(
@repository
.
root_ref
,
readme
.
name
))
do
%h4
.readme-file-title
%i
.icon-file
=
readme
.
name
.wiki
=
render_readme
(
readme
)
-
if
@project
.
gitlab_ci?
%hr
=
link_to
@project
.
gitlab_ci_service
.
builds_path
do
=
image_tag
@project
.
gitlab_ci_service
.
status_img_path
,
alt:
"build status"
features/project/project.feature
View file @
88d3e97e
...
@@ -27,7 +27,6 @@ Feature: Project Feature
...
@@ -27,7 +27,6 @@ Feature: Project Feature
Scenario
:
I
should see project readme and version
Scenario
:
I
should see project readme and version
When
I visit project
"Shop"
page
When
I visit project
"Shop"
page
Then
I should see project
"Shop"
README link
And
I should see project
"Shop"
version
And
I should see project
"Shop"
version
Scenario
:
I
should change project default branch
Scenario
:
I
should change project default branch
...
@@ -35,3 +34,11 @@ Feature: Project Feature
...
@@ -35,3 +34,11 @@ Feature: Project Feature
And
change project default branch
And
change project default branch
And
I save project
And
I save project
Then
I should see project default branch changed
Then
I should see project default branch changed
@javascript
Scenario
:
I
should have default tab per my preference
And
I own project
"Forum"
When
I select project
"Forum"
README tab
Then
I should see project
"Forum"
README
And
I visit project
"Shop"
page
Then
I should see project
"Shop"
README
features/steps/project/project.rb
View file @
88d3e97e
...
@@ -25,12 +25,6 @@ class Spinach::Features::ProjectFeature < Spinach::FeatureSteps
...
@@ -25,12 +25,6 @@ class Spinach::Features::ProjectFeature < Spinach::FeatureSteps
project
.
path
.
should
==
"new-path"
project
.
path
.
should
==
"new-path"
end
end
step
'I should see project "Shop" README link'
do
within
'.project-side'
do
page
.
should
have_content
"README.md"
end
end
step
'I should see project "Shop" version'
do
step
'I should see project "Shop" version'
do
within
'.project-side'
do
within
'.project-side'
do
page
.
should
have_content
"Version: 6.7.0.pre"
page
.
should
have_content
"Version: 6.7.0.pre"
...
@@ -45,4 +39,18 @@ class Spinach::Features::ProjectFeature < Spinach::FeatureSteps
...
@@ -45,4 +39,18 @@ class Spinach::Features::ProjectFeature < Spinach::FeatureSteps
step
'I should see project default branch changed'
do
step
'I should see project default branch changed'
do
find
(
:css
,
'select#project_default_branch'
).
value
.
should
==
'fix'
find
(
:css
,
'select#project_default_branch'
).
value
.
should
==
'fix'
end
end
step
'I select project "Forum" README tab'
do
click_link
'Readme'
end
step
'I should see project "Forum" README'
do
page
.
should
have_link
"README.md"
page
.
should
have_content
"Sample repo for testing gitlab features"
end
step
'I should see project "Shop" README'
do
page
.
should
have_link
"README.md"
page
.
should
have_content
"testme"
end
end
end
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