Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-18 21:02:39 +0300
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-18 21:02:39 +0300
commitd03d63630494727e92553f168712d177ab4eb1cf (patch)
treebf669b6034b0dc7710becbeab989ec92e1116aed /app/views/projects
parenta0c513bb4ecc5ef4d2d626c024de6916c5ef233a (diff)
parentb1b8261f56d35e471bc32b0f2050e27650b7c797 (diff)
Merge branch 'changelog-link' into 'master'
Add changelog, license and contribution guide links to project sidebar. If the version is known, the "Version: 7.9.0pre" button links to the changelog, otherwise a "View changelog" button is shown. ![Screen_Shot_2015-03-18_at_14.22.29](https://dev.gitlab.org/gitlab/gitlabhq/uploads/747acc018ec9a188098e0f0bc4e91cc3/Screen_Shot_2015-03-18_at_14.22.29.png) See merge request !1708
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/_issuable_form.html.haml4
-rw-r--r--app/views/projects/merge_requests/_new_submit.html.haml4
-rw-r--r--app/views/projects/show.html.haml23
3 files changed, 21 insertions, 10 deletions
diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml
index a7cd129b631..7fd5fe8a6e1 100644
--- a/app/views/projects/_issuable_form.html.haml
+++ b/app/views/projects/_issuable_form.html.haml
@@ -71,10 +71,10 @@
= link_to 'Create new label', new_namespace_project_label_path(issuable.project.namespace, issuable.project), target: :blank
.form-actions
- - if !issuable.project.empty_repo? && contribution_guide_url(issuable.project) && !issuable.persisted?
+ - if !issuable.project.empty_repo? && (guide_url = contribution_guide_url(issuable.project)) && !issuable.persisted?
%p
Please review the
- %strong #{link_to 'guidelines for contribution', contribution_guide_url(issuable.project)}
+ %strong #{link_to 'guidelines for contribution', guide_url}
to this repository.
- if issuable.new_record?
= f.submit "Submit new #{issuable.class.model_name.human.downcase}", class: 'btn btn-create'
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
index bf80afe8785..1d8eef4e8ce 100644
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/_new_submit.html.haml
@@ -69,10 +69,10 @@
= link_to 'Create new label', new_namespace_project_label_path(@merge_request.target_project.namespace, @merge_request.target_project), target: :blank
.form-actions
- - if contribution_guide_url(@target_project)
+ - if guide_url = contribution_guide_url(@target_project)
%p
Please review the
- %strong #{link_to 'guidelines for contribution', contribution_guide_url(@target_project)}
+ %strong #{link_to 'guidelines for contribution', guide_url}
to this repository.
= f.hidden_field :source_project_id
= f.hidden_field :source_branch
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index 74b07395650..822e67c5616 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -47,15 +47,26 @@
= link_to @project.forked_from_project.name_with_namespace, namespace_project_path(@project.namespace, @project.forked_from_project)
- unless @project.empty_repo?
- = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' do
- Compare code
-
- - if @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
+ - if version = @repository.version
+ - detail_url = changelog_url(@project) || version_url(@project)
+ = link_to detail_url, class: 'btn btn-block' do
Version:
%span.count
= @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
+
+ = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' do
+ Compare code
.prepend-top-10
%p