Merge pull request #120 from maddentim/fixes

Creating new todo link for context headers in mobile interface
This commit is contained in:
Reinier Balt 2012-11-26 10:56:16 -08:00
commit f228067e0b
2 changed files with 8 additions and 1 deletions

View file

@ -149,6 +149,10 @@ span.prj, span.ctx{
background: #FFC2C2;
}
.ctx-add {
float: right;
}
ul.c li {
list-style-type: none;
}

View file

@ -1,11 +1,14 @@
<%
new_context_todo_params = {:format => :m}
new_context_todo_params[:from_context] = context.id
# select actions from this context
@not_done = @not_done_todos.select {|t| t.context_id == context.id }
if not @not_done.empty?
# only show a context when there are actions in it
-%>
<h2><%= link_to context.name, context_path(context, :format => 'm') %></h2>
<h2><%= link_to context.name, context_path(context, :format => 'm') %><span class="ctx-add"><%= link_to t('+'), new_todo_path(new_context_todo_params) %></span></h2>
<ul class="c">
<%= render :partial => "todos/todo",
:collection => @not_done,