Author: assaf
Date: Thu Jun 19 16:32:59 2008
New Revision: 669743
URL: http://svn.apache.org/viewvc?rev=669743&view=rev
Log:
Merge branch 'ui'
Modified:
ode/sandbox/singleshot/app/helpers/task_helper.rb
ode/sandbox/singleshot/app/views/activity/index.atom.builder
ode/sandbox/singleshot/app/views/layouts/application.html.erb
ode/sandbox/singleshot/app/views/tasks/index.atom.builder
Modified: ode/sandbox/singleshot/app/helpers/task_helper.rb
URL:
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/helpers/task_helper.rb?rev=669743&r1=669742&r2=669743&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/helpers/task_helper.rb (original)
+++ ode/sandbox/singleshot/app/helpers/task_helper.rb Thu Jun 19 16:32:59 2008
@@ -51,4 +51,9 @@
uri.to_s
end
+
+ def task_url(task, *args)
+ task.cancelled? ? cancelled_task_url(task, *args) : super
+ end
+
end
Modified: ode/sandbox/singleshot/app/views/activity/index.atom.builder
URL:
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/activity/index.atom.builder?rev=669743&r1=669742&r2=669743&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/activity/index.atom.builder (original)
+++ ode/sandbox/singleshot/app/views/activity/index.atom.builder Thu Jun 19
16:32:59 2008
@@ -1,18 +1,25 @@
atom_feed :root_url=>@alternate[Mime::HTML] do |feed|
- feed.title @title
+ feed.title "Singleshot: [EMAIL PROTECTED]"
feed.subtitle @subtitle
feed.updated @activities.first.created_at unless @activities.empty?
+ feed.link :href=>@alternate[Mime::ICS], :rel=>'alternate', :type=>Mime::ICS
if @alternate[Mime::ICS]
+ feed.generator 'Singleshot', :version=>Singleshot::VERSION
for activity in @activities
person, task = activity.person, activity.task
feed.entry activity, :url=>task_url(task) do |entry|
entry.title activity_to_text(activity)
entry.content :type=>'html' do |content|
- content.text! "<p>#{activity_to_html(activity)}</p>"
- content.text! truncate(strip_tags(task.description), 250)
+ content.text! activity_to_html(activity)
end
+ person = activity.person
entry.author do |author|
- author.name activity.person.fullname if activity.person
+ author.name person ? person.fullname : 'Unknown'
+ author.url person.url if person && person.url
+ author.email person.email if person && person.email
+ end
+ [Mime::JSON, Mime::XML, Mime::ICS].each do |mime|
+ feed.link :href=>formatted_tasks_url(task, :format=>mime),
:rel=>'related', :type=>mime
end
end
end
Modified: ode/sandbox/singleshot/app/views/layouts/application.html.erb
URL:
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/views/layouts/application.html.erb?rev=669743&r1=669742&r2=669743&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/layouts/application.html.erb (original)
+++ ode/sandbox/singleshot/app/views/layouts/application.html.erb Thu Jun 19
16:32:59 2008
@@ -1,6 +1,6 @@
<html>
<head>
- <title>Singleshot<%= " — #{escape_once(@title)}" if @title %></title>
+ <title>Singleshot<%= ": #{escape_once(@title)}" if @title %></title>
<%= javascript_include_tag :all, :cache=>true %>
<%= stylesheet_link_tag 'default', :cache=>true %>
<%= stylesheet_link_tag 'print', :media=>'print', :cache=>true %>
@@ -13,14 +13,12 @@
<h1><%= link_to 'Singleshot', root_url %></h1>
<ul class='links'>
<li><%= link_to 'Logout', session_url, :method=>:delete %></li>
- <li><form action='<% tasks_url %>' method='get' class='search'><%=
text_field_tag 'query', params['query'] %><button><%= image_tag 'search.png'
%></button></form></li>
</ul>
<ul class='tabs'><%=
[ ['â Inbox', tasks_url, 'Pending and available tasks'],
['All Tasks', following_tasks_url, 'Tasks you create, observing or
administrating'],
['Completed', completed_tasks_url, 'Tasks you completed'],
- ['Activity', activity_url, 'Recent task activity'],
- ['Start …', '#', 'Start a new task'] ].map { |tab|
+ ['Activity', activity_url, 'Recent task activity'] ].map { |tab|
content_tag 'li', link_to(tab[0], tab[1], :title=>tab[2],
:class=>current_page?(tab[1]) ? 'current': nil)
}.join %></ul>
<ul class='alternate'><%= content_tag 'li',
link_to(image_tag('feed.png') + ' Feed', @alternate[Mime::ATOM],
:rel=>'alternate', :title=>'Subscribe with your feed reader') if @alternate &&
@alternate[Mime::ATOM] %><%= content_tag 'li',
link_to(image_tag('calendar.png') + ' Calendar', @alternate[Mime::ICS],
:rel=>'alternate', :title=>'Add to your calendar') if @alternate &&
@alternate[Mime::ICS] %></ul>
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=669743&r1=669742&r2=669743&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/views/tasks/index.atom.builder (original)
+++ ode/sandbox/singleshot/app/views/tasks/index.atom.builder Thu Jun 19
16:32:59 2008
@@ -1,6 +1,9 @@
atom_feed :root_url=>@alternate[Mime::HTML] do |feed|
- feed.title 'Singleshot: Tasks'
+ feed.title "Singleshot: [EMAIL PROTECTED]"
+ feed.subtitle @subtitle
feed.updated @tasks.map(&:updated_at).max
+ feed.link :href=>@alternate[Mime::ICS], :rel=>'alternate', :type=>Mime::ICS
if @alternate[Mime::ICS]
+ feed.generator 'Singleshot', :version=>Singleshot::VERSION
for task in @tasks
feed.entry task do |entry|
@@ -9,8 +12,15 @@
content.text! sanitize(simple_format(task.description))
content.text! "<p><em>#{task_vitals(task)}</em></p>"
end
+ creator = task.creator
entry.author do |author|
- author.name task.creator.fullname if task.creator
+ author.name creator ? creator.fullname : 'Unknown'
+ author.url creator.url if creator && creator.url
+ author.email creator.email if creator && creator.email
+ end
+ # TODO: Should we add last person who modified the task as
secondary/primary author?
+ [Mime::JSON, Mime::XML, Mime::ICS].each do |mime|
+ feed.link :href=>formatted_tasks_url(task, :format=>mime),
:rel=>'alternate', :type=>mime
end
end
end