2012-02-23 14:48:31 +00:00
|
|
|
.block
|
|
|
|
%h3=t('layout.issues.labels')
|
|
|
|
#labels-stock
|
|
|
|
=form_tag project_issues_path(@project), :id => 'filter_labels', :method => :get do
|
|
|
|
- @project.labels.each_with_index do |label, index|
|
2012-09-21 18:57:22 +01:00
|
|
|
=render 'projects/shared/filter_label',
|
|
|
|
:id => label.name.parameterize,
|
|
|
|
:selected => @labels.include?(label.name),
|
|
|
|
:extra_classes => 'div-tracker-labels',
|
|
|
|
:color => label.color,
|
|
|
|
:check_box_name => 'labels',
|
|
|
|
:check_box_value => label.name,
|
|
|
|
:name => label.name,
|
|
|
|
:count => Labeling.joins(:label).where(:labels => {:name => label.name, :project_id => @project.id}).count
|
2012-02-23 14:48:31 +00:00
|
|
|
- if can? :write, @project
|
|
|
|
%a#manage-labels.button.tmargin10{:href => "#labels-stock"}=t('layout.issues.label_manage')
|
|
|
|
#labels-edit{:style => "display: none;"}
|
|
|
|
- @project.labels.each_with_index do |label, index|
|
|
|
|
.label.edit{:id => "label-#{index}"}
|
|
|
|
.labeltext.edit{:style => "background: ##{label.color};"}
|
|
|
|
.text=link_to(label.name, project_issues_update_label_path(@project, label.id), :class => 'edit_label')
|
|
|
|
.delete{:id => "delete#{index}"}
|
2012-03-01 17:33:46 +00:00
|
|
|
%a{:href => project_issues_delete_label_path(@project, label.id), :class => 'delete_label'}= image_tag 'x-label.png'
|
2012-02-23 14:48:31 +00:00
|
|
|
.both
|
|
|
|
.edit_label_form{:style => 'display:none'}
|
|
|
|
=form_tag project_issues_update_label_path(@project, label.id), :id => 'update_label', :method => :post do
|
|
|
|
%input.gray{:name => 'name', :type => "text", :value => label.name}
|
2012-05-02 10:18:07 +01:00
|
|
|
=render 'colors_chooser', :current_color => label.color
|
2012-02-23 14:48:31 +00:00
|
|
|
.lefter
|
|
|
|
%a{:href => "#custom_color-#{label.name}", :id => "custom_color-#{label.name}", :class => 'custom_color'}=t('layout.issues.label_custom_color')
|
|
|
|
=text_field_tag :color, label.color, :id => 'label_color', :class => 'gray', :style => 'display:none', :maxlength => 6
|
|
|
|
.righter
|
|
|
|
=link_to t('layout.update'), project_issues_update_label_path(@project, label.id), :id => 'update_label', :class => 'button'
|
|
|
|
.both
|
|
|
|
|
|
|
|
=form_tag create_label_project_issues_path(@project), :id => 'new_label', :method => :post do
|
2012-02-27 16:10:12 +00:00
|
|
|
=tracker_search_field(:name, t('layout.issues.new_label'))
|
2012-05-02 10:18:07 +01:00
|
|
|
=render 'colors_chooser'
|
2012-02-23 14:48:31 +00:00
|
|
|
.lefter
|
|
|
|
%a{:href => "#custom_color", :id => 'custom_color', :class => 'custom_color'}=t('layout.issues.label_custom_color')
|
|
|
|
=text_field_tag :color, '0054a6', :id => 'label_color', :class => 'gray', :style => 'display:none', :maxlength => 6
|
|
|
|
.righter
|
|
|
|
=link_to t('layout.add'), create_label_project_issues_path(@project), :id => 'add_label', :class => 'button'
|
|
|
|
.both
|