You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by as...@apache.org on 2008/05/16 10:38:27 UTC

svn commit: r656969 - in /ode/sandbox/singleshot: app/helpers/ app/models/ app/views/activities/ app/views/tasks/ lib/tasks/ public/stylesheets/

Author: assaf
Date: Fri May 16 01:38:26 2008
New Revision: 656969

URL: http://svn.apache.org/viewvc?rev=656969&view=rev
Log:
Changed order of priorities: 1 is highest.
Added hAtom formatting.

Modified:
    ode/sandbox/singleshot/app/helpers/application_helper.rb
    ode/sandbox/singleshot/app/helpers/task_helper.rb
    ode/sandbox/singleshot/app/models/task.rb
    ode/sandbox/singleshot/app/views/activities/show.html.erb
    ode/sandbox/singleshot/app/views/tasks/index.atom.builder
    ode/sandbox/singleshot/app/views/tasks/index.html.erb
    ode/sandbox/singleshot/lib/tasks/database.rake
    ode/sandbox/singleshot/public/stylesheets/default.css

Modified: ode/sandbox/singleshot/app/helpers/application_helper.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/helpers/application_helper.rb?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/helpers/application_helper.rb (original)
+++ ode/sandbox/singleshot/app/helpers/application_helper.rb Fri May 16 01:38:26 2008
@@ -28,8 +28,8 @@
     end
   end
 
-  def relative_date_abbr(date)
-    content_tag 'abbr', relative_date(date), :title=>date.to_date.to_s
+  def relative_date_abbr(date, options = {})
+    content_tag 'abbr', relative_date(date), options.merge(:title=>date.to_date.to_s)
   end
 
 end

Modified: ode/sandbox/singleshot/app/helpers/task_helper.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/helpers/task_helper.rb?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/helpers/task_helper.rb (original)
+++ ode/sandbox/singleshot/app/helpers/task_helper.rb Fri May 16 01:38:26 2008
@@ -10,7 +10,7 @@
   end
 
   def task_vitals(task)
-    vitals = ['Created ' + relative_date_abbr(task.created_at)]
+    vitals = ['Created ' + relative_date_abbr(task.created_at, :class=>'published')]
     vitals.first << ' by ' + link_to_person(task.creator) if task.creator
     vitals << (task.status == 'completed' ? "completed by " : "assigned to ") + link_to_person(task.owner) if task.owner
     vitals << "due on #{task.due_on.to_formatted_s(:long)}" if task.due_on

Modified: ode/sandbox/singleshot/app/models/task.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/models/task.rb?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/models/task.rb (original)
+++ ode/sandbox/singleshot/app/models/task.rb Fri May 16 01:38:26 2008
@@ -157,10 +157,10 @@
   }
 
   named_scope :pending, :conditions=>["tasks.state IN ('ready', 'active') AND involved.role IN ('owner', 'potential')"],
-    :order=>'involved.role, priority DESC, tasks.created_at' do
+    :order=>'involved.role, priority ASC, tasks.created_at' do
     def prioritized
       today = Date.today
-      prioritize = lambda { |task| [task.state == 'active' ? 0 : 1, task.due_on && task.due_on <= today ? task.due_on - today : 1, -task.priority] }
+      prioritize = lambda { |task| [task.state == 'active' ? 0 : 1, task.due_on && task.due_on <= today ? task.due_on - today : 1, task.priority] }
       self.sort { |a, b| prioritize[a] <=> prioritize[b] }
     end
   end

Modified: ode/sandbox/singleshot/app/views/activities/show.html.erb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/activities/show.html.erb?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/activities/show.html.erb (original)
+++ ode/sandbox/singleshot/app/views/activities/show.html.erb Fri May 16 01:38:26 2008
@@ -1,12 +1,12 @@
-<ol class='activities'>
+<ol class='activities hfeed'>
   <% for day in @days %>
     <li class='day'>
       <h3><%= day.first.to_formatted_s(:long) %></h3>
       <% for activity in day.last %>
-        <% content_tag_for 'li', activity do %>
+      <% content_tag_for 'li', activity, :class=>'hentry entry-title' do %>
           <%= link_to activity.person.fullname, activity.person.identity %>
           <%= activity.action %>
-          <%= link_to activity.task.title, task_url(activity.task) %>
+          <%= link_to activity.task.title, task_url(activity.task), :rel=>'bookmark' %>
         <% end %>
       <% end %>
     </li>

Modified: ode/sandbox/singleshot/app/views/tasks/index.atom.builder
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/tasks/index.atom.builder?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/tasks/index.atom.builder (original)
+++ ode/sandbox/singleshot/app/views/tasks/index.atom.builder Fri May 16 01:38:26 2008
@@ -6,7 +6,8 @@
     feed.entry task do |entry|
       entry.title task.title
       entry.content :type=>'html' do |content|
-        content.text! "<p>#{h(task.description)}</p>"
+        priority = "<span style='color:red'>✭</span> " if task.priority == Task::PRIORITIES.first
+        content.text! "<p>#{priority}#{h(task.description)}</p>"
         content.text! "<p><em>#{task_vitals(task)}</em></p>"
         content.text! "<div>#{task_actions(task)}</div>"
       end

Modified: ode/sandbox/singleshot/app/views/tasks/index.html.erb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/tasks/index.html.erb?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/tasks/index.html.erb (original)
+++ ode/sandbox/singleshot/app/views/tasks/index.html.erb Fri May 16 01:38:26 2008
@@ -1,14 +1,13 @@
-<ol class='tasks'>
+<ol class='tasks hfeed'>
   <% @tasks.each do |task| %>
-    <% content_tag_for 'li', task do %>
-    <div class='actions'><%= task_actions(task) %>
-        <%= button_to 'Manage', edit_task_url(task), :method=>:get, :title=>'Edit task' if task.admin?(authenticated) %>
-        <%= button_to 'Cancel', task_url(task), :method=>:delete, :title=>'Cancel this task' if task.can_cancel?(authenticated) %>
-        <%= button_to 'Claim', task, :title=>'Claim task', :disabled=>!task.can_claim?(authenticated) if task.active? || task.ready? %>
+    <% content_tag_for 'li', task, :class=>'hentry' do %>
+      <div class='actions'><%= task_actions(task) %></div>
+      <h3 class='entry-title priority_<%= task.priority %> <%= 'overdue' if task.over_due? %>'>
+        <%= link_to h(task.title), task_url(task), :rel=>'bookmark', :title=>'View/perform task' %></h3>
+      <div class='entry-content'>
+        <p class='description'><%= h(task.description) %></p>
+        <p class='vitals'><%= task_vitals(task) %></p>
       </div>
-      <h3 class='title priority_<%= task.priority %> <%= 'overdue' if task.over_due? %>'><%= link_to h(task.title), task_url(task), :title=>'View/perform task' %></h3>
-      <p class='description'><%= h(task.description) %></p>
-      <p class='vitals'><%= task_vitals(task) %></p>
     <% end %>
   <% end %>
 </ol>

Modified: ode/sandbox/singleshot/lib/tasks/database.rake
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/lib/tasks/database.rake?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/lib/tasks/database.rake (original)
+++ ode/sandbox/singleshot/lib/tasks/database.rake Fri May 16 01:38:26 2008
@@ -44,7 +44,7 @@
     create[:potential_owners=>[you, other]]
     create[:owner=>other, :potential_owners=>you]
     # High priority should show first.
-    create[:owner=>you, :priority=>3]
+    create[:owner=>you, :priority=>Task::PRIORITIES.first]
     # Over-due before due today before anything else.
     create[:owner=>you, :due_on=>Time.today - 1.day]
     create[:owner=>you, :due_on=>Time.today]

Modified: ode/sandbox/singleshot/public/stylesheets/default.css
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/public/stylesheets/default.css?rev=656969&r1=656968&r2=656969&view=diff
==============================================================================
--- ode/sandbox/singleshot/public/stylesheets/default.css (original)
+++ ode/sandbox/singleshot/public/stylesheets/default.css Fri May 16 01:38:26 2008
@@ -234,19 +234,15 @@
   border-bottom: 1px solid #ccc;
   margin-bottom: 1.5em;
 }
-ol.tasks li.task h3.title {
+ol.tasks li.task .entry-title {
   font-size: 1.2em;
   margin: 0;
 }
-ol.tasks li.task h3.title.priority_2:before {
-  content: '✭ ';
-  color: yellow;
-}
-ol.tasks li.task h3.title.priority_3:before {
+ol.tasks li.task .entry-title.priority_1:before {
   content: '✭ ';
   color: red;
 }
-ol.tasks li.task h3.title.overdue a {
+ol.tasks li.task .entry-title.overdue a {
   color: red;
 }
 ol.tasks li.task a {
@@ -275,7 +271,7 @@
   border-bottom: 1px solid #ccc;
 }
 ol.activities li.activity {
-  margin: 0 0 0.5em 0;
+  margin: 0 0 1.0em 0;
 }
 
 
@@ -303,3 +299,8 @@
   background-color: #eee;
   cursor:default;
 }
+
+abbr {
+  text-decoration: none;
+  border: none;
+}