Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
133
app/views/custom_fields/_form.html.erb
Normal file
133
app/views/custom_fields/_form.html.erb
Normal file
|
@ -0,0 +1,133 @@
|
|||
<%= error_messages_for 'custom_field' %>
|
||||
|
||||
<div class="splitcontentleft">
|
||||
<div class="box tabular">
|
||||
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></p>
|
||||
<p><%= f.text_field :name, :size => 50, :required => true %></p>
|
||||
<p><%= f.text_area :description, :rows => 7 %></p>
|
||||
|
||||
<% if @custom_field.format.multiple_supported %>
|
||||
<p>
|
||||
<%= f.check_box :multiple %>
|
||||
<% if !@custom_field.new_record? && @custom_field.multiple %>
|
||||
<em class="info"><%= l(:text_turning_multiple_off) %></em>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= render_custom_field_format_partial f, @custom_field %>
|
||||
|
||||
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
|
||||
</div>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
</div>
|
||||
|
||||
<div class="splitcontentright">
|
||||
<div class="box tabular">
|
||||
<% case @custom_field.class.name
|
||||
when "IssueCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
<% if @custom_field.format.searchable_supported %>
|
||||
<p><%= f.check_box :searchable %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "UserCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<p><%= f.check_box :visible %></p>
|
||||
<p><%= f.check_box :editable %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "ProjectCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<p><%= f.check_box :visible %></p>
|
||||
<% if @custom_field.format.searchable_supported %>
|
||||
<p><%= f.check_box :searchable %></p>
|
||||
<% end %>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "VersionCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "GroupCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% when "TimeEntryCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<% if @custom_field.format.is_filter_supported %>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<% end %>
|
||||
|
||||
<% else %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
|
||||
<% end %>
|
||||
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
||||
</div>
|
||||
|
||||
<% if @custom_field.is_a?(IssueCustomField) %>
|
||||
|
||||
<fieldset class="box tabular"><legend><%= l(:field_visible) %></legend>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on',
|
||||
:data => {:disables => '.custom_field_role input'} %>
|
||||
<%= l(:label_visibility_public) %>
|
||||
</label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off',
|
||||
:data => {:enables => '.custom_field_role input'} %>
|
||||
<%= l(:label_visibility_roles) %>:
|
||||
</label>
|
||||
<% role_ids = @custom_field.role_ids %>
|
||||
<% Role.givable.sorted.each do |role| %>
|
||||
<label class="block custom_field_role" style="padding-left:2em;">
|
||||
<%= check_box_tag 'custom_field[role_ids][]', role.id, role_ids.include?(role.id), :id => nil %>
|
||||
<%= role.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'custom_field[role_ids][]', '' %>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend>
|
||||
<% tracker_ids = @custom_field.tracker_ids %>
|
||||
<% Tracker.sorted.each do |tracker| %>
|
||||
<%= check_box_tag "custom_field[tracker_ids][]",
|
||||
tracker.id,
|
||||
tracker_ids.include?(tracker.id),
|
||||
:id => "custom_field_tracker_ids_#{tracker.id}" %>
|
||||
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
|
||||
<%= tracker.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
|
||||
<p><%= check_all_links 'custom_field_tracker_ids' %></p>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="box"><legend><%= l(:label_project_plural) %></legend>
|
||||
<p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p>
|
||||
|
||||
<div id="custom_field_project_ids">
|
||||
<% project_ids = @custom_field.project_ids.to_a %>
|
||||
<%= render_project_nested_lists(Project.all) do |p|
|
||||
content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p)
|
||||
end %>
|
||||
<%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
|
||||
<p><%= check_all_links 'custom_field_project_ids' %></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% include_calendar_headers_tags %>
|
30
app/views/custom_fields/_index.html.erb
Normal file
30
app/views/custom_fields/_index.html.erb
Normal file
|
@ -0,0 +1,30 @@
|
|||
<table class="list custom_fields">
|
||||
<thead><tr>
|
||||
<th><%=l(:field_name)%></th>
|
||||
<th><%=l(:field_field_format)%></th>
|
||||
<th><%=l(:field_is_required)%></th>
|
||||
<% if tab[:name] == 'IssueCustomField' %>
|
||||
<th><%=l(:field_is_for_all)%></th>
|
||||
<th><%=l(:label_used_by)%></th>
|
||||
<% end %>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%>
|
||||
<% back_url = custom_fields_path(:tab => tab[:name]) %>
|
||||
<tr>
|
||||
<td class="name"><%= link_to custom_field.name, edit_custom_field_path(custom_field) %></td>
|
||||
<td><%= l(custom_field.format.label) %></td>
|
||||
<td><%= checked_image custom_field.is_required? %></td>
|
||||
<% if tab[:name] == 'IssueCustomField' %>
|
||||
<td><%= checked_image custom_field.is_for_all? %></td>
|
||||
<td><%= l(:label_x_projects, :count => @custom_fields_projects_count[custom_field.id] || 0) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
|
||||
<% end %>
|
||||
<td class="buttons">
|
||||
<%= reorder_handle(custom_field, :url => custom_field_path(custom_field), :param => 'custom_field') %>
|
||||
<%= delete_link custom_field_path(custom_field) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
5
app/views/custom_fields/edit.html.erb
Normal file
5
app/views/custom_fields/edit.html.erb
Normal file
|
@ -0,0 +1,5 @@
|
|||
<%= custom_field_title @custom_field %>
|
||||
|
||||
<%= labelled_form_for :custom_field, @custom_field, :url => custom_field_path(@custom_field), :html => {:method => :put, :id => 'custom_field_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<% end %>
|
4
app/views/custom_fields/formats/_attachment.html.erb
Normal file
4
app/views/custom_fields/formats/_attachment.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<p>
|
||||
<%= f.text_field :extensions_allowed, :size => 50, :label => :setting_attachment_extensions_allowed %>
|
||||
<em class="info"><%= l(:text_comma_separated) %> <%= l(:label_example) %>: txt, png</em>
|
||||
</p>
|
3
app/views/custom_fields/formats/_bool.html.erb
Normal file
3
app/views/custom_fields/formats/_bool.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p><%= f.select :default_value, [[]]+@custom_field.possible_values_options %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
||||
<p><%= edit_tag_style_tag f, :include_radio => true %></p>
|
3
app/views/custom_fields/formats/_date.html.erb
Normal file
3
app/views/custom_fields/formats/_date.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p><%= f.date_field(:default_value, :value => @custom_field.default_value, :size => 10) %></p>
|
||||
<%= calendar_for('custom_field_default_value') %>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
12
app/views/custom_fields/formats/_enumeration.erb
Normal file
12
app/views/custom_fields/formats/_enumeration.erb
Normal file
|
@ -0,0 +1,12 @@
|
|||
<% unless @custom_field.new_record? %>
|
||||
<p>
|
||||
<label><%= l(:field_possible_values) %></label>
|
||||
<%= link_to l(:button_edit), custom_field_enumerations_path(@custom_field), :class => 'icon icon-edit' %>
|
||||
</p>
|
||||
<% if @custom_field.enumerations.active.any? %>
|
||||
<p><%= f.select :default_value, @custom_field.enumerations.active.map{|v| [v.name, v.id.to_s]}, :include_blank => true %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
3
app/views/custom_fields/formats/_link.html.erb
Normal file
3
app/views/custom_fields/formats/_link.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :field_url %></p>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
7
app/views/custom_fields/formats/_list.html.erb
Normal file
7
app/views/custom_fields/formats/_list.html.erb
Normal file
|
@ -0,0 +1,7 @@
|
|||
<p>
|
||||
<%= f.text_area :possible_values, :value => @custom_field.possible_values.to_a.join("\n"), :rows => 15 %>
|
||||
<em class="info"><%= l(:text_custom_field_possible_values_info) %></em>
|
||||
</p>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
3
app/views/custom_fields/formats/_numeric.html.erb
Normal file
3
app/views/custom_fields/formats/_numeric.html.erb
Normal file
|
@ -0,0 +1,3 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
9
app/views/custom_fields/formats/_regexp.html.erb
Normal file
9
app/views/custom_fields/formats/_regexp.html.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<p>
|
||||
<label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
|
||||
<%= f.text_field :min_length, :size => 5, :no_label => true %> -
|
||||
<%= f.text_field :max_length, :size => 5, :no_label => true %>
|
||||
</p>
|
||||
<p>
|
||||
<%= f.text_field :regexp, :size => 50 %>
|
||||
<em class="info"><%= l(:text_regexp_info) %></em>
|
||||
</p>
|
4
app/views/custom_fields/formats/_string.html.erb
Normal file
4
app/views/custom_fields/formats/_string.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.check_box :text_formatting, {:label => :setting_text_formatting, :data => {:disables => '#custom_field_url_pattern'}}, 'full', '' %></p>
|
||||
<p><%= f.text_field(:default_value) %></p>
|
||||
<p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
|
6
app/views/custom_fields/formats/_text.html.erb
Normal file
6
app/views/custom_fields/formats/_text.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<%= render :partial => 'custom_fields/formats/regexp', :locals => {:f => f, :custom_field => custom_field} %>
|
||||
<p><%= f.check_box :text_formatting, {:label => :setting_text_formatting}, 'full', '' %></p>
|
||||
<% if @custom_field.class.name == "IssueCustomField" %>
|
||||
<p><%= f.check_box :full_width_layout %></p>
|
||||
<% end %>
|
||||
<p><%= f.text_area(:default_value, :rows => 5) %></p>
|
24
app/views/custom_fields/formats/_user.html.erb
Normal file
24
app/views/custom_fields/formats/_user.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
|||
<p>
|
||||
<label><%= l(:label_role) %></label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 1, custom_field.user_role.blank?, :id => 'custom_field_user_role_all',
|
||||
:data => {:disables => '.custom_field_user_role input'} %>
|
||||
<%= l(:label_all) %>
|
||||
</label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 0, custom_field.user_role.present?, :id => 'custom_field_user_role_only',
|
||||
:data => {:enables => '.custom_field_user_role input'} %>
|
||||
<%= l(:label_only) %>:
|
||||
</label>
|
||||
<% Role.givable.sorted.each do |role| %>
|
||||
<label class="block custom_field_user_role" style="padding-left:2em;">
|
||||
<%= check_box_tag 'custom_field[user_role][]',
|
||||
role.id,
|
||||
custom_field.user_role.is_a?(Array) && custom_field.user_role.include?(role.id.to_s),
|
||||
:id => nil %>
|
||||
<%= role.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'custom_field[user_role][]', '' %>
|
||||
</p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
24
app/views/custom_fields/formats/_version.html.erb
Normal file
24
app/views/custom_fields/formats/_version.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
|||
<p>
|
||||
<label><%= l(:field_status) %></label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 1, custom_field.version_status.blank?, :id => 'custom_field_version_status_all',
|
||||
:data => {:disables => '.custom_field_version_status input'} %>
|
||||
<%= l(:label_all) %>
|
||||
</label>
|
||||
<label class="block">
|
||||
<%= radio_button_tag 'status', 0, custom_field.version_status.present?, :id => 'custom_field_version_status_only',
|
||||
:data => {:enables => '.custom_field_version_status input'} %>
|
||||
<%= l(:label_only) %>:
|
||||
</label>
|
||||
<% Version::VERSION_STATUSES.each do |status| %>
|
||||
<label class="block custom_field_version_status" style="padding-left:2em;">
|
||||
<%= check_box_tag 'custom_field[version_status][]',
|
||||
status,
|
||||
custom_field.version_status.is_a?(Array) && custom_field.version_status.include?(status),
|
||||
:id => nil %>
|
||||
<%= l("version_status_#{status}") %>
|
||||
</label>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'custom_field[version_status][]', '' %>
|
||||
</p>
|
||||
<p><%= edit_tag_style_tag f %></p>
|
44
app/views/custom_fields/index.api.rsb
Normal file
44
app/views/custom_fields/index.api.rsb
Normal file
|
@ -0,0 +1,44 @@
|
|||
api.array :custom_fields do
|
||||
@custom_fields.each do |field|
|
||||
api.custom_field do
|
||||
api.id field.id
|
||||
api.name field.name
|
||||
api.customized_type field.class.customized_class.name.underscore if field.class.customized_class
|
||||
api.field_format field.field_format
|
||||
api.regexp field.regexp
|
||||
api.min_length field.min_length
|
||||
api.max_length field.max_length
|
||||
api.is_required field.is_required?
|
||||
api.is_filter field.is_filter?
|
||||
api.searchable field.searchable
|
||||
api.multiple field.multiple?
|
||||
api.default_value field.default_value
|
||||
api.visible field.visible?
|
||||
|
||||
values = field.possible_values_options
|
||||
if values.present?
|
||||
api.array :possible_values do
|
||||
values.each do |label, value|
|
||||
api.possible_value do
|
||||
api.value value || label
|
||||
api.label label
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if field.is_a?(IssueCustomField)
|
||||
api.array :trackers do
|
||||
field.trackers.each do |tracker|
|
||||
api.tracker :id => tracker.id, :name => tracker.name
|
||||
end
|
||||
end
|
||||
api.array :roles do
|
||||
field.roles.each do |role|
|
||||
api.role :id => role.id, :name => role.name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
15
app/views/custom_fields/index.html.erb
Normal file
15
app/views/custom_fields/index.html.erb
Normal file
|
@ -0,0 +1,15 @@
|
|||
<div class="contextual">
|
||||
<%= link_to l(:label_custom_field_new), new_custom_field_path, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<%= title l(:label_custom_field_plural) %>
|
||||
|
||||
<% if @custom_fields_by_type.present? %>
|
||||
<%= render_custom_fields_tabs(@custom_fields_by_type.keys) %>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(function() { $("table.custom_fields tbody").positionedItems(); });
|
||||
<% end %>
|
17
app/views/custom_fields/new.html.erb
Normal file
17
app/views/custom_fields/new.html.erb
Normal file
|
@ -0,0 +1,17 @@
|
|||
<%= custom_field_title @custom_field %>
|
||||
|
||||
<%= labelled_form_for :custom_field, @custom_field, :url => custom_fields_path, :html => {:id => 'custom_field_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= hidden_field_tag 'type', @custom_field.type %>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$('#custom_field_field_format').change(function(){
|
||||
$.ajax({
|
||||
url: '<%= new_custom_field_path(:format => 'js') %>',
|
||||
type: 'get',
|
||||
data: $('#custom_field_form').serialize(),
|
||||
complete: toggleDisabledInit
|
||||
});
|
||||
});
|
||||
<% end %>
|
1
app/views/custom_fields/new.js.erb
Normal file
1
app/views/custom_fields/new.js.erb
Normal file
|
@ -0,0 +1 @@
|
|||
$('#content').html('<%= escape_javascript(render :template => 'custom_fields/new', :layout => nil, :formats => [:html]) %>')
|
14
app/views/custom_fields/select_type.html.erb
Normal file
14
app/views/custom_fields/select_type.html.erb
Normal file
|
@ -0,0 +1,14 @@
|
|||
<%= custom_field_title @custom_field %>
|
||||
|
||||
<% selected = 0 %>
|
||||
<%= form_tag new_custom_field_path, :method => 'get' do %>
|
||||
<div class="box">
|
||||
<p><%= l(:label_custom_field_select_type) %>:</p>
|
||||
<p>
|
||||
<% custom_field_type_options.each do |name, type| %>
|
||||
<label style="display:block;"><%= radio_button_tag 'type', type, 1==selected+=1 %> <%= name %></label>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<p><%= submit_tag l(:label_next).html_safe + " »".html_safe, :name => nil %></p>
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue