mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-15 00:36:33 +01:00
arguably just another representation of the same resources, so it seems to fit the RESTful Rails paradigm to use an extension (.m) to switch on in the respond_to stanza. I needed some hackery to make this work. See my note in todos_controller for a full explanation. I also added a route to get to the mobile view by using 'domain.com/m' Created some selenium tests for the mobile view, too. In optimizing the data access for the mobile view, I ran into "a bug in rails pagination":http://dev.rubyonrails.org/ticket/7885" and integrated a nice pagination plugin from the Err the Blog guys ("will_paginate":http://errtheblog.com/post/929) to work around the issue. NOTE that this changeset includes a new line in environment.rb.tmpl (at the bottom). Be sure to copy this into your environment.rb file. These changes fix #489 (cannot edit action using mobile interface). Thanks for the bug report, lrbalt! In the name of consistency, I made the argument to the block for all respond_to calls 'format' (instead of the formerly cool 'wants'). Lastly, I added a link to the project's new contribute page to the footer of the main web UI. Help us join the Mac on Intel world. :-) git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@517 a4c988fc-2ded-0310-b66e-134b36920a42
33 lines
No EOL
1.1 KiB
Text
33 lines
No EOL
1.1 KiB
Text
<%= render_flash %>
|
|
<% if @todos.length == 0 -%>
|
|
<p>There are no incomplete actions in this <%= @type %></p>
|
|
<% else -%>
|
|
<ul>
|
|
<% for todo in @todos -%>
|
|
<li id="<%= dom_id(todo) %>">
|
|
<%= link_to "»", formatted_todo_path(todo, :m) %>
|
|
<% if todo.due? -%>
|
|
<%= due_date_mobile(todo.due) %>
|
|
<% end -%>
|
|
<%= todo.description %>
|
|
(<em><%= todo.context.name %></em>)
|
|
</li>
|
|
<% end -%>
|
|
</ul>
|
|
<% if @down_count > 6 -%>
|
|
<hr />
|
|
Pages: <%= formatted_pagination(@down_count, 6) %>
|
|
<% end -%>
|
|
<% end -%>
|
|
<hr />
|
|
<% form_tag( formatted_filter_to_context_todos_path(:m), :method => :post ) do -%>
|
|
<%= collection_select( "context", "id", @contexts, "id", "name",
|
|
{ :include_blank => true } ) %>
|
|
<%= submit_tag( "Go", :id => 'change_context' ) %>
|
|
<% end -%>
|
|
|
|
<% form_tag( formatted_filter_to_project_todos_path(:m), :method => :post ) do -%>
|
|
<%= collection_select( "project", "id", @projects, "id", "name",
|
|
{ :include_blank => true } ) %>
|
|
<%= submit_tag( "Go", :id => 'change_project' ) %>
|
|
<% end -%> |