Complete new interface

This commit is contained in:
Fu Matthew authored and chris committed 2013-01-14 19:18:25 +08:00
1 parent 16cfd27fe9
commit e1e003af6e
17 files changed
+178 -57

No files matched your search

@@ -0,0 +1,12 @@
<div class="style_switch well">
<label><%= t("default_widget.select_widget_style") %></label>
<% if @module_app.widgets[@widget_path].blank? %>
<%= t("default_widget.no_support_setting")%>
<%else%>
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]) %>
<% end %>
<% if(@module_app.widget_options && @module_app.widget_options.has_key?(@widget_path)) %>
<label><%= t("default_widget.select_widget_ext_option") %></label>
<%= render :partial=> "widget_ext_options" %>
<% end %>
</div>
@@ -1,18 +1,34 @@
<span id="widget_field">
<div id="widget_field" class="well clear">
<label for="widget_field"><%= t "default_widget.fields_order" %></label>
<div class="rows clear">
<span class="span4">
<label for="widget_field"><%= t "default_widget.fields_order" %></label>
</span>
<span class="span3">
<label for="widget_field"><%= t "default_widget.fields_style" %></label>
</span>
<span class="span5"></span>
</div>
<% @module_app.widget_fields.each_with_index do |widget_field, i| %>
<%= i+1 %>
<%= select_tag "page_part[widget_field][]", widget_field_options(i), :include_blank => true %>
<%= select_tag "page_part[widget_field_type][]", widget_fiield_type_options(i), :include_blank => true %> <br />
<div class="rows clear">
<span class="span4">
<%= i+1 %>
<%= select_tag "page_part[widget_field][]", widget_field_options(i), :include_blank => true %>
</span>
<span class="span3">
<%= select_tag "page_part[widget_field_type][]", widget_fiield_type_options(i), :include_blank => true %> <br />
</span>
<span class="span5"></span>
</div>
<% end %>
<br/><br/>
<%= label_tag t("default_widget.widget_data_count") %>
<%= text_field_tag :widget_data_count,@part.widget_data_count %>
<br>
</span>
<br/>
<div class="rows clear">
<span class="span4"><%= label_tag t("default_widget.widget_data_count") %></span>
</div>
<div class="rows clear">
<span class="span4"><%= text_field_tag :widget_data_count,@part.widget_data_count %></span>
</div>
</div>
@@ -1,9 +1,9 @@
<label><%= t("default_widget.select_widget_style") %></label>
<div class="style_switch well">
<label><%= t("default_widget.select_widget_style") %></label>
<ul class="clear">
<li>
<label class="radio style_radio">
<%= f.radio_button :widget_style,"typeA",:checked => style_checked_value(@part,"typeA") %>
<%= radio_button_tag :widget_style,"typeA",:checked => style_checked_value(@part,"typeA") %>
1
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style01.png'%></span>
@@ -11,7 +11,7 @@
</li>
<li>
<label class="radio style_radio">
<%= f.radio_button :widget_style,"typeB_style2",:checked => style_checked_value(@part,"typeB_style2") %>
<%= radio_button_tag :widget_style,"typeB_style2",:checked => style_checked_value(@part,"typeB_style2") %>
2
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style02.png'%></span>
@@ -19,7 +19,7 @@
</li>
<li>
<label class="radio style_radio">
<%= f.radio_button :widget_style,"typeB_style3",:checked => style_checked_value(@part,"typeB_style3") %>
<%= radio_button_tag :widget_style,"typeB_style3",:checked => style_checked_value(@part,"typeB_style3") %>
3
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style03.png'%></span>
@@ -27,7 +27,7 @@
</li>
<li>
<label class="radio style_radio">
<%= f.radio_button :widget_style,"typeB_style4",:checked => style_checked_value(@part,"typeB_style4") %>
<%= radio_button_tag :widget_style,"typeB_style4",:checked => style_checked_value(@part,"typeB_style4") %>
4
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style04.png'%></span>
@@ -35,7 +35,7 @@
</li>
<li>
<label class="radio style_radio">
<%= f.radio_button :widget_style,"typeC",:checked => style_checked_value(@part,"typeC") %>
<%= radio_button_tag :widget_style,"typeC",:checked => style_checked_value(@part,"typeC") %>
5
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style05.png'%></span>
@@ -1,3 +1,5 @@
<%= stylesheet_link_tag "admin/default_widget_setting" %>
<%= form_for @part, :url => admin_page_part_path(@part) do |f| %>
<% LIST[:page_part_kinds].each do |kind| %>
@@ -32,7 +32,7 @@
</div>
<div id="widget_setting">
<%= render :partial => 'widget_setting' %>
<%= render :partial => 'widget_setting' ,:locals=>{:f=>f} %>
</div>
<!-- <span id="widget_options">
@@ -1,12 +1,12 @@
<label><%= t "default_widget.data_source.tag" %></label>
<% if @categories %>
<fieldset>
<%= nil_radio_button(@part,:category) %>
<%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%>
<%= radio_button("page_part", "category", category.id, :checked => category_checked_value(@part,category.id) )%>
<%= category.title%>
<% end %>
</fieldset>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
<label><%= t "default_widget.data_source.tag" %></label>
<% if @categories %>
<fieldset>
<%= nil_radio_button(@part,:category) %>
<%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%>
<%= radio_button("page_part", "category", category.id, :checked => category_checked_value(@part,category.id) )%>
<%= category.title%>
<% end %>
</fieldset>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
@@ -1,12 +1,12 @@
<label><%= t "default_widget.data_source.category" %></label>
<% if @categories %>
<fieldset>
<%= nil_radio_button(@part,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
<%= radio_button("page_part", "tag", tag.id, :checked => tag_checked_value(@part,tag.id) )%>
<%= tag[I18n.locale]%>
<% end %>
</fieldset>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
<% if @categories %>
<fieldset>
<%= nil_radio_button(@part,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
<%= radio_button("page_part", "tag", tag.id, :checked => tag_checked_value(@part,tag.id) )%>
<%= tag[I18n.locale]%>
<% end %>
</fieldset>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>
@@ -0,0 +1,13 @@
<% @module_app.widget_options[@widget_path].each do |key,options| %>
<%= label_tag(t(@module_app.widget_options_fields_i18n[@widget_path][key]))%>
<% case options%>
<% when Hash%>
<%= select_tag "page_part[widget_options][#{key}]", options_from_collection_for_select(eval(options["query"]), options["value"], options["label"].to_s, :selected => (@part.widget_options[key] rescue nil)) %>
<% else%>
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %>
<!-- (@part[:widget_field][i][0] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ) -->
<% end %>
<% end %>
@@ -3,5 +3,8 @@
<%= render :partial => 'default_widget_style_panel',:locals=>{:f=>f} %>
<%= render :partial => 'default_widget_setting' %>
</div>
<% elsif show_custom_widget_setting_panel %>
<% elsif show_custom_widget_setting_panel %>
<div id="custom_widget">
<%= render :partial => 'custom_widget_setting' %>
</div>
<% end %>
@@ -1 +1,8 @@
$('#widget_style_list select').html("<%= j options_for_select(@module_app.widgets[params[:id]]) %>")
<% if !@part.widget_path.blank? %>
<% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting' %>");
<% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
<% end %>
<% end %>
@@ -1,7 +1,13 @@
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| k}) %>");
$('#widget_style_list').html("<%= escape_javascript(select 'page_part', 'widget_style', @module_app.widgets[@widget_path]) if !@widget_path.blank? %>");
$('#widget_field').html("<%= j render 'widget_fields' %>");
$('#widget_category').html("<%= j render 'widget_categories' %>");
$('#widget_tag').html("<%= j render 'widget_tags' %>");
$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| k},@part.widget_path) %>");
$("#widget_data_source_category").html("<%= j render :partial => 'widget_data_source_category' %>");
$("#widget_data_source_tag").html("<%= j render :partial => 'widget_data_source_tag' %>");
<% if !@part.widget_path.blank? %>
<% if show_default_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'default_widget_style_panel' %>");
$('#widget_setting').append("<%= j render :partial => 'default_widget_setting' %>");
<% elsif show_custom_widget_setting_panel %>
$('#widget_setting').html("<%= j render :partial => 'custom_widget_setting' %>");
<% end %>
<% end %>
$("#widget_options").html("<%= j render 'widget_options'%>");