CHANGE: pretty_toolbar für Fragen und Themen

This commit is contained in:
HausdorffHimself
2013-09-01 23:56:04 +02:00
parent 94925e34ba
commit 9c316f165c
8 changed files with 47 additions and 25 deletions

View File

@@ -14,6 +14,8 @@ class ThemenController < ApplicationController
# GET /themen/1.json # GET /themen/1.json
def show def show
@thema = Thema.find(params[:id]) @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| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb

View File

@@ -15,9 +15,11 @@ class ThemengruppenController < ApplicationController
# GET /themengruppen/1.json # GET /themengruppen/1.json
def show def show
@themengruppe = Themengruppe.find(params[:id]) @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')} @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| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
format.json { render json: @themengruppe } format.json { render json: @themengruppe }

View 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>

View File

@@ -22,5 +22,11 @@
<% end %> <% end %>
</div> </div>
</br> </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) %> <%= link_to 'Neues Attachment', new_thema_attachment_path(@thema) %>
-->
<br/> <br/>

View File

@@ -10,7 +10,6 @@
</p> </p>
<br/> <br/>
<% end %> <% end %>
<% @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 %>
<%= link_to 'Edit', small %>

View File

@@ -5,23 +5,23 @@
<%= raw(@thema.text) %> <%= raw(@thema.text) %>
</p> </p>
<!--
<%= link_to 'Edit', edit_thema_path(@thema) %> | <%= link_to 'Edit', edit_thema_path(@thema) %> |
<%= link_to 'Back', themengruppe_path(@thema.themengruppe) %> <%= link_to 'Back', themengruppe_path(@thema.themengruppe) %>
-->
<%= render :partial=>'layouts/pretty_toolbar' %>
<h2>FAQs:</h2> <h2>FAQs:</h2>
<% @thema.fragen.each do |frage| %> <% @thema.fragen.each do |frage| %>
<p> <%= render frage %>
<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>
<% end %> <% 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/> <%= link_to 'Neue Frage', new_frage_path %> <br/>
-->
<br/> <br/>
<h2>Attachments:</h2> <h2><%= I18n.t('attachment.title')%>:</h2>
<%= render :partial => "themen/select", :object => @thema, :locals => { :editor => :false }%> <%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>

View File

@@ -21,12 +21,4 @@
<% end %> <% end %>
</div> </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' %> <%= render :partial=>'layouts/pretty_toolbar' %>

View File

@@ -5,3 +5,16 @@ de:
edit: "Themengruppe bearbeiten" edit: "Themengruppe bearbeiten"
remove: "Themengruppe löschen" remove: "Themengruppe löschen"
sure: "Sicher, dass Sie diese Themengruppe löschen möchten?" 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"