Commit a381ecbd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'project-file-tabs' into 'master'

Move project file links to tab bar.

The sidebar was getting awfully crowded, so I moved the file links to the tab bar alongside Activity and Readme. Unlike Readme, these files are not actually loaded in a tab, but simply link to the relevant blob, because we don't want to unnecessarily load the potentially large changelog or contribution guide on every project page load.

![Screen_Shot_2015-04-06_at_15.04.21](https://gitlab.com/gitlab-org/gitlab-ce/uploads/962e8073ab6dc8797f93ee754eb275ed/Screen_Shot_2015-04-06_at_15.04.21.png)

See merge request !497
parents e86e1013 ee9e922e
...@@ -20,7 +20,7 @@ v 7.10.0 (unreleased) ...@@ -20,7 +20,7 @@ v 7.10.0 (unreleased)
- Omit the "email patches" link and fix plain diff view for merge commits - Omit the "email patches" link and fix plain diff view for merge commits
- List new commits for newly pushed branch in activity view. - List new commits for newly pushed branch in activity view.
- Add sidetiq gem dependency to match EE - Add sidetiq gem dependency to match EE
- Add changelog, license and contribution guide links to project sidebar. - Add changelog, license and contribution guide links to project tab bar.
- Improve diff UI - Improve diff UI
- Fix alignment of navbar toggle button (Cody Mize) - Fix alignment of navbar toggle button (Cody Mize)
- Fix checkbox rendering for nested task lists - Fix checkbox rendering for nested task lists
......
...@@ -4,15 +4,27 @@ ...@@ -4,15 +4,27 @@
= render "home_panel" = render "home_panel"
- readme = @repository.readme
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li.active %li.active
= link_to '#tab-activity', 'data-toggle' => 'tab' do = link_to '#tab-activity', 'data-toggle' => 'tab' do
Activity Activity
- if readme - if @repository.readme
%li %li
= link_to '#tab-readme', 'data-toggle' => 'tab' do = link_to '#tab-readme', 'data-toggle' => 'tab' do
Readme Readme
- if @repository.changelog
%li
= link_to changelog_url(@project) do
Changelog
- if @repository.contribution_guide
%li
= link_to contribution_guide_url(@project) do
Contribution guide
- if @repository.license
%li
= link_to license_url(@project) do
License
.project-home-links .project-home-links
- unless @project.empty_repo? - unless @project.empty_repo?
= link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) = link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref)
...@@ -56,17 +68,6 @@ ...@@ -56,17 +68,6 @@
Version: Version:
%span.count %span.count
= @repository.blob_by_oid(version.id).data = @repository.blob_by_oid(version.id).data
- elsif @repository.changelog
= link_to changelog_url(@project), class: 'btn btn-block' do
View changelog
- if @repository.contribution_guide
= link_to contribution_guide_url(@project), class: 'btn btn-block' do
View contribution guide
- if @repository.license
= link_to license_url(@project), class: 'btn btn-block' do
View license
.prepend-top-10.append-bottom-10 .prepend-top-10.append-bottom-10
%p %p
...@@ -96,7 +97,7 @@ ...@@ -96,7 +97,7 @@
%span.light CI provided by %span.light CI provided by
= link_to ci_service.title, ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' = link_to ci_service.title, ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink'
- if readme - if readme = @repository.readme
.tab-pane#tab-readme .tab-pane#tab-readme
%article.readme-holder#README %article.readme-holder#README
= link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment