Skip to content

Commit

Permalink
fix scenarios for editing a todo, showing empty messages and fix some…
Browse files Browse the repository at this point in the history
… missing translations
  • Loading branch information
lrbalt committed Mar 9, 2011
1 parent 793f778 commit 068c4bf
Show file tree
Hide file tree
Showing 16 changed files with 222 additions and 190 deletions.
4 changes: 2 additions & 2 deletions app/views/projects/_project.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</div>

<div class="container">
<h2>Actions in this project</h2>
<h2><%= t('projects.actions_in_project_title') %></h2>
<div id="p<%= project.id %>items" class="items toggle_target">
<div id="p<%= project.id %>empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
<div class="message"><p>Currently there are no incomplete actions in this project</p></div>
<div class="message"><p><%= t('projects.no_actions_in_project') %></p></div>
</div>
<%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "project" } %>
</div>
Expand Down
22 changes: 11 additions & 11 deletions app/views/projects/_project_settings.rhtml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<% project = project_settings -%>
<div id="<%= dom_id(project) %>" class="project">
<div class="project_settings">This project
<% if project.completed? -%>has been marked as completed
<% elsif project.hidden? -%>has been marked as hidden
<% else -%>is active
<div class="project_settings"><%= t('projects.this_project') %>
<% if project.completed? -%><%= t('projects.was_marked_complete') %>
<% elsif project.hidden? -%><%= t('projects.was_marked_hidden') %>
<% else -%><%= t('projects.is_active') %>
<% end -%>
with <% if project.default_context.nil? -%>
no default context
<% if project.default_context.nil? -%>
<%= t('projects.with_no_default_context') %>
<% else -%>
a default context of <%= project.default_context.name -%>
<%= t('projects.with_default_context', :context_name => project.default_context.name) %>
<% end -%>
and with <% if project.default_tags.nil? || project.default_tags.blank? -%>
no default tags.
<% if project.default_tags.nil? || project.default_tags.blank? -%>
<%= t('projects.with_no_default_tags') %>.
<% else -%>
'<%= project.default_tags -%>' as the default tags.
<%= t('projects.with_default_tags', :tags => project.default_tags) %>.
<% end -%>
<%= link_to_edit_project(project, "Edit Project Settings") %>
<%= link_to_edit_project(project, t('projects.edit_project_settings')) %>
</div>
<% unless project.description.blank? -%>
<div class="project_description"><%= format_note(project.description) %></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="container">
<div id="notes">
<div class="add_note_link"><%= link_to t('projects.add_note'), '#' %> </div>
<h2>Notes</h2>
<h2><%= t('projects.notes') %></h2>
<div id="empty-n" style="display:<%= @project.notes.empty? ? 'block' : 'none'%>;">
<%= render :partial => "shared/empty",
:locals => { :message => t('projects.no_notes_attached')} %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/todos/create.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ function clear_form() {
}

function insert_new_context_with_new_todo() {
$('#no_todos_in_tag_view').slideUp(100);
$('#no_todos_in_view').slideUp(100);
$('#display_box').prepend(html_for_new_context());
}

function add_todo_to_existing_context() {
<% if source_view_is_one_of(:todo, :deferred, :tag) -%>
$('#c<%= @todo.context_id %>').fadeIn(500, function() {});
$('#no_todos_in_tag_view').slideUp(100);
$('#no_todos_in_view').slideUp(100);
<% end -%>
$('#<%=empty_container_msg_div_id%>').hide();
$('#<%=item_container_id(@todo)%>').append(html_for_new_todo());
Expand Down
4 changes: 4 additions & 0 deletions app/views/todos/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div id="display_box">
<div id="no_todos_in_view" class="container context" <%= "style=\"display:none\"" unless @not_done_todos.empty? %> >
<h2><%= t('todos.no_actions_found_title')%></h2>
<div class="message"><p><%= t('todos.no_actions_found') %></p></div>
</div>
<%= render(
:partial => "contexts/context",
:collection => @contexts_to_show,
Expand Down
2 changes: 1 addition & 1 deletion app/views/todos/mobile_tag.rhtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="display_box">
<% if @not_done_todos.empty? -%>
<div class="container context">
<h2><%= t('todos.no_actions_found') %></h2>
<h2><%= t('todos.no_actions_found_title') %></h2>
<div class="message"><%= t('todos.no_actions_with', :tag_name => @tag_name) %></div>
</div>
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/todos/remove_predecessor.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function update_successor() {
<%= "show_empty_deferred_message(); " if @remaining_deferred_or_pending_count == 0 %>
<% if source_view_is_one_of(:todo, :deferred, :tag) -%>
$('#c<%= @successor.context_id %>').fadeIn(500, function() {});
$('#no_todos_in_tag_view').slideUp(100);
$('#no_todos_in_view').slideUp(100);
<% end -%>
$('#<%=item_container_id(@successor)%>').append(html_for_new_successor());
$('#<%= dom_id(@successor, 'line')%>').effect('highlight', {}, 2000 ); <%
Expand Down
4 changes: 2 additions & 2 deletions app/views/todos/tag.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="display_box">
<div id="no_todos_in_tag_view" class="container context" <%= "style=\"display:none\"" unless @not_done_todos.empty? %> >
<h2><%= t('todos.no_actions_found')%></h2>
<div id="no_todos_in_view" class="container context" <%= "style=\"display:none\"" unless @not_done_todos.empty? %> >
<h2><%= t('todos.no_actions_found_title')%></h2>
<div class="message"><p><%= t('todos.no_actions_with', :tag_name=>@tag_name) %></p></div>
</div>

Expand Down
8 changes: 4 additions & 4 deletions app/views/todos/toggle_check.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
animation << "add_todo_to_context"
animation << "block_predecessors"
end
animation << "update_empty_tag_container" if source_view_is(:tag) -%>
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo) -%>
<%= render_animation(animation) %>
TracksPages.set_page_badge(<%= @down_count %>);
<% end -%>
Expand Down Expand Up @@ -85,11 +85,11 @@ function add_new_recurring_todo(next_steps) {
<% end -%>
}
function update_empty_tag_container(next_steps) {
function update_empty_container(next_steps) {
<% if @down_count==0 -%>
$('#no_todos_in_tag_view').slideDown(400, function(){ next_steps.go(); });
$('#no_todos_in_view').slideDown(400, function(){ next_steps.go(); });
<% else -%>
$('#no_todos_in_tag_view').fadeOut(100, function(){ next_steps.go(); });
$('#no_todos_in_view').fadeOut(100, function(){ next_steps.go(); });
<% end -%>
}
Expand Down
8 changes: 4 additions & 4 deletions app/views/todos/update.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
end
animation << "hide_context" if update_needs_to_hide_context
animation << "highlight_updated_todo"
animation << "update_empty_tag_container" if source_view_is(:tag)
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo)
animation << "update_predecessors"
%>
Expand Down Expand Up @@ -71,11 +71,11 @@ function highlight_updated_todo(next_steps) {
next_steps.go();
}
function update_empty_tag_container(next_steps) {
function update_empty_container(next_steps) {
<% if @down_count==0 -%>
$('#no_todos_in_tag_view').slideDown(400, function(){ next_steps.go(); });
$('#no_todos_in_view').slideDown(400, function(){ next_steps.go(); });
<% else -%>
$('#no_todos_in_tag_view').fadeOut(100, function(){ next_steps.go(); });
$('#no_todos_in_view').fadeOut(100, function(){ next_steps.go(); });
<% end -%>
}
Expand Down
2 changes: 1 addition & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ de:
added_dependency: "%{dependency} als Abh&auml;ngigkeit hinzugef&uuml;gt."
no_deferred_actions: Zur Zeit sind keine zur&uuml;ckgestellten Aktionen vorhanden.
recurrence_completed: Nach dieser wiederkehrenden Aktion, die du gerade abgeschlossen hast, folgt keine mehr. Die Wiederholung endet hiermit
no_actions_found: Keine Aktionen gefunden
no_actions_found_title: Keine Aktionen gefunden
in_pending_state: und als ausstehend markiert
due: F&auml;llig
action_marked_complete_error: Die Aktion <strong>'%{description}'</strong> wurde aufgrund eines Fehlers NICHT als <strong>%{completed}</strong> markiert.
Expand Down
14 changes: 13 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,24 @@ en:
deferred_actions_empty: "There are no deferred actions for this project"
completed_actions: "Completed actions for this project"
completed_actions_empty: "There are no completed actions for this project"
no_actions_in_project: "Currently there are no incomplete actions in this project"
actions_in_project_title: "Actions in this project"
notes: "Notes"
notes_empty: "There are no notes for this project"
settings: "Settings"
state: "This project is %{state}"
this_project: "This project"
active_projects: "Active projects"
hidden_projects: "Hidden projects"
completed_projects: "Completed projects"
was_marked_complete: "has been marked as completed"
was_marked_hidden: "has been marked as hidden"
is_active: "is active"
with_no_default_context: "with no default context"
with_default_context: "with a default context of '%{context_name}'"
with_no_default_tags: "and with no default tags"
with_default_tags: "and with '%{tags}' as the default tags"
edit_project_settings: "Edit Project Settings"
page_title: "TRACKS::Project: %{project}"
list_projects: "TRACKS::List Projects"
no_default_context: "This project does not have a default context"
Expand Down Expand Up @@ -408,7 +419,8 @@ en:
error_starring: "Could not toggle the star of this todo \'%{description}\'"
recurrence_completed: "There is no next action after the recurring action you just finished. The recurrence is completed"
tagged_with: "tagged with &lsquo;%{tag_name}&rsquo;"
no_actions_found: "No actions found"
no_actions_found_title: "No actions found"
no_actions_found: "Currently there are no incomplete actions."
no_actions_with: "Currently there are no incomplete actions with the tag '%{tag_name}'"
removed_predecessor: "Removed %{successor} as dependency from %{predecessor}."
add_another_dependency: "Add another dependency"
Expand Down
Loading

0 comments on commit 068c4bf

Please sign in to comment.