From b6dab3f3e72b48fc7279071f5c803a3fdc588929 Mon Sep 17 00:00:00 2001 From: Stephen Ostrow Date: Tue, 24 Aug 2010 20:30:52 -0400 Subject: [PATCH 1/6] Updating the entries listing to have an edit and use the same delete as from the logtime module * Adding an edit link * Changing the delete link to use the same as the logtim module ** Uses an image instead of text ** Works without javascript as well as with ajax --- app/views/weekly_time_sheet/_entries.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/weekly_time_sheet/_entries.html.erb b/app/views/weekly_time_sheet/_entries.html.erb index a5eb166..9a888a2 100644 --- a/app/views/weekly_time_sheet/_entries.html.erb +++ b/app/views/weekly_time_sheet/_entries.html.erb @@ -27,7 +27,13 @@ current_project_id = nil <%=h entry.hours %> - <%=l 'button_delete' %> + <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry, :project_id => nil}, + :title => l(:button_edit) %> + <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry, :project_id => nil}, + :confirm => l(:text_are_you_sure), + :method => :post, + :title => l(:button_delete) %> + From 11797b8e7739b751ccde4680c68fcab87f3d60d5 Mon Sep 17 00:00:00 2001 From: Stephen Ostrow Date: Tue, 24 Aug 2010 20:46:19 -0400 Subject: [PATCH 2/6] Adding the proper locales file for redmine >= 0.9 Added a config/locales directory with a en.yml file for the english translation of the menu item --- config/locales/en.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 config/locales/en.yml diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..3fc9a34 --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,2 @@ +en: + redmine_weekly_time_sheet_title: "Log Time" From 318b4d206ab23c1d30bba903aa6b4b683cf5b1ca Mon Sep 17 00:00:00 2001 From: Stephen Ostrow Date: Fri, 1 Oct 2010 20:21:27 -0400 Subject: [PATCH 3/6] Changing the projects drop-down to use the applicationHelper to make it display in a tree --- app/views/weekly_time_sheet/_enter.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/weekly_time_sheet/_enter.html.erb b/app/views/weekly_time_sheet/_enter.html.erb index b0c84a4..f40da6d 100644 --- a/app/views/weekly_time_sheet/_enter.html.erb +++ b/app/views/weekly_time_sheet/_enter.html.erb @@ -37,4 +37,4 @@ <%= submit_tag l(:button_save) %>

- \ No newline at end of file + From 38f31f27cc879b5915b434f08f20078084e36297 Mon Sep 17 00:00:00 2001 From: Stephen Ostrow Date: Mon, 4 Oct 2010 12:16:06 -0400 Subject: [PATCH 4/6] Recommitting the work to make the projects list display as a tree --- app/views/weekly_time_sheet/_enter.html.erb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/views/weekly_time_sheet/_enter.html.erb b/app/views/weekly_time_sheet/_enter.html.erb index f40da6d..300795d 100644 --- a/app/views/weekly_time_sheet/_enter.html.erb +++ b/app/views/weekly_time_sheet/_enter.html.erb @@ -6,9 +6,16 @@

From a8621aa115ce626289436fbaf7f5bcc0a850c2ad Mon Sep 17 00:00:00 2001 From: Stephen Ostrow Date: Sun, 21 Oct 2012 02:57:30 -0400 Subject: [PATCH 5/6] Adding a routes file for Redmine > 1.4 --- config/routes.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 config/routes.rb diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..5687845 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,7 @@ +ActionController::Routing::Routes.draw do |map| + map.resources :weekly_time_sheet + map.connect 'weekly_time_sheet', :controller => 'weekly_time_sheet', :action => 'index' + map.connect 'delete_item', :controller => 'weekly_time_sheet', :action => 'delete_item' + map.connect 'project_tasks/:id', :controller => 'weekly_time_sheet', :action => 'project_tasks' + map.connect 'submit_time', :controller => 'weekly_time_sheet', :action => 'submit_time' +end From b8f0f4a1c2b2e14ddb8fea201988b1e3980e8bb7 Mon Sep 17 00:00:00 2001 From: Stephen Ostrow Date: Sun, 21 Oct 2012 02:57:42 -0400 Subject: [PATCH 6/6] Fixes the routes by removing an extra space. --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.rb b/init.rb index 85881cb..8580498 100644 --- a/init.rb +++ b/init.rb @@ -8,7 +8,7 @@ menu(:top_menu, :weekly_time_sheet, - {:controller => 'weekly_time_sheet ', :action => 'index'}, + {:controller => 'weekly_time_sheet', :action => 'index'}, :caption => :redmine_weekly_time_sheet_title, :if => Proc.new { User.current.allowed_to?(:log_time, nil, :global => true) ||