Commit 7e6030e4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'create-issue-view' into 'master'

Create issue view

This changes the create/edit issue view, to only show the create milestone/label links if the user is allowed to create one, and puts the 'Please review the guidelines for contribution to this repository' message above the submit button.

Screenshots [Before](https://gitlab.com/uploads/stephanvl/gitlab-ce/ae2ff67f88/Screenshot_from_2014-12-29_20_43_06.png) - [After (allowed)](https://gitlab.com/uploads/stephanvl/gitlab-ce/3a4682d776/Screenshot_from_2014-12-29_20_43_29.png) - [After (not allowed)](https://gitlab.com/uploads/stephanvl/gitlab-ce/86a548d3b3/Screenshot_from_2014-12-29_20_44_00.png)

See merge request !272
parents 9b3ab90a 25c37b0e
......@@ -52,10 +52,11 @@
- else
%span.light No open milestones available.
 
= link_to 'Create new milestone', new_project_milestone_path(issuable.project), target: :blank
- if can? current_user, :admin_milestone, issuable.project
= link_to 'Create new milestone', new_project_milestone_path(issuable.project), target: :blank
.form-group
= f.label :label_ids, class: 'control-label' do
%i.icon-tag
%i.fa.fa-tag
Labels
.col-sm-10
- if issuable.project.labels.any?
......@@ -64,9 +65,15 @@
- else
%span.light No labels yet.
 
= link_to 'Create new label', new_project_label_path(issuable.project), target: :blank
- if can? current_user, :admin_label, issuable.project
= link_to 'Create new label', new_project_label_path(issuable.project), target: :blank
.form-actions
- if !issuable.project.empty_repo? && contribution_guide_url(issuable.project) && !issuable.persisted?
%p
Please review the
%strong #{link_to 'guidelines for contribution', contribution_guide_url(issuable.project)}
to this repository.
- if issuable.new_record?
= f.submit "Submit new #{issuable.class.model_name.human.downcase}", class: 'btn btn-create'
- else
......
%div.issue-form-holder
%h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}"
%hr
- if @repository.exists? && !@repository.empty? && @repository.contribution_guide && !@issue.persisted?
- contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name))
.row
.col-sm-10.col-sm-offset-2
.alert.alert-info
= "Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe
= form_for [@project, @issue], html: { class: 'form-horizontal issue-form gfm-form' } do |f|
= render 'projects/issuable_form', f: f, issuable: @issue
......
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