diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index bc3bcb6..d9b1399 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -14,6 +14,8 @@ class ThemenController < ApplicationController # GET /themen/1.json def show @thema = Thema.find(params[:id]) + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] + @toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>themengruppe_thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} respond_to do |format| format.html # show.html.erb diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index 14c70f9..70709ee 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -15,9 +15,11 @@ class ThemengruppenController < ApplicationController # GET /themengruppen/1.json def show @themengruppe = Themengruppe.find(params[:id]) - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)}] + @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)}] + @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} @toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} + respond_to do |format| format.html # show.html.erb format.json { render json: @themengruppe } diff --git a/app/views/fragen/_frage.html.erb b/app/views/fragen/_frage.html.erb new file mode 100644 index 0000000..5b9e67a --- /dev/null +++ b/app/views/fragen/_frage.html.erb @@ -0,0 +1,8 @@ +

+ <%= frage.title %>
+<%= raw(frage.text) %> +
+ +<%= link_to 'Edit', edit_frage_path(frage) %> | +<%= link_to 'Destroy',frage, method: :delete, data: { confirm: 'Are you sure?' } %> +

diff --git a/app/views/themen/_select.html.erb b/app/views/themen/_select.html.erb index 4964693..c7b02fd 100644 --- a/app/views/themen/_select.html.erb +++ b/app/views/themen/_select.html.erb @@ -22,5 +22,11 @@ <% end %>
+ +<% @att_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('attachment.add'), :path=>new_thema_attachment_path(@thema)}] %> + +<%= render :partial=>'layouts/pretty_toolbar', :object=>@att_elements %> +
diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index 1884d43..2c268f1 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -10,7 +10,6 @@


<% end %> - - - -<%= link_to 'Edit', small %> +<% @small_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small}] +@small_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('thema.remove'), :path=>small, :method=>:delete,:confirm=>I18n.t('thema.sure')}%> +<%= render :partial=>'layouts/pretty_toolbar', :object=>@small_elements %> diff --git a/app/views/themen/show.html.erb b/app/views/themen/show.html.erb index aaf3fa6..177becf 100644 --- a/app/views/themen/show.html.erb +++ b/app/views/themen/show.html.erb @@ -5,23 +5,23 @@ <%= raw(@thema.text) %>

- + +<%= render :partial=>'layouts/pretty_toolbar' %>

FAQs:

<% @thema.fragen.each do |frage| %> -

- <%= frage.title %>
-<%= raw(frage.text) %> -
-<%= link_to 'Edit', edit_frage_path(frage) %> | -<%= link_to 'Destroy',frage, method: :delete, data: { confirm: 'Are you sure?' } %> - -

+<%= render frage %> <% end %> + +<% @frage_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('frage.add'), :path=>new_frage_path}] %> +<%= render :partial=>'layouts/pretty_toolbar', :object=>@frage_elements %> +
-

Attachments:

-<%= render :partial => "themen/select", :object => @thema, :locals => { :editor => :false }%> +

<%= I18n.t('attachment.title')%>:

+<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %> diff --git a/app/views/themengruppen/show.html.erb b/app/views/themengruppen/show.html.erb index c0718c2..b3b8d36 100644 --- a/app/views/themengruppen/show.html.erb +++ b/app/views/themengruppen/show.html.erb @@ -21,12 +21,4 @@ <% end %> -<%= link_to 'Add Thema', new_themengruppe_thema_path(@themengruppe) %> - -

- - <%= render :partial=>'layouts/pretty_toolbar' %> diff --git a/config/locales/themen.de.yml b/config/locales/themen.de.yml index 10ec9ac..7430b27 100644 --- a/config/locales/themen.de.yml +++ b/config/locales/themen.de.yml @@ -4,4 +4,17 @@ de: new: "Neue Themengruppe" edit: "Themengruppe bearbeiten" remove: "Themengruppe löschen" - sure: "Sicher, dass Sie diese Themengruppe löschen möchten?" \ No newline at end of file + sure: "Sicher, dass Sie diese Themengruppe löschen möchten?" + thema: + add: "Thema hinzufügen" + edit: "Thema bearbeiten" + remove: "Thema löschen" + sure: "Sicher, dass Sie dieses Thema löschen möchten?" + frage: + add: "Frage hinzufügen" + edit: "Frage bearbeiten" + remove: "Frage löschen" + sure: "Sicher, dass Sie diese Frage löschen möchten?" + attachment: + title: "Anhang" + add: "Anhang hinzufügen" \ No newline at end of file