@@ -0,0 +1,11 @@
|
||||
<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|hr \/)>/, '').strip.html_safe %>
|
||||
</li>
|
||||
@@ -0,0 +1,17 @@
|
||||
$("#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 %>');
|
||||
|
||||
var checkedCheckboxes = $('#checklist_items .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();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
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.is_section checklist.is_section
|
||||
|
||||
api.created_at checklist.created_at
|
||||
api.updated_at checklist.updated_at
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
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.is_section @checklist_item.is_section
|
||||
|
||||
api.created_at @checklist_item.created_at
|
||||
api.updated_at @checklist_item.updated_at
|
||||
end
|
||||
Reference in New Issue
Block a user