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/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/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| 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"