Einbau Toolbar
This commit is contained in:
@@ -18,11 +18,15 @@ class ModulsController < ApplicationController
|
|||||||
# GET /moduls/1.json
|
# GET /moduls/1.json
|
||||||
def show
|
def show
|
||||||
@modul = Modul.find(params[:id])
|
@modul = Modul.find(params[:id])
|
||||||
|
@toolbar_elements = [{:hicon=>'icon-plus-sign', :text=>I18n.t("lva.add"), :path=>new_lva_path(:modul_id =>@modul.id)}]
|
||||||
|
@toolbar_elements << {:hicon=>'icon-pencil', :text=>I18n.t("modul.edit"), :path=>edit_modul_path(@modul)}
|
||||||
|
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t("common.delete"),:path=>@modul , :method=>:delete , :data=>{:confirm =>'Are you sure'}}
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # show.html.erb
|
format.html # show.html.erb
|
||||||
format.json { render json: @modul }
|
format.json { render json: @modul }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /moduls/new
|
# GET /moduls/new
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ class StudienController < ApplicationController
|
|||||||
@toolbar_elements=[{:icon=>:plus, :hicon =>'icon-plus-sign' ,:text=> I18n.t('studien.new') , :path => new_studium_path(@studium) }]
|
@toolbar_elements=[{:icon=>:plus, :hicon =>'icon-plus-sign' ,:text=> I18n.t('studien.new') , :path => new_studium_path(@studium) }]
|
||||||
@toolbar_elements<<{:icon=>:pencil, :hicon=>'icon-pencil',:text =>I18n.t('common.edit'),:path => edit_studium_path(@studium)}
|
@toolbar_elements<<{:icon=>:pencil, :hicon=>'icon-pencil',:text =>I18n.t('common.edit'),:path => edit_studium_path(@studium)}
|
||||||
@toolbar_elements<<{:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => studium_path(@studium), :method=> :delete,:confirm=>"Sure?" }
|
@toolbar_elements<<{:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => studium_path(@studium), :method=> :delete,:confirm=>"Sure?" }
|
||||||
|
@toolbar_modulgruppen =[ {:hicon=>'icon-plus-sign', :text=> I18n.t('modulgruppe.new'), :path=>new_studium_modulgruppe_path(@studium)}]
|
||||||
|
@toolbar_modulgruppen << {:hicon=>'icon-list', :text => I18n.t('modulgruppe.list'), :path=>modulgruppen_path}
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<div class="row-fluid">
|
<% toolbar_elements = !pretty_toolbar.nil? ? pretty_toolbar : @toolbar_elements %>
|
||||||
<span class="span12">
|
<span class="label"><%= I18n.t("common.actions")%></span>
|
||||||
|
<div class="btn-group">
|
||||||
<% @toolbar_elements.each do |t| %>
|
<% toolbar_elements.each do |t| %>
|
||||||
<%= link_to '<i class="'.html_safe+ t[:hicon].to_s.html_safe + '"></i>'.html_safe+t[:text], t[:path],:class=>"btn" %>
|
<%= link_to '<i class="'.html_safe+ t[:hicon].to_s.html_safe + '"></i>'.html_safe+t[:text], t[:path], :method=>t[:method], :confirm=>t[:confirm].to_s, :data=>t[:data], :class=>"btn" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render :partial=>'layouts/pretty_toolbar' %>
|
<%= render :partial=>'layouts/pretty_toolbar', :locals=>{:elements=>@toolbar_elements} %>
|
||||||
|
|||||||
@@ -16,4 +16,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= render :partial=>'layouts/pretty_toolbar' %>
|
<%= render 'layouts/pretty_toolbar'%><br>
|
||||||
|
<%= render 'layouts/pretty_toolbar', :pretty_toolbar=>@toolbar_modulgruppen %>
|
||||||
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user