From 452d26e7a208ac955cd5c16b6938184378310b9b Mon Sep 17 00:00:00 2001 From: "cforce@gmx.de" Date: Fri, 24 Jun 2011 15:45:09 +0200 Subject: [PATCH 1/3] *BugFix* Made a bug fix which only shows 404 isntead of internal error when nion admin acccesses /pastes URL *Changes* We don't like that "New Paste" is now part of the project menu. Its already enough tabs in our projects menu - eg. new issue is to be request not part or projects menu also. So we removed the entry from the menu and put "Redmine alike" a "new Paste" link on the upper right of the "Pastes" view tab, which is also part of the project menu (again: one tab is enough per modul) --- app/controllers/pastes_controller.rb | 1 + app/helpers/pastes_helper.rb | 6 ++++++ app/views/pastes/index.html.erb | 4 ++++ init.rb | 8 ++++---- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/controllers/pastes_controller.rb b/app/controllers/pastes_controller.rb index 84de635..0a03849 100644 --- a/app/controllers/pastes_controller.rb +++ b/app/controllers/pastes_controller.rb @@ -95,6 +95,7 @@ def find_project @project = @paste.project elsif User.current.admin? @pastes = Paste + else render_403 end @pastes = @project.pastes if @project diff --git a/app/helpers/pastes_helper.rb b/app/helpers/pastes_helper.rb index 6c10604..65a031c 100644 --- a/app/helpers/pastes_helper.rb +++ b/app/helpers/pastes_helper.rb @@ -81,4 +81,10 @@ def link_to_all_pastes { :controller => "pastes", :action => "index", :project_id => @project }, :class => "icon icon-multiple" end + + def link_to_new_paste + link_to_if_authorized "New paste", { :action => "new", + :project_id => @project }, :class => "icon icon-add" + end + end diff --git a/app/views/pastes/index.html.erb b/app/views/pastes/index.html.erb index 0a7dcc9..463a5eb 100644 --- a/app/views/pastes/index.html.erb +++ b/app/views/pastes/index.html.erb @@ -10,6 +10,10 @@ <% end %> +
+ <%= link_to_new_paste %> +
+

<%=h title %>

<% if @pastes.empty? %> diff --git a/init.rb b/init.rb index 4634d3b..094f468 100644 --- a/init.rb +++ b/init.rb @@ -57,10 +57,10 @@ menu :project_menu, :pastes, { :controller => 'pastes', :action => 'index' }, :caption => :label_paste_plural, :after => :label_wiki, :param => :project_id - - menu :project_menu, :new_paste, { :controller => 'pastes', :action => 'new' }, - :caption => :label_paste_new, :after => :label_paste_plural, - :param => :project_id +# removed new pasted link from project tab to link in pastes tab +# menu :project_menu, :new_paste, { :controller => 'pastes', :action => 'new' }, +# :caption => :label_paste_new, :after => :label_paste_plural, +# :param => :project_id end Redmine::Activity.map do |activity| From f91a4a492269087af5c33954f90c5e0d089174b0 Mon Sep 17 00:00:00 2001 From: cforce Date: Tue, 28 Jun 2011 09:43:13 +0200 Subject: [PATCH 2/3] added german locales/de.yml removed lang folder --- lang/en.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 lang/en.yml diff --git a/lang/en.yml b/lang/en.yml deleted file mode 100644 index e338591..0000000 --- a/lang/en.yml +++ /dev/null @@ -1,2 +0,0 @@ -# English strings go here -my_label: "My label" From 5f22563e57b0a2a7d86cec281f9667e34aa603f4 Mon Sep 17 00:00:00 2001 From: cforce Date: Tue, 28 Jun 2011 09:43:13 +0200 Subject: [PATCH 3/3] added german locales/de.yml --- config/locales/de.yml | 20 ++++++++++++++++++++ lang/en.yml | 2 -- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 config/locales/de.yml delete mode 100644 lang/en.yml diff --git a/config/locales/de.yml b/config/locales/de.yml new file mode 100644 index 0000000..8a76155 --- /dev/null +++ b/config/locales/de.yml @@ -0,0 +1,20 @@ +# German strings go here for Rails i18n +de: + label_paste_plural: Snippets + label_paste_all: Snippets + label_paste_view_all: alle Snippets anzeigen + label_paste_link_here: "Link zu diesem Snippet : %{link}" + label_paste_syntax: "Syntax: %{lang}" + label_paste_new: Snippet erstellen + label_paste_edit: bearbeiten %{link} + field_title: Überschrift (optional) + field_lang: Syntax + field_text: Text + button_paste_submit: Einfügen + text_paste_update_or_make_new: %{update} or %{make_new} + button_paste_update: Textschnipsel ändern + button_paste_make_new: als neuen Snippet erstellen + notice_paste_created: erfolgreich veröffentlicht + notice_paste_updated: Änderungen veröffentlicht + notice_paste_destroyed: Snippet gelöscht + text_paste_delete_confirmation: Wollen Sie den Snippet löschen? \ No newline at end of file diff --git a/lang/en.yml b/lang/en.yml deleted file mode 100644 index e338591..0000000 --- a/lang/en.yml +++ /dev/null @@ -1,2 +0,0 @@ -# English strings go here -my_label: "My label"