diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 58c569ee..9fff8706 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -18,13 +18,7 @@ class NotesController < ApplicationController @page_title = "TRACKS::Note " + @note.id.to_s respond_to do |format| format.html - format.m &render_note_mobile - end - end - - def render_note_mobile - lambda do - render :action => 'note_mobile' + format.m { render :action => 'note_mobile' } end end @@ -49,16 +43,6 @@ class NotesController < ApplicationController end end - def destroy - @note = current_user.notes.find(params['id']) - @note.destroy - - respond_to do |format| - format.html - format.js { @down_count = current_user.notes.size } - end - end - def update @note = current_user.notes.find(params['id']) @note.attributes = params["note"] @@ -69,11 +53,20 @@ class NotesController < ApplicationController end end + def destroy + @note = current_user.notes.find(params['id']) + @note.destroy + + respond_to do |format| + format.html + format.js { @down_count = current_user.notes.size } + end + end + protected def set_source_view @source_view = params['_source_view'] || 'note' end - end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index a698fb44..d2a09c7c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -56,7 +56,7 @@ class ProjectsController < ApplicationController @next_project = current_user.projects.next_from(@project) @previous_project = current_user.projects.previous_from(@project) @default_tags = @project.default_tags - @new_note = current_user.notes.build + @new_note = current_user.notes.new @new_note.project_id = @project.id respond_to do |format| format.html diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2969a8b2..700548d0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -104,11 +104,11 @@ module ApplicationHelper end def link_to_context(context, descriptor = sanitize(context.name)) - link_to( descriptor, context_path(context), :title => "View context: #{context.name}" ) + link_to( descriptor, context, :title => "View context: #{context.name}" ) end def link_to_project(project, descriptor = sanitize(project.name)) - link_to( descriptor, project_path(project), :title => "View project: #{project.name}" ) + link_to( descriptor, project, :title => "View project: #{project.name}" ) end def link_to_edit_project (project, descriptor = sanitize(project.name)) diff --git a/app/views/integrations/index.de.html.erb b/app/views/integrations/index.de.html.erb index 927bcf41..2eb83f5a 100644 --- a/app/views/integrations/index.de.html.erb +++ b/app/views/integrations/index.de.html.erb @@ -53,7 +53,7 @@
  • Open Script Editor and paste the script into a new document.
  • Compile and save the script to the ~/Library/Scriipts/Mail Scripts directory.
  • -
  • For more information on using AppleScript with Mail.app, see this overview. +
  • For more information on using AppleScript with Mail.app, see this overview.
  • <% else %>

    You do not have any context yet. The script will be available after you add your first context

    @@ -98,6 +98,7 @@

    Integrated email/SMS receiver

    If Tracks is running on the same server as your mail server, you can use the integrated mail handler built into tracks. Steps to set it up: +

    - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/integrations/index.en.html.erb b/app/views/integrations/index.en.html.erb index 51398c24..aa6c88a1 100644 --- a/app/views/integrations/index.en.html.erb +++ b/app/views/integrations/index.en.html.erb @@ -53,7 +53,7 @@
  • Open Script Editor and paste the script into a new document.
  • Compile and save the script to the ~/Library/Scriipts/Mail Scripts directory.
  • -
  • For more information on using AppleScript with Mail.app, see this overview. +
  • For more information on using AppleScript with Mail.app, see this overview.
  • <% else %>

    You do not have any context yet. The script will be available after you add your first context

    @@ -98,6 +98,7 @@

    Integrated email/SMS receiver

    If Tracks is running on the same server as your mail server, you can use the integrated mail handler built into tracks. Steps to set it up: +

    - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/views/notes/_note.rhtml b/app/views/notes/_note.rhtml index f41ab2ab..e512fe10 100644 --- a/app/views/notes/_note.rhtml +++ b/app/views/notes/_note.rhtml @@ -1,7 +1,7 @@
    -

    <%= link_to(t('notes.note_header', :id => note.id.to_s), note_path(note), :title => t('notes.note_link_title', :id => note.id.to_s)) %>

    +

    <%= link_to(t('notes.note_header', :id => note.id.to_s), note, :title => t('notes.note_link_title', :id => note.id.to_s)) %>

    <%= render :partial => "notes/note_details", :object => note %> diff --git a/app/views/notes/_note_details.rhtml b/app/views/notes/_note_details.rhtml index bd95a8ad..9ce6da9e 100644 --- a/app/views/notes/_note_details.rhtml +++ b/app/views/notes/_note_details.rhtml @@ -6,7 +6,7 @@ <%= link_to_delete_note(note, image_tag( "blank.png",:title => t('notes.delete_item_title'), :class=>"delete_item")) %>   <%= link_to_edit_note(note, image_tag( "blank.png", :title => t('notes.edit_item_title'), :class=>"edit_item") ) %> - | <%= link_to("In: " + note.project.name, project_path(note.project), :class=>"footer_link" ) %> |  + | <%= link_to("In: " + note.project.name, note.project, :class=>"footer_link" ) %> |  <%= Note.human_attribute_name('created_at') %>: <%= format_date(note.created_at) %> diff --git a/app/views/notes/_note_edit_form.rhtml b/app/views/notes/_note_edit_form.rhtml index 1bcd4ac8..13a7026e 100644 --- a/app/views/notes/_note_edit_form.rhtml +++ b/app/views/notes/_note_edit_form.rhtml @@ -1,12 +1,9 @@ <% submit_text ||= t('common.update') -# :put for edit note and :post for new note -form_method ||= :put form_for(note_edit_form, :html => { :id => dom_id(note_edit_form, 'edit_form'), - :class => "inline-form edit-note-form", - :method => form_method }) do |f| + :class => "inline-form edit-note-form"}) do |f| -%>
    <%= error_messages_for("note") %>
    diff --git a/app/views/notes/_notes_summary.rhtml b/app/views/notes/_notes_summary.rhtml index de09228a..0ffbf07c 100644 --- a/app/views/notes/_notes_summary.rhtml +++ b/app/views/notes/_notes_summary.rhtml @@ -2,7 +2,7 @@
    <%= link_to( image_tag("blank.png", :border => 0), - note_path(note), + note, :title => t('notes.show_note_title'), :class => "link_to_notes icon", :id => dom_id(note, "link")) %>  diff --git a/app/views/notes/index.html.erb b/app/views/notes/index.html.erb index 78d30f77..f41f2861 100644 --- a/app/views/notes/index.html.erb +++ b/app/views/notes/index.html.erb @@ -2,6 +2,6 @@ <% if @all_notes.empty? -%>

    <%= t('notes.no_notes_available') %>

    <% else -%> - <%= render :partial => 'note', :collection => @all_notes %> + <%= render :partial => @all_notes %> <% end -%>
    \ No newline at end of file diff --git a/app/views/notes/show.html.erb b/app/views/notes/show.html.erb index a973ea56..d4a88bec 100644 --- a/app/views/notes/show.html.erb +++ b/app/views/notes/show.html.erb @@ -1,3 +1,3 @@
    - <%= render :partial => 'note', :object => @note %> + <%= render :partial => @note %>
    \ No newline at end of file diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 263a634d..7569fb82 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -3,7 +3,7 @@ <%= project_next_prev %>
    - <%= render :partial => "projects/project", :locals => { :project => @project, :collapsible => false } %> + <%= render :partial => @project, :locals => {:collapsible => false } %> <%= render :partial => "todos/deferred", :locals => { :deferred => @deferred, :collapsible => false, :append_descriptor => t('projects.todos_append'), :parent_container_type => 'project', :pending => @pending } %> <% unless @max_completed==0 -%> <%= render :partial => "todos/completed", :locals => { :done => @done, :collapsible => false, :suppress_project => true, :append_descriptor => t('projects.todos_append') } %> @@ -22,7 +22,7 @@
    diff --git a/app/views/recurring_todos/index.html.erb b/app/views/recurring_todos/index.html.erb index f0e78500..09111e46 100644 --- a/app/views/recurring_todos/index.html.erb +++ b/app/views/recurring_todos/index.html.erb @@ -5,7 +5,7 @@

    <%= t('todos.no_recurring_todos') %>

    - <%= render :partial => "recurring_todo", :collection => @recurring_todos %> + <%= render :partial => @recurring_todos %> @@ -15,7 +15,7 @@

    <%= t('todos.no_completed_recurring') %>

    - <%= render :partial => "recurring_todo", :collection => @completed_recurring_todos %> + <%= render :partial => @completed_recurring_todos %> @@ -33,4 +33,4 @@ - + \ No newline at end of file diff --git a/app/views/todos/mobile_show_notes.rhtml b/app/views/todos/mobile_show_notes.rhtml index cbceaa3d..d6da7c17 100644 --- a/app/views/todos/mobile_show_notes.rhtml +++ b/app/views/todos/mobile_show_notes.rhtml @@ -1,4 +1,4 @@ -

    <%= t('todos.next_action_description') + link_to(t('common.go_back'), @return_path) %>)

    +

    <%= t('todos.next_action_description') + " (" + link_to(t('common.go_back'), @return_path) %>)

    <%= link_to @todo.description, todo_path(@todo, :format => 'm') -%>

    <%= t('todos.notes') %>

    <%= format_note(@todo.notes) %> diff --git a/features/preferences.feature b/features/preferences.feature new file mode 100644 index 00000000..63e57b11 --- /dev/null +++ b/features/preferences.feature @@ -0,0 +1,19 @@ +Feature: Manage preferences + In order to customize Tracks to my needs + As a Tracks user + I want to be be able change my preferences + + Background: + Given the following user record + | login | password | is_admin | + | testuser | secret | false | + And I have logged in as "testuser" with password "secret" + + Scenario: I can change my password + Given this is a pending scenario + + Scenario: I can generate a new token + Given this is a pending scenario + + Scenario: I can edit preferences + Given this is a pending scenario