ika re-redesign module widget

This commit is contained in:
Fu Matthew 2013-01-16 14:07:09 +08:00
parent ba75c02622
commit 9edf0dca54
9 changed files with 97 additions and 51 deletions

View File

@ -1,6 +1,11 @@
label{
white-space: nowrap !important;
}
.style_switch{} .style_switch{}
.style_switch ul{} .style_switch ul{
margin: 0;
}
.style_switch li{ .style_switch li{
float: left; float: left;
@ -9,19 +14,18 @@
width: 103px; width: 103px;
} }
.style_radio{ .style_radio{
margin: 0 0 5px 10px; cursor: pointer;
margin: 0 0 0 10px;
} }
.style_img{ .style_img{
display: block; display: block;
margin: 0 0 5px; margin: 5px 0 5px -28px;
} }
.style_description{ .style_description{
color: #6B6B6B; color: #6B6B6B;
display: block; display: block;
margin: 0 0 0 5px; font-size: 12px;
} margin: 0 0 0 -25px;
white-space: normal;
label{
   white-space: nowrap !important ;
} }

View File

@ -54,8 +54,14 @@ module ApplicationHelper
raw(formatted_messages.join) raw(formatted_messages.join)
end end
def link_back def link_back(custom_class=nil)
case custom_class
when nil
link_to t('back'), get_go_back, :class => 'nav' link_to t('back'), get_go_back, :class => 'nav'
else
link_to t('back'), get_go_back, :class => custom_class
end
end end
# Clean the link back # Clean the link back

View File

@ -1,12 +1,21 @@
<div class="style_switch well"> <div class="style_switch control-group">
<label><%= t("default_widget.select_widget_style") %></label> <label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<% if @module_app.widgets[@widget_path].blank? %> <% if @module_app.widgets[@widget_path].blank? %>
<%= t("default_widget.no_support_setting")%> <%= t("default_widget.no_support_setting")%>
<%else%> <%else%>
<%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]) %> <%= select('page_part', 'widget_style', @module_app.widgets[@widget_path]) %>
<% end %> <% end %>
<% if(@module_app.widget_options && @module_app.widget_options.has_key?(@widget_path)) %> </div>
<label><%= t("default_widget.select_widget_ext_option") %></label>
<%= render :partial=> "widget_ext_options" %>
<% end %>
</div> </div>
<% if(@module_app.widget_options && @module_app.widget_options.has_key?(@widget_path)) %>
<div class="style_switch control-group">
<label class="control-label"><%= t("default_widget.select_widget_ext_option") %></label>
<div class="controls well" >
<%= render :partial=> "widget_ext_options" %>
</div>
</div>
<% end %>

View File

@ -1,4 +1,8 @@
<div id="widget_field" class="well clear"> <div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.NoName") %>
</label>
<div id="widget_field" class="well clear controls">
<div class="rows clear"> <div class="rows clear">
@ -22,7 +26,7 @@
<%= select_tag "page_part[widget_field_type][]", widget_fiield_type_options(i), :include_blank => true %> <br /> <%= select_tag "page_part[widget_field_type][]", widget_fiield_type_options(i), :include_blank => true %> <br />
</span> </span>
<span class="span5"></span> <span class="span5"></span>
</div> </div><br/>
<% end %> <% end %>
<br/> <br/>
<div class="rows clear"> <div class="rows clear">
@ -32,3 +36,4 @@
<span class="span4"><%= text_field_tag :widget_data_count,@part.widget_data_count %></span> <span class="span4"><%= text_field_tag :widget_data_count,@part.widget_data_count %></span>
</div> </div>
</div> </div>
</div>

View File

@ -1,45 +1,50 @@
<div class="style_switch well"> <div class="style_switch control-group">
<label><%= t("default_widget.select_widget_style") %></label> <label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<ul class="clear"> <ul class="clear">
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :widget_style,"typeA",:checked => style_checked_value(@part,"typeA") %> <%= radio_button_tag :widget_style,"typeA",:checked => style_checked_value(@part,"typeA") %>
1 1
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style01.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style01.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span> <span class="style_description"><%= t("default_widget.caption.typeA") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :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 2
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style02.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style02.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span> <span class="style_description"><%= t("default_widget.caption.typeA") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :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 3
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style03.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style03.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeB_style3") %></span> <span class="style_description"><%= t("default_widget.caption.typeB_style3") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :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 4
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style04.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style04.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeB_style4") %></span> <span class="style_description"><%= t("default_widget.caption.typeB_style4") %></span>
</label>
</li> </li>
<li> <li>
<label class="radio style_radio"> <label class="radio style_radio">
<%= radio_button_tag :widget_style,"typeC",:checked => style_checked_value(@part,"typeC") %> <%= radio_button_tag :widget_style,"typeC",:checked => style_checked_value(@part,"typeC") %>
5 5
</label>
<span class="style_img"><%=image_tag 'module/default_widgets/style05.png'%></span> <span class="style_img"><%=image_tag 'module/default_widgets/style05.png'%></span>
<span class="style_description"><%= t("default_widget.caption.typeC") %></span> <span class="style_description"><%= t("default_widget.caption.typeC") %></span>
</label>
</li> </li>
</ul> </ul>
</div>
</div> </div>

View File

@ -1,6 +1,6 @@
<%= stylesheet_link_tag "admin/default_widget_setting" %> <%= stylesheet_link_tag "admin/default_widget_setting" %>
<%= form_for @part, :url => admin_page_part_path(@part) do |f| %> <%= form_for @part, :url => admin_page_part_path(@part),:html=>{:class=>"clear form-horizontal edit_page_part"} do |f| %>
<% LIST[:page_part_kinds].each do |kind| %> <% LIST[:page_part_kinds].each do |kind| %>
<%= f.radio_button :kind, kind, :class => 'part_kind' %> <%= f.radio_button :kind, kind, :class => 'part_kind' %>
@ -12,7 +12,9 @@
</div> </div>
<% end %> <% end %>
<p> <div class="form-actions form-fixed pagination-right">
<%= f.submit t(:update_) %> <%= link_back %> <%= f.submit t(:update_),:class=>"btn btn-primary" %>
</p> <%= link_back("btn") %>
</div>
<% end %> <% end %>

View File

@ -1,29 +1,40 @@
<div> <div>
<%= f.fields_for :title_translations do |f| %> <%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<p> <div class="control-group">
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %> <%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}",:class=>"control-label" %>
<div class="controls">
<%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %> <%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %>
</p> </div>
</div>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<p id="module_app_list">
<label for="age_part[module_app]"><%= t "default_widget.select_module_app" %></label>
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :title, :selected => @module_app.id), {}, {:rel => admin_page_parts_path} %>
</p>
<p id="widget_list"> <div id="module_app_list" class="control-group">
<label for="age_part[widget_path]"><%= t "default_widget.select_widget_path" %></label> <label for="page_part[module_app]" class="control-label">
<%= t "default_widget.select_module_app" %>
</label>
<div class="controls">
<%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :title, :selected => @module_app.id), {}, {:rel => admin_page_parts_path} %>
</div>
</div>
<div id="widget_list" class="control-group">
<label for="page_part[widget_path]" class="control-label">
<%= t "default_widget.select_widget_path" %>
</label>
<div class="controls">
<%= f.select :widget_path, @module_app.widgets.collect{|k,v| [k.humanize, k]}, {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %> <%= f.select :widget_path, @module_app.widgets.collect{|k,v| [k.humanize, k]}, {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %>
</p> </div>
</div>
<div id="widget_option"> <div id="widget_option">
<div id="widget_data_source_category" class="well"> <div id="widget_data_source_category" class="control-group">
<%= render :partial => 'widget_data_source_category' %> <%= render :partial => 'widget_data_source_category' %>
</div> </div>
<div id="widget_data_source_tag" class="well"> <div id="widget_data_source_tag" class="control-group">
<%= render :partial => 'widget_data_source_tag' %> <%= render :partial => 'widget_data_source_tag' %>
</div> </div>

View File

@ -1,5 +1,6 @@
<label><%= t "default_widget.data_source.tag" %></label> <label class="control-label"><%= t "default_widget.data_source.category" %></label>
<% if @categories %> <% if @categories %>
<div class="well controls">
<fieldset> <fieldset>
<%= nil_radio_button(@part,:category) %> <%= nil_radio_button(@part,:category) %>
<%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%> <%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%>
@ -7,6 +8,7 @@
<%= category.title%> <%= category.title%>
<% end %> <% end %>
</fieldset> </fieldset>
</div>
<% else %> <% else %>
<%= t("default_widget.no_support_setting")%> <%= t("default_widget.no_support_setting")%>
<% end %> <% end %>

View File

@ -1,5 +1,6 @@
<label><%= t "default_widget.data_source.category" %></label> <label class="control-label"><%= t "default_widget.data_source.tag" %></label>
<% if @categories %> <% if @categories %>
<div class="well controls">
<fieldset> <fieldset>
<%= nil_radio_button(@part,:tag) %> <%= nil_radio_button(@part,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%> <%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
@ -7,6 +8,7 @@
<%= tag[I18n.locale]%> <%= tag[I18n.locale]%>
<% end %> <% end %>
</fieldset> </fieldset>
</div>
<% else %> <% else %>
<%= t("default_widget.no_support_setting")%> <%= t("default_widget.no_support_setting")%>
<% end %> <% end %>