get login, mobile and notes features passing

This commit is contained in:
Reinier Balt 2012-05-12 13:37:36 +02:00
parent 7c935652fb
commit 005723cb4f
52 changed files with 167 additions and 196 deletions

View file

@ -0,0 +1,14 @@
<%
# 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>
<ul class="c">
<%= render :partial => "todos/todo",
:collection => @not_done,
:locals => { :parent_container_type => "context" }-%>
</ul>
<% end -%>

View file

@ -0,0 +1,2 @@
<% context = context_listing -%>
<div id="ctx"><%= link_to context.name, context_path(context, :format => 'm') %><%= " (#{count_undone_todos_phrase(context)})".html_safe %></div>

View file

@ -1,14 +0,0 @@
<%
# select actions from this context
@not_done = @not_done_todos.select {|t| t.context_id == mobile_context.id }
if not @not_done.empty?
# only show a context when there are actions in it
-%>
<h2><%= link_to mobile_context.name, context_path(mobile_context, :format => 'm') %></h2>
<ul class="c">
<%= render :partial => "todos/mobile_todo",
:collection => @not_done,
:locals => { :parent_container_type => "context" }-%>
</ul>
<% end -%>

View file

@ -1,2 +0,0 @@
<% context = mobile_context_listing -%>
<div id="ctx"><%= link_to context.name, context_path(context, :format => 'm') %><%= " (" + count_undone_todos_phrase(context) + ")" %></div>

View file

@ -0,0 +1,2 @@
<h2><%= t('contexts.visible_contexts') %></h2><%= render :partial => 'context_listing', :collection => @active_contexts %>
<h2><%= t('contexts.hidden_contexts') %></h2><%= render :partial => 'context_listing', :collection => @hidden_contexts %>

View file

@ -1,2 +0,0 @@
<h2><%= t('contexts.visible_contexts') %></h2><%= render :partial => 'mobile_context_listing', :collection => @active_contexts %>
<h2><%= t('contexts.hidden_contexts') %></h2><%= render :partial => 'mobile_context_listing', :collection => @hidden_contexts %>

View file

@ -1,14 +1,12 @@
<h2><%=@context.name%></h2>
<%
# select actions from this context
@not_done = @not_done_todos.select {|t| t.context_id == @context.id }
if not @not_done.empty?
if not @not_done.empty?
# only show a context when there are actions in it
%>
<h2><%=@context.name%></h2>
-%>
<ul class="c">
<%= render :partial => "todos/mobile_todo",
:collection => @not_done,
:locals => { :parent_container_type => "context" }-%>
<%= render :partial => @not_done, :locals => { :parent_container_type => "context" }-%>
</ul>
<% end -%>

View file

@ -19,16 +19,16 @@
<li class="link"><%= (link_to(t('layouts.mobile_navigation.home'), todos_path(:format => 'm'))) unless @home -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.contexts'), contexts_path(:format => 'm'))) -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.projects'), projects_path(:format => 'm'))) -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.starred'), {:action => "tag", :controller => "todos", :id => "starred.m"})) -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.starred'), tag_path("starred", :format => 'm'))) -%></li>
<% end -%>
</ul></div>
<div id="content"><%= render_flash -%><%= yield -%></div>
<hr/><% if current_user && !current_user.prefs.nil? -%>
<ul class="nav">
<li class="link"><%= (link_to(t('layouts.mobile_navigation.logout'), logout_path(:format => 'm'))) -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.tickler'), {:action => "index", :controller => "tickler.m"})) -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.feeds'), {:action => "index", :controller => "feeds.m"})) -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.tickler'), tickler_path(:format => :m))) -%></li>
<li class="link"><%= (link_to(t('layouts.mobile_navigation.feeds'), feeds_path(:format=>:m))) -%></li>
</ul>
<% end -%>
<%= render :partial => "shared/mobile_footer" -%>
<%= render :partial => "shared/footer" -%>
</body></html>

View file

@ -1,7 +1,7 @@
<% if @session_expired
theLink = link_to(t('login.log_in_again'), :controller => "login", :action => "login")
message = I18n.t('login.session_time_out', :link => theLink)
theHtml = escape_javascript(content_tag(:div, message, :"class" => "warning"))
theHtml = escape_javascript(content_tag(:div, message.html_safe, :"class" => "warning"))
-%>
$('div#navcontainer').hide();
$('div#content').html('<%=theHtml%>');

View file

@ -1,14 +1,10 @@
<% auth_schemes = Tracks::Config.auth_schemes
show_database_form = auth_schemes.include?('database')
show_openid_form = auth_schemes.include?('open_id')
<%
auth_schemes = Tracks::Config.auth_schemes
show_database_form = auth_schemes.include?('database')
-%>
<div title="<%= t('login.account_login') %>" id="loginform" class="form">
<%= render_flash %>
<%= render_flash -%>
<h3><%= t('login.please_login') %>:</h3>
<% if show_database_form %>
<div id="database_auth_form">
<%= form_tag login_path(:format => 'm') do %>

View file

@ -7,7 +7,7 @@
<%= render :partial => "notes/note_details", :object => note %>
</div>
<div id="<%= dom_id(note, 'edit') %>" class="note-edit-form" style="display:none;">
<div id="<%= dom_id(note, 'edit') %>" class="note-edit-form" style="display:none">
<%= render :partial => "notes/note_edit_form", :object => note %>
</div>

View file

@ -1,4 +1,3 @@
<% note = mobile_notes -%>
<div class="mobile_note">
<%= sanitize(textilize_without_paragraph(note.body)) %>
</div>

View file

@ -1,11 +1,11 @@
<%
submit_text ||= t('common.update')
note = note_edit_form
-%><%=
form_for(note, :html => {
:id => dom_id(note, 'edit_form'),
:class => "inline-form edit-note-form"}) do |f|
-%>
-%>
<div id="error_status"><%= get_list_of_error_messages_for(note) %></div>

View file

@ -1,3 +1,3 @@
<% note = mobile_notes_summary -%>
<% note = notes_summary -%>
<div class="note"><%= link_to( truncated_note(note), note_path(note, :format => 'm')) %></div>
<% note = nil -%>

View file

@ -1 +0,0 @@
<%= render :partial => 'mobile_notes', :object => @note %>

View file

@ -0,0 +1 @@
<%= render :partial => @note %>

View file

@ -17,7 +17,7 @@ function replace_note_form_with_updated_note() {
}
function html_for_error_messages() {
return "<%= escape_javascript(error_messages_for('note')) %>";
return "<%= escape_javascript(get_list_of_error_messages_for(@note)) %>";
}
function html_for_updated_note_form(){

View file

@ -1,4 +1,4 @@
<% project = mobile_project_listing -%>
<div id="pjr"><%=
<% project = project_listing -%>
<div id="pjr"><%=
link_to(project.name, project_path(project, :format => 'm')) +
" (" + count_undone_todos_and_notes_phrase(project) + ")" %></div>

View file

@ -0,0 +1,6 @@
<h2><%= t('projects.active_projects') %></h2><%=
render :partial => 'project_listing', :collection => @active_projects%>
<h2><%= t('projects.hidden_projects') %></h2><%=
render :partial => 'project_listing', :collection => @hidden_projects %>
<h2><%= t('projects.completed_projects') %></h2><%=
render :partial => 'project_listing', :collection => @completed_projects %>

View file

@ -1,6 +0,0 @@
<h2><%= t('projects.active_projects') %></h2><%=
render :partial => 'mobile_project_listing', :collection => @active_projects%>
<h2><%= t('projects.hidden_projects') %></h2><%=
render :partial => 'mobile_project_listing', :collection => @hidden_projects %>
<h2><%= t('projects.completed_projects') %></h2><%=
render :partial => 'mobile_project_listing', :collection => @completed_projects %>

View file

@ -5,33 +5,27 @@
<div class="project_description"><%= sanitize(@project.description) %></div>
<% end -%>
<ul class="c">
<%= render :partial => "todos/mobile_todo",
:collection => @not_done,
:locals => { :parent_container_type => "project" }%>
<%= render :partial => @not_done, :locals => { :parent_container_type => "project" }%>
</ul>
<h2><%= t('projects.deferred_actions')%></h2>
<% if @deferred.empty? -%>
<%= t('projects.deferred_actions_empty') %>
<% else -%>
<ul class="c">
<%= render :partial => "todos/mobile_todo",
:collection => @deferred,
:locals => { :parent_container_type => "project" }%>
</ul><% end
<%= render :partial => @deferred, :locals => { :parent_container_type => "project" }%>
</ul><% end
-%>
<h2><%= t('projects.completed_actions')%></h2>
<% if @done.empty? -%>
<%= t('projects.completed_actions_empty') %>
<% else -%>
<ul class="c">
<%= render :partial => "todos/mobile_todo",
:collection => @done,
:locals => { :parent_container_type => "project" }%>
<%= render :partial => @done, :locals => { :parent_container_type => "project" }%>
</ul><% end %>
<h2><%= t('projects.notes') %></h2>
<% if @project.notes.empty? -%>
<%= t('projects.notes_empty') %>
<% else -%><%= render :partial => "notes/mobile_notes_summary", :collection => @project.notes %>
<% else -%><%= render :partial => "notes/notes_summary", :collection => @project.notes %>
<% end -%>
<h2><%= t('projects.settings') %></h2>
<%= t('projects.state', :state => project.aasm_current_state.to_s) %>. <%= @project_default_context %>

View file

@ -0,0 +1,9 @@
<div id="message_holder">
<% if flash.empty? -%>
<h4 id="flash" class="alert" style="display:none"></h4>
<% else -%>
<% flash.each do |key,value| -%>
<h4 id="flash" class='alert <%= key %>'><%= value %></h4>
<% end -%>
<% end -%>
</div>

View file

@ -1,7 +1,7 @@
<% @tag_list_text = ""
@tag_list_text = tag_list_text if @todo -%>
<span class="errors">
<%= error_messages_for("todo") %>
<%= get_list_of_error_messages_for(@todo) if @todo %>
</span>
<% this_year = current_user.time.to_date.strftime("%Y").to_i -%>
<h2><label for="todo_description"><%= t('common.description') %></label></h2>
@ -23,7 +23,8 @@ end %>
else
# manually add blank option since :include_blank does not work
# with options_from_collection_for_select
select_tag("todo[project_id]", "<option value=\"\"></option>"+options_from_collection_for_select(
empty_option = content_tag(:option, "", :value => "")
select_tag("todo[project_id]", empty_option+options_from_collection_for_select(
@projects, "id", "name", @mobile_from_project.id),
{"id" => :todo_project_id, :tabindex => 4} )
end %>

View file

@ -1,13 +1,13 @@
<% if @not_done_todos.empty? -%>
<p><%= t('todos.no_incomplete_actions') %></p>
<% else -%>
<%= render :partial => "contexts/mobile_context", :collection => @contexts_to_show -%>
<%= render :partial => @contexts_to_show -%>
<% end -%>
<% unless @done.nil? -%>
<div id="completed_container">
<h2><%= t('todos.completed_actions') %></h2>
<ul class="c">
<%= render :partial => "todos/mobile_todo", :collection => @done %>
<%= render :partial => @done %>
</ul>
</div>
<% end %>

View file

@ -1,22 +0,0 @@
<% @todo = mobile_todo -%>
<li id="<%= dom_id(mobile_todo) %>" >
<% remote_mobile_checkbox(mobile_todo) %>
<%= date_span -%> <%= link_to mobile_todo.description, todo_path(mobile_todo, :format => 'm') -%>
<% unless mobile_todo.notes.blank? %>
<%= link_to(image_tag("mobile_notes.png", :border => "0"), mobile_todo_show_notes_path(mobile_todo, :format => 'm')) -%>
<% end %>
<% if mobile_todo.starred? %>
<%= image_tag("menustar_small.gif", :border => "0") -%>
<% end %>
<% if parent_container_type == 'context' or parent_container_type == 'tag' -%>
<%= "<span class=\"prj\"> (" +
link_to(mobile_todo.project.name, project_path(mobile_todo.project, :format => 'm')) +
")</span>" unless mobile_todo.project.nil? -%>
<% end
if parent_container_type == 'project' or parent_container_type == 'tag' -%>
<%= "<span class=\"ctx\"> (" +
link_to(mobile_todo.context.name, context_path(mobile_todo.context, :format => 'm')) +
")</span>" -%>
<% end -%>
<%= tag_list_mobile -%>
</span></li>

View file

@ -0,0 +1,28 @@
<% @todo = todo -%>
<li id="<%= dom_id(todo) %>" >
<% remote_mobile_checkbox(todo) %>
<%= date_span -%> <%= link_to todo.description, todo_path(todo, :format => 'm') -%>
<% unless todo.notes.blank? %>
<%= link_to(image_tag("mobile_notes.png", :border => "0"), show_notes_todo_path(todo, :format => 'm')) -%>
<% end %>
<% if todo.starred? %>
<%= image_tag("menustar_small.gif", :border => "0") -%>
<% end %>
<% if parent_container_type == 'context' or parent_container_type == 'tag' -%>
<%=
if todo.project.nil?
""
else
link = link_to(todo.project.name, project_path(todo.project, :format => :m))
content_tag(:span, " (#{link})".html_safe, :class=>"prj")
end
-%>
<% end
if parent_container_type == 'project' or parent_container_type == 'tag' -%>
<%=
link = link_to(todo.context.name, context_path(todo.context, :format => 'm'))
content_tag(:span, " (#{link})".html_safe, :class=>"ctx")
-%>
<% end -%>
<%= tag_list_mobile -%>
</span></li>

View file

@ -1,5 +1,5 @@
<%= form_tag todo_path(@todo, :format => 'm'), :name => 'mobileEdit', :method => :put do %>
<%= render :partial => 'edit_mobile_form', :locals => { :parent_container_type => "show_mobile" } %>
<%= render :partial => 'edit_form', :locals => { :parent_container_type => "show_mobile" } %>
<p><input type="submit" value="<%= t('common.update') %>" tabindex="6" accesskey="#" /></p>
<% end -%>
<%= link_to t('common.cancel'), @return_path %>

View file

@ -0,0 +1,4 @@
<% if @count == 0 -%>
<div class="message"><p><%= t('todos.no_deferred_actions') %></p></div>
<% end -%>
<%= render :partial => @contexts, :locals => { :collapsible => true } -%>

View file

@ -1,5 +0,0 @@
<% if @count == 0 -%>
<div class="message"><p><%= t('todos.no_deferred_actions') %></p></div>
<% end -%>
<%= render :partial => "contexts/mobile_context", :collection => @contexts,
:locals => { :collapsible => true } -%>

View file

@ -1,5 +1,5 @@
<%= form_tag todos_path(:format => 'm'), :method => :post do %>
<%= render :partial => 'edit_mobile_form' %>
<%= form_tag todos_path, :method => :post do %>
<%= render :partial => 'edit_form' %>
<p><input type="submit" value="<%= t('common.create') %>" tabindex="12" accesskey="#" /></p>
<% end -%>
<%= link_to t('common.back'), @return_path %>

View file

@ -1,4 +1,4 @@
<h2><%= t('todos.next_action_description') + " (" + link_to(t('common.go_back'), @return_path) %>)</h2>
<h2><%= raw "#{t('todos.next_action_description')} (#{link_to(t('common.go_back'), @return_path)}" %>)</h2>
<%= link_to @todo.description, todo_path(@todo, :format => 'm') -%>
<h2><%= t('todos.notes') %></h2>
<%= Tracks::Utils.render_text(@todo.notes) %>

View file

@ -5,11 +5,11 @@
<div class="message"><%= t('todos.no_actions_with', :tag_name => @tag_title) %></div>
</div>
<% end -%>
<%= render :partial => "contexts/mobile_context", :collection => @contexts_to_show -%>
<%= render :partial => @contexts_to_show -%>
<h2><%= t('todos.deferred_actions_with', :tag_name=> @tag_title) %></h2>
<% unless (@deferred.nil? or @deferred.size == 0) -%>
<ul class="c">
<%= render :partial => "todos/mobile_todo", :collection => @deferred, :locals => { :parent_container_type => "tag" } -%>
<%= render :partial => @deferred, :locals => { :parent_container_type => "tag" } -%>
</ul>
<% else -%>
<%= t('todos.no_deferred_actions_with', :tag_name => @tag_title) %>
@ -17,7 +17,7 @@
<h2><%= t('todos.completed_actions_with', :tag_name => @tag_title) %></h2>
<% unless (@done.nil? or @done.size == 0) -%>
<ul class="c">
<%= render :partial => "todos/mobile_todo", :collection => @done, :locals => { :parent_container_type => "tag" } %>
<%= render :partial => @done, :locals => { :parent_container_type => "tag" } %>
</ul>
<% else -%>
<%= t('todos.no_completed_actions_with', :tag_name => @tag_title) %>

View file

@ -8,45 +8,24 @@
<h3><%= @heading -%></h3>
<table>
<%if Tracks::Config.auth_schemes.include?('cas') && session[:cas_user]%>
<tr>
<td><label for="user_login"><%= t('users.register_with_cas') %>:</label></td>
<td> "<%= session[:cas_user]%>" </td>
<td>
<%= hidden_field "user", "login", :value => session[:cas_user] %>
<%= hidden_field "user", "password", :value => session[:cas_user] %>
<%= hidden_field "user", "password_confirmation", :value => session[:cas_user] %>
<%= hidden_field "user", "auth_type", :value => "cas" %></td>
</tr>
<%else%>
<tr>
<td><label for="user_login"><%= t('users.desired_login') %>:</label></td>
<td> <%= text_field "user", "login", :size => 20 %></td>
</tr>
<tr>
<td><label for="user_login"><%= t('users.desired_login') %>:</label></td>
<td> <%= text_field "user", "login", :size => 20 %></td>
</tr>
<tr>
<td><label for="user_password"><%= t('users.choose_password') %>:</label></td>
<td><%= password_field "user", "password", :size => 20 %></td>
</tr>
<tr>
<td><label for="user_password_confirmation"><%= t('users.confirm_password') %>:</label></td>
<td><%= password_field "user", "password_confirmation", :size => 20 %></td>
</tr>
<tr id="open_id" style="display:<%= @user.auth_type == 'open_id' ? 'table-row' : 'none' %>">
<td><label for="openid_url"><%= t('users.identity_url') %>:</label></td>
<td><%= text_field "user", "open_id_url", :class => "open_id" %></td>
</tr>
<tr>
<td><label for="user_auth_type"><%= User.human_attribute_name('auth_type') %>:</label></td>
<td><%= select("user", "auth_type", @auth_types, { :include_blank => false })%></td>
</tr>
<%end%>
<td><label for="user_password"><%= t('users.choose_password') %>:</label></td>
<td><%= password_field "user", "password", :size => 20 %></td>
</tr>
<tr>
<td><label for="user_password_confirmation"><%= t('users.confirm_password') %>:</label></td>
<td><%= password_field "user", "password_confirmation", :size => 20 %></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="signup" value="<%= t('users.signup') %> &#187;" class="primary" /></td>
</tr>
</table>
<% end %>
<%end-%>
</div>