mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #586 from ZmagoD/zd_SCI_1228
adds asc order to checklists [fixes SCI-1228]
This commit is contained in:
commit
6bee4cc05a
5 changed files with 5 additions and 4 deletions
|
@ -105,7 +105,7 @@ module ReportActions
|
|||
def generate_step_contents_json(step)
|
||||
res = []
|
||||
if in_params? :step_checklists
|
||||
step.checklists.each do |checklist|
|
||||
step.checklists.asc.each do |checklist|
|
||||
res << generate_new_el(false)
|
||||
res << generate_el(
|
||||
'reports/elements/step_checklist_element.html.erb',
|
||||
|
|
|
@ -22,6 +22,7 @@ class Checklist < ActiveRecord::Base
|
|||
reject_if: :all_blank,
|
||||
allow_destroy: true
|
||||
|
||||
scope :asc, -> { order('checklists.created_at ASC') }
|
||||
def self.search(user, include_archived, query = nil, page = 1)
|
||||
step_ids =
|
||||
Step
|
||||
|
|
|
@ -273,7 +273,7 @@ class Protocol < ActiveRecord::Base
|
|||
step2.save
|
||||
|
||||
# Copy checklists
|
||||
step.checklists.each do |checklist|
|
||||
step.checklists.asc.each do |checklist|
|
||||
checklist2 = Checklist.new(
|
||||
name: checklist.name,
|
||||
step: step2
|
||||
|
|
|
@ -160,7 +160,7 @@
|
|||
|
||||
<% unless step.checklists.blank? then %>
|
||||
<div class="col-xs-12">
|
||||
<% step.checklists.each do |checklist| %>
|
||||
<% step.checklists.asc.each do |checklist| %>
|
||||
<strong><%= checklist.name %></strong>
|
||||
<% if checklist.checklist_items.empty? %>
|
||||
</br>
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
|
||||
<% unless step.checklists.blank? then %>
|
||||
<div class="col-xs-12">
|
||||
<% step.checklists.each do |checklist| %>
|
||||
<% step.checklists.asc.each do |checklist| %>
|
||||
<strong><%= custom_auto_link(checklist.name) %></strong>
|
||||
<% if checklist.checklist_items.empty? %>
|
||||
</br>
|
||||
|
|
Loading…
Reference in a new issue