Actualizar plugin Checklists a 3.1.18 light
This commit is contained in:
parent
a26f5567af
commit
24560c8598
55 changed files with 992 additions and 307 deletions
|
@ -1,8 +1,11 @@
|
|||
<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'
|
||||
%>
|
||||
<li id="checklist_item_<%= checklist_item.id %>" class="<%= 'is-done-checklist-item' if checklist_item.is_done %> <%= 'checklist-section' if checklist_item.is_section %>">
|
||||
<% unless checklist_item.is_section %>
|
||||
<%= 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',
|
||||
id: "checklist-checkbox-#{checklist_item.id}"
|
||||
%>
|
||||
<% end %>
|
||||
<%= textilizable(checklist_item, :subject).gsub(/<\/?(p|h\d+|li|ul)>/, '').strip.html_safe %>
|
||||
|
||||
</li>
|
||||
|
|
|
@ -2,3 +2,16 @@ $("#checklist_item_<%= @checklist_item.id %>").toggleClass('is-done-checklist-it
|
|||
$('#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 %>');
|
||||
|
||||
var checkedCheckboxes = $('.checklist-checkbox:checkbox:checked');
|
||||
|
||||
if(localStorage.getItem("hide_closed_checklists") === '0' && checkedCheckboxes.length > 0){
|
||||
$("#checklist_item_<%= @checklist_item.id %>").fadeOut(1000).hide(15);
|
||||
$('#switch_link').text('<%= l("label_checklist_show_closed") %>' + '(' + checkedCheckboxes.length + ')');
|
||||
}
|
||||
if(checkedCheckboxes.length < 1 && localStorage.getItem("hide_closed_checklists") === '1'){
|
||||
$('#switch_link').hide();
|
||||
}
|
||||
if(checkedCheckboxes.length > 0){
|
||||
$('#switch_link').show();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue