From d2808476e3f85c9940500b84ee14d38615ceca41 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 2 Oct 2014 12:49:31 +0300 Subject: Add new milestone link. Hide empty milestone selectbox Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_issuable_form.html.haml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml index 0ae1fb3cabe..316b71f6be7 100644 --- a/app/views/projects/_issuable_form.html.haml +++ b/app/views/projects/_issuable_form.html.haml @@ -42,8 +42,14 @@ = f.label :milestone_id, class: 'control-label' do %i.icon-time Milestone - .col-sm-10= f.select(:milestone_id, milestone_options(issuable), - { include_blank: 'Select milestone' }, { class: 'select2' }) + .col-sm-10 + - if milestone_options(issuable).present? + = f.select(:milestone_id, milestone_options(issuable), + { include_blank: 'Select milestone' }, { class: 'select2' }) + - else + %span.light No open milestones available. +   + = link_to 'Create new milestone', new_project_milestone_path .form-group = f.label :label_ids, class: 'control-label' do %i.icon-tag -- cgit v1.2.1 From d3388d4790c6d09e97d9961e3e9de2d0c60d704b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 2 Oct 2014 12:55:02 +0300 Subject: New label link Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_issuable_form.html.haml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml index 316b71f6be7..114470f1db4 100644 --- a/app/views/projects/_issuable_form.html.haml +++ b/app/views/projects/_issuable_form.html.haml @@ -49,14 +49,20 @@ - else %span.light No open milestones available.   - = link_to 'Create new milestone', new_project_milestone_path + = link_to 'Create new milestone', new_project_milestone_path(issuable.project) .form-group = f.label :label_ids, class: 'control-label' do %i.icon-tag Labels .col-sm-10 - = f.collection_select :label_ids, issuable.project.labels.all, :id, :name, + - if issuable.project.labels.any? + = f.collection_select :label_ids, issuable.project.labels.all, :id, :name, { selected: issuable.label_ids }, multiple: true, class: 'select2' + - else + %span.light No labels yet. +   + = link_to 'Create new label', new_project_label_path(issuable.project) + .form-actions - if issuable.new_record? = f.submit "Submit new #{issuable.class.model_name.human.downcase}", class: 'btn btn-create' -- cgit v1.2.1