Create Widgets Controller
[shapado:shapado.git] / app / views / widgets / index.html.haml
1 -content_for :subtabs do
2   .navtitle
3     =t(".title")
4
5 %h2.title
6   =t(".description")
7
8 #manage_widgets
9   %ul.list#widgets
10     -@widgets.each do |widget|
11       %li
12         .widget_description
13           =widget.description # do not escape
14         .widget.block{:id => widget.name}
15           .controls
16             .right
17               = link_to  t("scaffold.destroy"), widget_path(widget), :method => :delete, :confirm => t("scaffold.sure", :model => "widget")
18             -form_tag move_widget_path(widget) do
19               = image_submit_tag("to_vote_up.png", :name=>"move_to", :value => widget.position-1)
20               = image_submit_tag("to_vote_down.png", :name=>"move_to", :value => widget.position+1)
21             .clear
22           .widget_content
23             = render :partial => widget.partial_name, :locals => {:widget => widget}
24         .clear
25
26 %h2.title
27   =t(".new_widget", :default => "Create new widget")
28
29 -form_tag widgets_path, :class => "form" do
30   .group
31     = select :widget, "_type", Widget::TYPES
32   .group.navform
33     =submit_tag t("scaffold.create")