From e72d88585d9e73356b11894a3c7998039d0ab569 Mon Sep 17 00:00:00 2001 From: lrbalt Date: Wed, 28 May 2008 09:29:46 +0000 Subject: [PATCH] removed some whitespace to reduce the download of the mobile view. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@858 a4c988fc-2ded-0310-b66e-134b36920a42 --- .../app/views/contexts/_mobile_context.rhtml | 14 ++-- tracks/app/views/layouts/mobile.m.erb | 65 +++++++++---------- tracks/app/views/shared/_flash.rhtml | 10 ++- tracks/app/views/shared/_mobile_footer.rhtml | 4 +- tracks/app/views/todos/_mobile_actions.rhtml | 6 +- tracks/app/views/todos/_mobile_todo.rhtml | 38 +++++------ tracks/app/views/todos/index.m.erb | 2 +- 7 files changed, 64 insertions(+), 75 deletions(-) diff --git a/tracks/app/views/contexts/_mobile_context.rhtml b/tracks/app/views/contexts/_mobile_context.rhtml index f6a2a268..6510aeb4 100644 --- a/tracks/app/views/contexts/_mobile_context.rhtml +++ b/tracks/app/views/contexts/_mobile_context.rhtml @@ -4,11 +4,11 @@ if not @not_done.empty? # only show a context when there are actions in it - %> -

<%=mobile_context.name%>

- - <%= render :partial => "todos/mobile_todo", - :collection => @not_done, - :locals => { :parent_container_type => "context" }%> -
+ -%> +

<%=mobile_context.name%>

+ +<%= render :partial => "todos/mobile_todo", + :collection => @not_done, + :locals => { :parent_container_type => "context" }-%> +
<% end -%> \ No newline at end of file diff --git a/tracks/app/views/layouts/mobile.m.erb b/tracks/app/views/layouts/mobile.m.erb index 7902bd05..1be4d590 100644 --- a/tracks/app/views/layouts/mobile.m.erb +++ b/tracks/app/views/layouts/mobile.m.erb @@ -1,37 +1,32 @@ - - - - <%= stylesheet_link_tag "mobile" %> - <%= @page_title %> - - - <% if !(@new_mobile || @edit_mobile) - if !@prefs.nil? %> -

<%= @down_count %> <%= - user_time.strftime(@prefs.title_date_format) %>

- <%= (link_to("Add new action", formatted_new_todo_path(:m))+" | ") unless @new_mobile -%> - <%= (link_to("Home", formatted_todos_path(:m))+" | ") unless @home -%> - <%= (link_to("Contexts", formatted_contexts_path(:m))+" | ") %> - <%= (link_to("Projects", formatted_projects_path(:m))+" | ") %> - <%= (link_to("Starred", {:action => "tag", :controller => "todos", :id => "starred.m"})) -%> - <% end - end %> - <%= render_flash -%> -
- <%= yield %> -
- <% if !@prefs.nil? %> - <%= link_to "Logout", formatted_logout_path(:format => 'm') %> | - <%= (link_to("Add new action", formatted_new_todo_path(:m))+" | ") unless @new_mobile -%> - <%= (link_to("Home", formatted_todos_path(:m))+" | ") unless @home -%> - <%= (link_to("Contexts", formatted_contexts_path(:m))+" | ") %> - <%= (link_to("Projects", formatted_projects_path(:m))+" | ") %> - <%= (link_to("Starred", {:action => "tag", :controller => "todos", :id => "starred.m"})+" | ") -%> - <%= (link_to("Tickler", {:action => "index", :controller => "tickler.m"})+" | ") -%> - <%= (link_to("Feeds", {:action => "index", :controller => "feeds.m"})) %> - <% end %> - <%= render :partial => "shared/mobile_footer" %> - - + + + +<%= stylesheet_link_tag "mobile"%> +<%= @page_title %> + +<% if !(@new_mobile || @edit_mobile) + if !@prefs.nil? -%> +

<%= @down_count %> <%= + user_time.strftime(@prefs.title_date_format) -%>

+<%= (link_to("Add new action", formatted_new_todo_path(:m))+" | ") unless @new_mobile -%> +<%= (link_to("Home", formatted_todos_path(:m))+" | ") unless @home -%> +<%= (link_to("Contexts", formatted_contexts_path(:m))+" | ") -%> +<%= (link_to("Projects", formatted_projects_path(:m))+" | ") -%> +<%= (link_to("Starred", {:action => "tag", :controller => "todos", :id => "starred.m"})) -%> +<% end + end -%><%= render_flash -%> +
<%= yield -%> +
<% if !@prefs.nil? -%> +<%= (link_to("Logout", formatted_logout_path(:format => 'm')) +" | ") -%> +<%= (link_to("Add new action", formatted_new_todo_path(:m))+" | ") unless @new_mobile -%> +<%= (link_to("Home", formatted_todos_path(:m))+" | ") unless @home -%> +<%= (link_to("Contexts", formatted_contexts_path(:m))+" | ") -%> +<%= (link_to("Projects", formatted_projects_path(:m))+" | ") -%> +<%= (link_to("Starred", {:action => "tag", :controller => "todos", :id => "starred.m"})+" | ") -%> +<%= (link_to("Tickler", {:action => "index", :controller => "tickler.m"})+" | ") -%> +<%= (link_to("Feeds", {:action => "index", :controller => "feeds.m"})) -%> +<% end -%> +<%= render :partial => "shared/mobile_footer" -%> + \ No newline at end of file diff --git a/tracks/app/views/shared/_flash.rhtml b/tracks/app/views/shared/_flash.rhtml index 8e86733e..86f9fc2c 100644 --- a/tracks/app/views/shared/_flash.rhtml +++ b/tracks/app/views/shared/_flash.rhtml @@ -1,11 +1,9 @@
-<% if flash.empty? %> +<% if flash.empty? -%> -<% else %> +<% else -%> <% flash.each do |key,value| -%> -

- <%= value %> -

+

<%= value %>

<% end -%> -<% end %> +<% end -%>
\ No newline at end of file diff --git a/tracks/app/views/shared/_mobile_footer.rhtml b/tracks/app/views/shared/_mobile_footer.rhtml index 25b2b295..dca01d3d 100644 --- a/tracks/app/views/shared/_mobile_footer.rhtml +++ b/tracks/app/views/shared/_mobile_footer.rhtml @@ -1,3 +1 @@ - + \ No newline at end of file diff --git a/tracks/app/views/todos/_mobile_actions.rhtml b/tracks/app/views/todos/_mobile_actions.rhtml index 8c5c480f..861a981e 100644 --- a/tracks/app/views/todos/_mobile_actions.rhtml +++ b/tracks/app/views/todos/_mobile_actions.rhtml @@ -1,5 +1,5 @@ <% if @not_done_todos.empty? -%> -

There are no incomplete actions

+

There are no incomplete actions

<% else -%> - <%= render :partial => "contexts/mobile_context", :collection => @contexts_to_show %> -<% end -%> +<%= render :partial => "contexts/mobile_context", :collection => @contexts_to_show -%> +<% end -%> \ No newline at end of file diff --git a/tracks/app/views/todos/_mobile_todo.rhtml b/tracks/app/views/todos/_mobile_todo.rhtml index 43620bfc..6b8ebcaa 100644 --- a/tracks/app/views/todos/_mobile_todo.rhtml +++ b/tracks/app/views/todos/_mobile_todo.rhtml @@ -5,24 +5,22 @@ else bullet = "» " end -%>
- <%= bullet %> - <% if mobile_todo.completed? -%> - - <% else -%> - - <% end -%> - <%= date_span -%> - <%= link_to mobile_todo.description, formatted_todo_path(mobile_todo, :m) %> - <% if parent_container_type == 'context' or parent_container_type == 'tag' -%> - <%= "(" + - link_to(mobile_todo.project.name, formatted_project_path(mobile_todo.project, :m)) + - ")" unless mobile_todo.project.nil? %> - <% end +<%= bullet %><% + if mobile_todo.completed? +-%> +<% else +-%> +<% end -%> +<%= date_span -%><%= link_to mobile_todo.description, formatted_todo_path(mobile_todo, :m) -%> +<% if parent_container_type == 'context' or parent_container_type == 'tag' -%> +<%= " (" + + link_to(mobile_todo.project.name, formatted_project_path(mobile_todo.project, :m)) + + ")" unless mobile_todo.project.nil? -%> +<% end if parent_container_type == 'project' or parent_container_type == 'tag' -%> - <%= "(" + - link_to(mobile_todo.context.name, formatted_context_path(mobile_todo.context, :m)) + - ")" %> - <% end -%> - <%= tag_list_mobile %> - -
+<%= " (" + + link_to(mobile_todo.context.name, formatted_context_path(mobile_todo.context, :m)) + + ")" -%> +<% end -%> + <%= tag_list_mobile -%> + \ No newline at end of file diff --git a/tracks/app/views/todos/index.m.erb b/tracks/app/views/todos/index.m.erb index 92b55c5c..92e3f3f9 100644 --- a/tracks/app/views/todos/index.m.erb +++ b/tracks/app/views/todos/index.m.erb @@ -1 +1 @@ -<%= render :partial => 'mobile_actions' %> +<%= render :partial => 'mobile_actions' -%> \ No newline at end of file