CHANGE: pretty_toolbar für Fragen und Themen
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
8
app/views/fragen/_frage.html.erb
Normal file
8
app/views/fragen/_frage.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<p>
|
||||
<b> <%= frage.title %> </b> <br/>
|
||||
<%= raw(frage.text) %>
|
||||
<br/>
|
||||
|
||||
<%= link_to 'Edit', edit_frage_path(frage) %> |
|
||||
<%= link_to 'Destroy',frage, method: :delete, data: { confirm: 'Are you sure?' } %>
|
||||
</p>
|
||||
@@ -22,5 +22,11 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</br>
|
||||
|
||||
<% @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 %>
|
||||
<!--
|
||||
<%= link_to 'Neues Attachment', new_thema_attachment_path(@thema) %>
|
||||
-->
|
||||
<br/>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
</p>
|
||||
<br/>
|
||||
<% 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 %>
|
||||
|
||||
@@ -5,23 +5,23 @@
|
||||
<%= raw(@thema.text) %>
|
||||
</p>
|
||||
|
||||
|
||||
<!--
|
||||
<%= link_to 'Edit', edit_thema_path(@thema) %> |
|
||||
<%= link_to 'Back', themengruppe_path(@thema.themengruppe) %>
|
||||
-->
|
||||
<%= render :partial=>'layouts/pretty_toolbar' %>
|
||||
|
||||
<h2>FAQs:</h2>
|
||||
<% @thema.fragen.each do |frage| %>
|
||||
<p>
|
||||
<b> <%= frage.title %> </b> <br/>
|
||||
<%= raw(frage.text) %>
|
||||
<br/>
|
||||
<%= link_to 'Edit', edit_frage_path(frage) %> |
|
||||
<%= link_to 'Destroy',frage, method: :delete, data: { confirm: 'Are you sure?' } %>
|
||||
|
||||
</p>
|
||||
<%= 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 %>
|
||||
<!--
|
||||
<%= link_to 'Neue Frage', new_frage_path %> <br/>
|
||||
-->
|
||||
<br/>
|
||||
|
||||
<h2>Attachments:</h2>
|
||||
<%= render :partial => "themen/select", :object => @thema, :locals => { :editor => :false }%>
|
||||
<h2><%= I18n.t('attachment.title')%>:</h2>
|
||||
<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>
|
||||
|
||||
@@ -21,12 +21,4 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to 'Add Thema', new_themengruppe_thema_path(@themengruppe) %>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<!--
|
||||
<%= link_to 'Edit', edit_themengruppe_path(@themengruppe) %> |
|
||||
<%= link_to 'Back', themengruppen_path %>
|
||||
-->
|
||||
<%= render :partial=>'layouts/pretty_toolbar' %>
|
||||
|
||||
@@ -5,3 +5,16 @@ de:
|
||||
edit: "Themengruppe bearbeiten"
|
||||
remove: "Themengruppe löschen"
|
||||
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"
|
||||
Reference in New Issue
Block a user