Merge branch 'master' into next
[shapado:shapado.git] / app / views / widgets / index.html.haml
1 -content_for :subtabs do
2   .navtitle
3     = t(".title")
4   %ul
5     %li.welcome_widgets
6       = link_to t(".welcome_widgets"), widgets_path(:tab=>"welcome"), :title => t(".welcome_widgets_title")
7     %li.mainlist_widgets
8       = link_to t(".mainlist_widgets"), widgets_path(:tab=>"mainlist"), :title => t(".mainlist_widgets_title")
9     %li.question_widgets
10       = link_to t(".question_widgets"), widgets_path(:tab=>"question"), :title => t(".question_widgets_title")
11
12
13 %h2.title
14   =t(".description")
15
16 #manage_widgets
17   %ul.list#widgets
18     -@widgets.each do |widget|
19       %li
20         .widget_description
21           = widget.description # do not escape
22           = render :partial => "#{widget.partial_name}_settings", :locals => {:widget => widget}
23         .widget.block{:id => widget.name}
24           .controls
25             .action
26               = link_to t("scaffold.destroy"), widget_path(widget), :method => :delete, :confirm => t("scaffold.sure", :model => "widget")
27             -form_tag move_widget_path(widget, :tab => @active_subtab), :class => "vote_box" do
28               = image_submit_tag("to_vote_up.png", :name=>"move_to", :value => "up")
29               = image_submit_tag("to_vote_down.png", :name=>"move_to", :value => "down")
30             .clear
31           - unless widget.question_only?
32             .widget_content
33               = render :partial => widget.partial_name, :locals => {:widget => widget}
34         .clear
35
36 %h2.title
37   =t(".new_widget", :default => "Add new widget")
38
39 -form_tag widgets_path, :class => "form" do
40   .group
41     = select :widget, "_type", Widget.types(params[:tab]).map {|w| [w.sub("Widget", "").titleize, w]}
42   .group.navform
43     =submit_tag t("scaffold.add"), :class => "button"