myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3732] branches/packs: added detection and warnin


From: noreply
Subject: [myexperiment-hackers] [3732] branches/packs: added detection and warning message for out-of-date checklists
Date: Fri, 27 Sep 2013 11:53:55 +0000 (UTC)

Revision
3732
Author
dgc
Date
2013-09-27 11:53:54 +0000 (Fri, 27 Sep 2013)

Log Message

added detection and warning message for out-of-date checklists

Modified Paths

Diff

Modified: branches/packs/app/models/checklist.rb (3731 => 3732)


--- branches/packs/app/models/checklist.rb	2013-09-27 01:05:53 UTC (rev 3731)
+++ branches/packs/app/models/checklist.rb	2013-09-27 11:53:54 UTC (rev 3732)
@@ -39,6 +39,8 @@
     results[:sub_results].each do |sr|
       checklist_items.build(:colour => sr[:colour].to_s, :text => sr[:text]).save
     end
+
+    touch
   end
 
 private

Modified: branches/packs/app/models/resource.rb (3731 => 3732)


--- branches/packs/app/models/resource.rb	2013-09-27 01:05:53 UTC (rev 3731)
+++ branches/packs/app/models/resource.rb	2013-09-27 11:53:54 UTC (rev 3732)
@@ -13,6 +13,9 @@
   
   before_save :copy_metadata
 
+  after_save    :touch_research_object
+  after_destroy :touch_research_object
+
   belongs_to :research_object
 
   belongs_to :content_blob, :dependent => :destroy
@@ -297,6 +300,10 @@
     research_object.update_manifest!
   end
 
+  def touch_research_object
+    research_object.touch
+  end
+
   def destroy_related_resources
     
     # Delete the proxy for this resource if it exists.

Modified: branches/packs/app/views/checklists/show.html.erb (3731 => 3732)


--- branches/packs/app/views/checklists/show.html.erb	2013-09-27 01:05:53 UTC (rev 3731)
+++ branches/packs/app/views/checklists/show.html.erb	2013-09-27 11:53:54 UTC (rev 3732)
@@ -1,5 +1,11 @@
 <h1>Checklist result: <%=h @checklist.label -%></h1>
 
+<% if @checklist.updated_at < @checklist.research_object.updated_at %>
+  <div class="checklist-out-of-date-warning">
+    This checklist is out of date and needs to be re-run.
+  </div>
+<% end %>
+
 <table class="checklist simple">
   <% @checklist.checklist_items.each do |item| %>
     <tr>

Modified: branches/packs/public/stylesheets/styles.css (3731 => 3732)


--- branches/packs/public/stylesheets/styles.css	2013-09-27 01:05:53 UTC (rev 3731)
+++ branches/packs/public/stylesheets/styles.css	2013-09-27 11:53:54 UTC (rev 3732)
@@ -353,6 +353,7 @@
 #myexp_breadcrumbs_bar {
 	text-decoration: none;
 	padding: 4px;
+  padding-left: 6px;
 	background-color: #E0E0E0;
 }
 
@@ -2736,3 +2737,11 @@
   background: #ada;
 }
 
+DIV.checklist-out-of-date-warning {
+  border: 1px solid #f88;
+  background: #fdb;
+  width: 330px;
+  margin: auto;
+  padding: 12px;
+  text-align: center;
+}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]