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 ul{}
.style_switch ul{
margin: 0;
}
.style_switch li{
float: left;
@ -9,19 +14,18 @@
width: 103px;
}
.style_radio{
margin: 0 0 5px 10px;
cursor: pointer;
margin: 0 0 0 10px;
}
.style_img{
display: block;
margin: 0 0 5px;
margin: 5px 0 5px -28px;
}
.style_description{
color: #6B6B6B;
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)
end
def link_back
link_to t('back'), get_go_back, :class => 'nav'
def link_back(custom_class=nil)
case custom_class
when nil
link_to t('back'), get_go_back, :class => 'nav'
else
link_to t('back'), get_go_back, :class => custom_class
end
end
# Clean the link back

View File

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

View File

@ -1,45 +1,50 @@
<div class="style_switch well">
<label><%= t("default_widget.select_widget_style") %></label>
<div class="style_switch control-group">
<label class="control-label">
<%= t("default_widget.select_widget_style") %>
</label>
<div class="controls well">
<ul class="clear">
<li>
<label class="radio style_radio">
<%= 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>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span>
</label>
</li>
<li>
<label class="radio style_radio">
<%= 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>
<span class="style_description"><%= t("default_widget.caption.typeA") %></span>
</label>
</li>
<li>
<label class="radio style_radio">
<%= 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>
<span class="style_description"><%= t("default_widget.caption.typeB_style3") %></span>
</label>
</li>
<li>
<label class="radio style_radio">
<%= 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>
<span class="style_description"><%= t("default_widget.caption.typeB_style4") %></span>
</label>
</li>
<li>
<label class="radio style_radio">
<%= 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>
<span class="style_description"><%= t("default_widget.caption.typeC") %></span>
</label>
</li>
</ul>
</div>
</div>

View File

@ -1,6 +1,6 @@
<%= 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| %>
<%= f.radio_button :kind, kind, :class => 'part_kind' %>
@ -12,7 +12,9 @@
</div>
<% end %>
<p>
<%= f.submit t(:update_) %> <%= link_back %>
</p>
<div class="form-actions form-fixed pagination-right">
<%= f.submit t(:update_),:class=>"btn btn-primary" %>
<%= link_back("btn") %>
</div>
<% end %>

View File

@ -1,29 +1,40 @@
<div>
<%= f.fields_for :title_translations do |f| %>
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<p>
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %>
<%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil),:size=>30 %>
</p>
<% end %>
<div class="control-group">
<%= 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 %>
</div>
</div>
<% end %>
<% end %>
</div>
<p id="module_app_list">
<label for="age_part[module_app]"><%= t "default_widget.select_module_app" %></label>
<div id="module_app_list" class="control-group">
<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} %>
</p>
</div>
</div>
<p id="widget_list">
<label for="age_part[widget_path]"><%= t "default_widget.select_widget_path" %></label>
<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 } %>
</p>
</div>
</div>
<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' %>
</div>
<div id="widget_data_source_tag" class="well">
<div id="widget_data_source_tag" class="control-group">
<%= render :partial => 'widget_data_source_tag' %>
</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 %>
<div class="well controls">
<fieldset>
<%= nil_radio_button(@part,:category) %>
<%= content_tag_for(:label, @categories,:class=>"radio inline") do |category|%>
@ -7,6 +8,7 @@
<%= category.title%>
<% end %>
</fieldset>
</div>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% 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 %>
<div class="well controls">
<fieldset>
<%= nil_radio_button(@part,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
@ -7,6 +8,7 @@
<%= tag[I18n.locale]%>
<% end %>
</fieldset>
</div>
<% else %>
<%= t("default_widget.no_support_setting")%>
<% end %>