Nuevo plugin Redmine Checklist 3.1.10 light
This commit is contained in:
parent
294bc87e76
commit
ef5521e0a2
65 changed files with 3544 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
<li id="checklist_item_<%= checklist_item.id %>" <%= "class=is-done-checklist-item" if checklist_item.is_done %> >
|
||||
<%= check_box_tag 'checklist_item', "", checklist_item.is_done,
|
||||
:disabled => !User.current.allowed_to?(:done_checklists, checklist_item.issue.project) && !User.current.allowed_to?(:edit_checklists, checklist_item.issue.project),
|
||||
:data_url => url_for( {:controller => "checklists", :action => "done", :id => checklist_item.id} ), :class => 'checklist-checkbox'
|
||||
%>
|
||||
<%= textilizable(checklist_item, :subject).gsub(/<\/?(p|h\d+|li|ul)>/, '').strip.html_safe %>
|
||||
|
||||
</li>
|
|
@ -0,0 +1,4 @@
|
|||
$("#checklist_item_<%= @checklist_item.id %>").toggleClass('is-done-checklist-item');
|
||||
$('#checklist_form .checklist-item#<%= @checklist_item.id %> input[type=checkbox]').trigger('click');
|
||||
$('.issue .attributes table.progress').parent().html('<%= j(progress_bar(@checklist_item.issue.done_ratio, :width => '80px', :legend => "#{@checklist_item.issue.done_ratio}%")) %>');
|
||||
$('#issue_done_ratio').val('<%= @checklist_item.issue.done_ratio %>');
|
|
@ -0,0 +1,14 @@
|
|||
api.array :checklists, api_meta(:total_count => @checklists.size) do
|
||||
@checklists.each do |checklist|
|
||||
api.checklist do
|
||||
api.id checklist.id
|
||||
api.issue_id checklist.issue_id
|
||||
api.subject checklist.subject
|
||||
api.is_done checklist.is_done
|
||||
api.position checklist.position
|
||||
|
||||
api.created_at checklist.created_at
|
||||
api.updated_at checklist.updated_at
|
||||
end
|
||||
end
|
||||
end
|
10
plugins/redmine_checklists/app/views/checklists/show.api.rsb
Normal file
10
plugins/redmine_checklists/app/views/checklists/show.api.rsb
Normal file
|
@ -0,0 +1,10 @@
|
|||
api.checklist do
|
||||
api.id @checklist_item.id
|
||||
api.issue_id @checklist_item.issue_id
|
||||
api.subject @checklist_item.subject
|
||||
api.is_done @checklist_item.is_done
|
||||
api.position @checklist_item.position
|
||||
|
||||
api.created_at @checklist_item.created_at
|
||||
api.updated_at @checklist_item.updated_at
|
||||
end
|
|
@ -0,0 +1,16 @@
|
|||
<% if !@issue.blank? && @issue.checklists.any? && User.current.allowed_to?(:view_checklists, @project) %>
|
||||
<hr />
|
||||
<div id="checklist">
|
||||
|
||||
<p><strong><%=l(:label_checklist_plural)%></strong></p>
|
||||
|
||||
<ul id="checklist_items">
|
||||
<% @issue.checklists.each do |checklist_item| %>
|
||||
<%= render :partial => 'checklists/checklist_item', :object => checklist_item %>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<% end %>
|
|
@ -0,0 +1,21 @@
|
|||
<span class="checklist-item <%= new_or_show(f) %>" id = "<%=f.object.id%>">
|
||||
<span class = "checklist-show-only checklist-checkbox"><%= f.check_box :is_done %></span>
|
||||
<span class = "checklist-show checklist-subject <%= done_css(f) %>">
|
||||
<%= f.object.subject %>
|
||||
</span>
|
||||
<span class = "checklist-edit checklist-new checklist-edit-box">
|
||||
<%= text_field_tag nil, f.object.subject, :class => 'edit-box'%>
|
||||
<%= f.hidden_field :subject, :class => 'checklist-subject-hidden' %>
|
||||
</span>
|
||||
<span class= "checklist-edit-only checklist-edit-save-button"><%= submit_tag l(:button_save), :type => "button", :class => "item item-save small"%> </span>
|
||||
<span class= "checklist-edit-only checklist-edit-reset-button"><% concat l(:button_cancel)
|
||||
%> </span>
|
||||
<span class = "checklist-show-only checklist-remove"><%= link_to_remove_checklist_fields "", f,
|
||||
:class => "icon icon-del" %></span>
|
||||
<%= f.hidden_field :position, :class => 'checklist-item-position' %>
|
||||
<%= f.hidden_field :id, :class => 'checklist-item-id' %>
|
||||
<span class = "icon icon-add checklist-new-only save-new-by-button"></span>
|
||||
|
||||
<br>
|
||||
</span>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<% if User.current.allowed_to?(:edit_checklists, @project, :global => true) %>
|
||||
<div class="tabular">
|
||||
<p id="checklist_form">
|
||||
<label><%=l(:label_checklist_plural)%></label>
|
||||
<% @issue.checklists.build if @issue.checklists.blank? || @issue.checklists.last.subject.present? %>
|
||||
<%= fields_for :issue, issue do |f| -%>
|
||||
<span id="checklist_form_items" data-checklist-fields='<%= fields(f, :checklists) %>'>
|
||||
<%= f.fields_for :checklists do |builder| %>
|
||||
<%= render :partial => 'checklist_fields', :locals => {:f => builder, :checklist => @checklist} %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
<% unless User.current.allowed_to?(:done_checklists, @project) %>
|
||||
$("#checklist_items input").attr("disabled", true);
|
||||
<% end %>
|
||||
|
||||
$("span#checklist_form_items").checklist();
|
||||
$("#checklist_items").checklist();
|
||||
<% end %>
|
|
@ -0,0 +1,8 @@
|
|||
<% checklist_tabs = [
|
||||
{:name => 'general', :partial => 'settings/checklists/general', :label => :label_general}]
|
||||
|
||||
%>
|
||||
|
||||
<%= render_tabs checklist_tabs %>
|
||||
|
||||
<% html_title(l(:label_settings), l(:label_checklists)) -%>
|
|
@ -0,0 +1,7 @@
|
|||
<% if Setting.issue_done_ratio == "issue_field" %>
|
||||
<p>
|
||||
<label for="settings_issue_done_ratio"><%= l(:label_checklist_done_ratio) %></label>
|
||||
<%= hidden_field_tag 'settings[issue_done_ratio]', 0, :id => nil %>
|
||||
<%= check_box_tag 'settings[issue_done_ratio]', 1, @settings["issue_done_ratio"].to_i > 0 %>
|
||||
</p>
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue