added external widgets
[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     %li.question_widgets
12       = link_to t(".external_widgets"), widgets_path(:tab=>"external"), :title => t(".external_widgets_title")
13
14 %h2.title
15   =t(".description")
16
17 #manage_widgets
18   %ul.list#widgets
19     -@widgets.each do |widget|
20       %li
21         .widget_description
22           = widget.description # do not escape
23           = render :partial => "#{widget.partial_name}_settings", :locals => {:widget => widget}
24         .widget.block{:id => widget.name}
25           .controls
26             .action
27               = link_to t("scaffold.destroy"), widget_path(widget), :method => :delete, :confirm => t("scaffold.sure", :model => "widget")
28             -form_tag move_widget_path(widget, :tab => @active_subtab), :class => "vote_box" do
29               = image_submit_tag("to_vote_up.png", :name=>"move_to", :value => "up")
30               = image_submit_tag("to_vote_down.png", :name=>"move_to", :value => "down")
31             .clear
32           - unless widget.question_only?
33             .widget_content
34               = render :partial => widget.partial_name, :locals => {:widget => widget}
35         .clear
36
37 %h2.title
38   =t(".new_widget", :default => "Add new widget")
39
40 -form_tag widgets_path(:tab => params[:tab]), :class => "form" do
41   .group
42     = select :widget, "_type", Widget.types(params[:tab]).map {|w| [w.sub("Widget", "").titleize, w]}
43   .group.navform
44     =submit_tag t("scaffold.add"), :class => "button"