solved conflict for member_new_ui
This commit is contained in:
1 parent
9c7558847a
commit
6c514770bc
92 files changed
+3204
-2102
No files matched your search
@@ -1,125 +1,130 @@
|
||||
<div class="form-horizontal <%= attribute_field.disabled ? 'disabled' : ''%>">
|
||||
<%
|
||||
attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter
|
||||
%>
|
||||
<%= @af_counter + 1 %>
|
||||
<%#= attribute_field_counter %>
|
||||
<legend>
|
||||
<button class="onoff pull-right <%= attribute_field.disabled ? 'disabled' : ''%>"><%= attribute_field.disabled ? 'OFF' : 'ON'%></button>
|
||||
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"attribute_field_disabled"%>
|
||||
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
|
||||
<a class="btn btn-small pull-right btn-danger remove_attribute"><i class="icon-trash icon-large"></i> <%= t(:delete_)%></a>
|
||||
<div class="clear">
|
||||
<div class="control-group pull-left">
|
||||
<label class="control-label" for="key"><%= t(:key) %></label>
|
||||
<div class="multipleInput">
|
||||
<div class="controls">
|
||||
<%= text_field "#{@field_name}[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][title_translations]"}%>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="key"><%= t(:to_search) %></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "true",:checked => (attribute_field.to_search == true ? true : false)) %><%= t(:yes_)%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "false",:checked => (attribute_field.to_search == false ? true : false)) %><%= t(:no_)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group pull-left">
|
||||
<label class="control-label" for=""><%= t(:type)%></label>
|
||||
<div class="controls">
|
||||
<%#= select_tag "#{@field_name}[attribute_fields][#{@af_counter}][markup]" do %>
|
||||
<select class="dataType" name=<%= "#{@field_name}[attribute_fields][#{@af_counter}][markup]"%>>
|
||||
<%LIST[:markups].each do |key,val|%>
|
||||
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</legend>
|
||||
<div class="<%= attribute_field.disabled ? 'hide' : ''%>">
|
||||
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeA") do%>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:enabled_for)%></label>
|
||||
<div class="controls">
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
|
||||
<%= t(:cross_lang)%>
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"]) %>
|
||||
<%= t(:add_more)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
|
||||
<% end %>
|
||||
|
||||
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeB") do %>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeB][initial]"}%>
|
||||
|
||||
<% if attribute_field.self_defined_markup_options?%>
|
||||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
|
||||
<%else #normal list%>
|
||||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
|
||||
<% end #of self_defined_markup_options?%>
|
||||
|
||||
<% end %>
|
||||
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeC") do %>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t("date.format")%></label>
|
||||
<div class="controls">
|
||||
<%= select "#{@field_name}[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t("date.range")%></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t("date.calendar")%></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeD") do%>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:enabled_for)%></label>
|
||||
<div class="controls">
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
|
||||
<%= t(:cross_lang)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
|
||||
<% end %>
|
||||
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeE") do%>
|
||||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
|
||||
<% end %>
|
||||
<div class="attributes default <%= attribute_field.disabled ? 'disabled' : ''%>">
|
||||
<%
|
||||
attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter
|
||||
%>
|
||||
<div class="attributes-header clearfix">
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= attribute_field.disabled ? 'disabled' : ''%>">
|
||||
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"toggle-check", :data=>{:deploy=>"right"} %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%>
|
||||
</div>
|
||||
<a class="btn btn-mini pull-right btn-danger delete" href="#"><i class="icon-trash"></i> <%= t(:delete_)%></a>
|
||||
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
|
||||
<a class="btn btn-mini pull-right btn-inverse reply hide" href="#"><i class="icons-reply"></i> Reset</a>
|
||||
<h4>Attributes <span><%= @af_counter + 1 %></span></h4>
|
||||
</div>
|
||||
<div class="attributes-body">
|
||||
<div class="control-group">
|
||||
<label class="control-label muted" for="key_<%= @af_counter %>"><%= t(:key) %></label>
|
||||
<div class="controls">
|
||||
<%= text_field "#{@field_name}[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key, :data=>{:type=>"key"} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][title_translations]"}%>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label muted" for=""><%= t(:to_search) %></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "true",:checked => (attribute_field.to_search == true ? true : false), :data=>{:type=>"search_true"}) %><%= t(:yes_)%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}]", "to_search", "false",:checked => (attribute_field.to_search == false ? true : false), :data=>{:type=>"search_false"}) %><%= t(:no_)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted" for=""><%= t(:type)%></label>
|
||||
<div class="controls">
|
||||
<select class="dataType" data-type="select" name=<%= "#{@field_name}[attribute_fields][#{@af_counter}][markup]"%>>
|
||||
<%LIST[:markups].each do |key,val|%>
|
||||
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field-type fade"></div>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeA")}" do%>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t(:enabled_for)%></label>
|
||||
<div class="controls">
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"],:data=>{:type=>"cross_lang"}) %>
|
||||
<%= t(:cross_lang) %>
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"],:data=>{:type=>"add_more"}) %>
|
||||
<%= t(:add_more)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
|
||||
<% end if show_type_panel(attribute_field,"typeA") != 'typeA hide' %>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeB")}" do %>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeB][initial]"}%>
|
||||
|
||||
<% if attribute_field.self_defined_markup_options?%>
|
||||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
|
||||
<%else #normal list%>
|
||||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
|
||||
<% end #of self_defined_markup_options?%>
|
||||
|
||||
<% end if show_type_panel(attribute_field,"typeB") != 'typeB hide' %>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeC")}" do %>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t("date.format")%></label>
|
||||
<div class="controls">
|
||||
<%= select "#{@field_name}[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t("date.range")%></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t("date.calendar")%></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= radio_button("#{@field_name}[attribute_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<% end if show_type_panel(attribute_field,"typeC") != 'typeC hide' %>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeD")}" do%>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><%= t(:enabled_for)%></label>
|
||||
<div class="controls">
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag("#{@field_name}[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
|
||||
<%= t(:cross_lang)%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
|
||||
<% end if show_type_panel(attribute_field,"typeD") != 'typeD hide' %>
|
||||
|
||||
<%= content_tag :div,:class=>"field-type default fade in #{show_type_panel(attribute_field,"typeE")}" do%>
|
||||
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
|
||||
<% end if show_type_panel(attribute_field,"typeE") != 'typeE hide' %>
|
||||
|
||||
<%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
<tr id="<%= dom_id sub_role_attribute %>" class="<%= sub_role_attribute.disabled ? 'disable' : '' %>">
|
||||
<td>
|
||||
<span class="label label-info"><%= sub_role_attribute.title %></span>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills">
|
||||
<li><%= link_to t(:edit), eval("admin_#{@attribute_type}_edit_sub_role_path(sub_role_attribute)"), :class=>"open-slide" %></li>
|
||||
<li><%= link_to t(:sub_role_field), eval("admin_#{@attribute_type}_sub_role_field_path(sub_role_attribute)"), :class => 'edit' %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td class="action span3">
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= sub_role_attribute.disabled ? 'disabled' : '' %>">
|
||||
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_role_sub_role_toggle_path(sub_role_attribute)"), method: :post, remote: true, class: "switch" %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if !sub_role_attribute.is_built_in? %>
|
||||
<%= link_to (content_tag :i,'',:class=>'icon-trash')+t(:delete_), eval("admin_#{@attribute_type}_path(sub_role_attribute, :sub_role => {:id => sub_role_attribute })"), :type=>"button", :class => 'btn btn-mini btn-danger', :confirm => t('sure?'), :method => :delete, :remote => true %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,12 @@
|
||||
<table class="table main-list" id="roles_index">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
<th colspan="2" class="span4 active"><a href="#"><%= t("sub_role") %><b class="icons-arrow-down-4"></b></a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<%= render partial: 'sub_role_attribute', collection: @attribute_fields_upper_object %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,57 +1,33 @@
|
||||
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
|
||||
<fieldset>
|
||||
<legend><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></legend>
|
||||
<label class="muted" for="key"><%= t(:key) %></label>
|
||||
<% if @sub_attribute.new_record? %>
|
||||
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
|
||||
<% else %>
|
||||
<div><%= @sub_attribute.key%></div>
|
||||
<% end %>
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
|
||||
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>">
|
||||
|
||||
<% end %>
|
||||
|
||||
<label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, true %>
|
||||
Yes
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, false %>
|
||||
No
|
||||
</label>
|
||||
<div class="form-actions">
|
||||
<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
|
||||
<%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
<div class="map-block back">
|
||||
<h4><span><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></span></h4>
|
||||
<div class="form-horizontal">
|
||||
<div class="clear">
|
||||
|
||||
<div class="control-group pull-left">
|
||||
<label class="control-label" for="key"><%= t(:to_search) %></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, true %>
|
||||
Yes
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, false %>
|
||||
No
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group pull-left">
|
||||
<label class="control-label" for="key"><%= t(:key) %></label>
|
||||
<div class="controls">
|
||||
<% if @sub_attribute.new_record? %>
|
||||
<%= f.text_field :key, :placeholder => t(:key) %>
|
||||
<% else %>
|
||||
<div><%= @sub_attribute.key%></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%#= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<% end %>
|
||||
@@ -0,0 +1 @@
|
||||
$("#<%= dom_id @attribute %>").remove();
|
||||
@@ -0,0 +1,32 @@
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
|
||||
<fieldset>
|
||||
<legend><%= t(eval(":#{@attribute_type}"))%></legend>
|
||||
<label class="muted" for="key"><%= t(:key) %></label>
|
||||
<% if @attribute.new_record? %>
|
||||
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
|
||||
<% else %>
|
||||
<div><%= @attribute.key%></div>
|
||||
<% end %>
|
||||
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
|
||||
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>" value="<%= @attribute.title_translations[locale] rescue nil %>">
|
||||
|
||||
<% end %>
|
||||
|
||||
<label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, true %>
|
||||
<%= t(:yes_)%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, false %>
|
||||
<%= t(:no_)%>
|
||||
</label>
|
||||
<div class="form-actions">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
|
||||
<%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
@@ -1,59 +1,33 @@
|
||||
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
|
||||
<fieldset>
|
||||
<legend><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></legend>
|
||||
<label class="muted" for="key"><%= t(:key) %></label>
|
||||
<% if @sub_attribute.new_record? %>
|
||||
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
|
||||
<% else %>
|
||||
<div><%= @sub_attribute.key%></div>
|
||||
<% end %>
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
|
||||
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="sub_role[title_translations][#{locale}]"%>" value="<%= @sub_attribute.title_translations[locale] rescue nil %>">
|
||||
|
||||
<%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
<div class="map-block back">
|
||||
<h4><span><%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %></span></h4>
|
||||
<div class="form-horizontal">
|
||||
<div class="clear">
|
||||
|
||||
<div class="control-group pull-left">
|
||||
<label class="control-label" for="key"><%= t(:key) %></label>
|
||||
<div class="controls">
|
||||
<% if @sub_attribute.new_record? %>
|
||||
<%= f.text_field :key, :placeholder => t(:key) %>
|
||||
<% else %>
|
||||
<div><%= @sub_attribute.key%></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
|
||||
|
||||
<div class="control-group pull-left">
|
||||
<label class="control-label" for="key"><%= t(:to_search) %></label>
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, true %>
|
||||
Yes
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, false %>
|
||||
No
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%#= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.hidden_field :id %>
|
||||
<%#= f.hidden_field :role_id, :value => @attribute.id if !params[:role_id].blank? %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<% end %>
|
||||
<label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, true %>
|
||||
Yes
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, false %>
|
||||
No
|
||||
</label>
|
||||
<div class="form-actions">
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
|
||||
<%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
@@ -1 +1,35 @@
|
||||
111
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal", :id=>"new_bulletin_category", remote: true do |f| %>
|
||||
|
||||
<fieldset>
|
||||
<legend><%= t(eval(":#{@attribute_type}"))%></legend>
|
||||
<label class="muted" for="key"><%= t(:key) %></label>
|
||||
<% if @attribute.new_record? %>
|
||||
<%= f.text_field :key, :class => "input-large", :placeholder => t(:key) %>
|
||||
<% else %>
|
||||
<div><%= @attribute.key%></div>
|
||||
<% end %>
|
||||
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<label class="muted" for="name-en"><%= t(:item_name) %>(<%= I18nVariable.from_locale(locale) %>)</label>
|
||||
<input id="name-<%= locale %>" type="text" class="input-large" placeholder="<%= t(:item_name) %>" name="<%="#{@attribute_type}[title_translations][#{locale}]"%>">
|
||||
|
||||
<% end %>
|
||||
|
||||
<label class="muted" for="name-zh-tw"><%= t(:to_search) %></label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, true %>
|
||||
<%= t(:yes_)%>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :to_search, false %>
|
||||
<%= t(:no_)%>
|
||||
</label>
|
||||
<div class="form-actions">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary btn-small' %>
|
||||
<%= link_to t('cancel'), 'javascript:$.pageslide.close()', :class=>" btn-small" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -1,128 +1,40 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
|
||||
<div class="map-block back attributes">
|
||||
<h4><span><%= @attribute.title + t(:role)%></span></h4>
|
||||
<div id="attribute_field_list">
|
||||
<%= render :partial=>"attribute_field",:collection=>@attribute.attribute_fields%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="add-attributes form-actions pagination-right">
|
||||
<%= link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_role_add_attribute_field_path(@attribute),:class=>"btn btn-primary",:remote => true%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%#= f.hidden_field :id, :value => params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<% end %>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
<%= stylesheet_link_tag "lib/main-forms.css" %>
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<script>
|
||||
var CloneTarget ;
|
||||
|
||||
var NewNode;
|
||||
|
||||
$(document).ready(function(){
|
||||
function checkSwitch() {
|
||||
$(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled');
|
||||
}
|
||||
function checkMultipleInput() {
|
||||
$(".multipleInput").each(function() {
|
||||
$(this).find('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
|
||||
});
|
||||
}
|
||||
function removeInput(){
|
||||
$(".removeInput").live('click',function (){
|
||||
$(this).parents(".controls").remove();
|
||||
checkMultipleInput();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
checkSwitch();
|
||||
checkMultipleInput();
|
||||
removeInput();
|
||||
$(".remove_attribute").live('click',function(){
|
||||
$(this).siblings(".attribute_field_to_delete").val("true");
|
||||
$(this).parents(".form-horizontal").fadeOut("slow", function () { $(this).hide(); });
|
||||
});
|
||||
|
||||
$(".help-block a").live('click',function (){
|
||||
CloneTarget = $(this).parents(".controls").prev(".multipleInput").find('.controls:last');
|
||||
NewNode = CloneTarget.clone();
|
||||
var index;
|
||||
NewNode.find("input").each(function(k,v){
|
||||
index = CloneTarget.parents("div.control-group").find(".list_count").val()
|
||||
field_name = CloneTarget.parents("div.control-group").find(".field_name").val()
|
||||
ori_str = $(v).attr("name").replace(field_name,"");
|
||||
lang = ori_str.match(/\[\D*\]/);
|
||||
new_field_name = (field_name+"[" + (parseInt(index)+1) + "]" + lang);
|
||||
$(v).attr("name",new_field_name);
|
||||
})
|
||||
|
||||
$(this).parents("div.control-group").find(".list_count").val(parseInt(index)+1)
|
||||
$(this).parents(".controls").prev(".multipleInput").append(NewNode);
|
||||
$(this).parents(".controls").prev(".multipleInput").find('.controls:last input').val("");
|
||||
removeInput();
|
||||
checkMultipleInput();
|
||||
return false;
|
||||
})
|
||||
$(".status select").each(function (i) {
|
||||
$(this).change(function () {
|
||||
$(".status option:selected").eq(i).each(function () {
|
||||
if($(this).attr("value")=="alumna") {
|
||||
$(this).parents(".status").nextAll(".graduated").removeClass("hide");
|
||||
$(this).parents(".status").nextAll(".graduated").find("select").removeAttr("disabled");
|
||||
}else{
|
||||
$(this).parents(".status").nextAll(".graduated").addClass("hide");
|
||||
$(this).parents(".status").nextAll(".graduated").find("select").attr({disabled:''});
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
$('.onoff').live('click',function () {
|
||||
if($(this).parents("h4").length==1) {
|
||||
$(this).parents(".map-block").toggleClass("disabled");
|
||||
$(this).parents(".map-block").find(".form-horizontal").toggleClass("hide");
|
||||
if($(this).parents(".map-block").hasClass("disabled")){
|
||||
$(this).text("OFF");
|
||||
}else{
|
||||
$(this).text("ON");
|
||||
}
|
||||
}
|
||||
if($(this).parents("legend").length==1) {
|
||||
$(this).toggleClass("disabled");
|
||||
$(this).parents("legend").next("div").toggleClass("hide");
|
||||
if($(this).parents("legend").next("div").hasClass("hide")){
|
||||
$(this).text("OFF");
|
||||
$(this).siblings(".attribute_field_disabled").val("true");
|
||||
}else{
|
||||
$(this).text("ON");
|
||||
$(this).siblings(".attribute_field_disabled").val("false");
|
||||
}
|
||||
checkSwitch();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(".dataType").change(function () {
|
||||
$(this).parents("legend").next("div").find("div[class^='type']").addClass("hide");
|
||||
$(this).parents("legend").next("div").find("."+$(this).find("option:selected").attr("ref")).removeClass("hide");
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
|
||||
<%= javascript_include_tag "lib/member/role-forms.js" %>
|
||||
<% end -%>
|
||||
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") , :html => { :class=> "form-horizontal main-forms" } do |f| %>
|
||||
<h3><%= @attribute.title + t(:role)%></h3>
|
||||
<fieldset>
|
||||
|
||||
<div id="attributes-area" class="input-area">
|
||||
|
||||
<%= render :partial=>"attribute_field",:collection=>@attribute.attribute_fields.asc(:_id)%>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="button" class="btn btn-success add-attributes"><%= t(:add_attribute_field) %></button>
|
||||
<%= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= render 'js/support_member_form_js' %>
|
||||
<% end -%>
|
||||
|
||||
@@ -1,60 +1,28 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="subnav">
|
||||
<ul class="breadcrumb">
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active"><%= @attribute.title %></li>
|
||||
</ul>
|
||||
<div id="accordion">
|
||||
<div class="accordion-group filters">
|
||||
<div class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
<th id="sort-name" class="sort span1-2 select active"><span><a href="#">Name<b class="web-symbol"></b></a></span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table main-list member-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<% @attribute_fields_upper_object.each do |attribute| %>
|
||||
<tr class="with_action">
|
||||
<td class="span1-2">
|
||||
<%= attribute.title %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t(:edit), eval("admin_#{@attribute_type}_edit_sub_role_path(attribute)") %></li>
|
||||
<li><%= link_to t(:sub_role_field), eval("admin_#{@attribute_type}_sub_role_field_path(attribute)"), :class => 'edit' %></li>
|
||||
<li><%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :sub_role => {:disabled => true, :id => attribute })"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %></li>
|
||||
<li><%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :sub_role => {:disabled => false, :id => attribute })"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %></li>
|
||||
|
||||
<% if !attribute.is_built_in? %>
|
||||
<li><%= link_to t(:delete_), eval("admin_#{@attribute_type}_path(attribute, :sub_role => {:id => attribute })"), :class => 'delete', :confirm => t('sure?'), :method => :delete %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
<%= stylesheet_link_tag "lib/main-forms.css" %>
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus icon-white"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary pull-right"%>
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||
<li class="active"><%= @attribute.title %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sub_roles_index">
|
||||
<%= render 'sub_role_index' %>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
$("#sub_roles_index").html("<%= j render 'sub_role_index' %>")
|
||||
$.pageslide.close();
|
||||
openSlide();
|
||||
@@ -1,128 +1,41 @@
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
|
||||
<div class="map-block back attributes">
|
||||
<h4><span><%= @attribute.title+ t(:role)%> - <%= @sub_attribute.title %></span></h4>
|
||||
<div id="attribute_field_list">
|
||||
<%= render :partial=>"attribute_field",:collection=>@sub_attribute.attribute_fields%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="add-attributes form-actions pagination-right">
|
||||
<%= link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_role_add_attribute_field_path(@sub_attribute, :sub_role => {:id => @sub_attribute }),:class=>"btn btn-primary",:remote => true%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%#= f.hidden_field :id, :value => params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= hidden_field_tag 'sub_role[id]', params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<% end %>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
<%= stylesheet_link_tag "lib/main-forms.css" %>
|
||||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<script>
|
||||
var CloneTarget ;
|
||||
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
|
||||
<%= javascript_include_tag "lib/member/role-forms.js" %>
|
||||
<% end -%>
|
||||
|
||||
var NewNode;
|
||||
|
||||
$(document).ready(function(){
|
||||
function checkSwitch() {
|
||||
$(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled');
|
||||
}
|
||||
function checkMultipleInput() {
|
||||
$(".multipleInput").each(function() {
|
||||
$(this).find('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
|
||||
});
|
||||
}
|
||||
function removeInput(){
|
||||
$(".removeInput").live('click',function (){
|
||||
$(this).parents(".controls").remove();
|
||||
checkMultipleInput();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
checkSwitch();
|
||||
checkMultipleInput();
|
||||
removeInput();
|
||||
$(".remove_attribute").live('click',function(){
|
||||
$(this).siblings(".attribute_field_to_delete").val("true");
|
||||
$(this).parents(".form-horizontal").fadeOut("slow", function () { $(this).hide(); });
|
||||
});
|
||||
|
||||
$(".help-block a").live('click',function (){
|
||||
CloneTarget = $(this).parents(".controls").prev(".multipleInput").find('.controls:last');
|
||||
NewNode = CloneTarget.clone();
|
||||
var index;
|
||||
NewNode.find("input").each(function(k,v){
|
||||
index = CloneTarget.parents("div.control-group").find(".list_count").val()
|
||||
field_name = CloneTarget.parents("div.control-group").find(".field_name").val()
|
||||
ori_str = $(v).attr("name").replace(field_name,"");
|
||||
lang = ori_str.match(/\[\D*\]/);
|
||||
new_field_name = (field_name+"[" + (parseInt(index)+1) + "]" + lang);
|
||||
$(v).attr("name",new_field_name);
|
||||
})
|
||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") , :html => { :class=> "form-horizontal main-forms" , :id=>'sub_role'} do |f| %>
|
||||
<h3><%= @attribute.title+ t(:role)%> - <%= @sub_attribute.title %></h3>
|
||||
<fieldset>
|
||||
|
||||
<div id="attributes-area" class="input-area">
|
||||
|
||||
<%= render :partial=>"attribute_field",:collection=>@sub_attribute.attribute_fields.asc(:_id)%>
|
||||
|
||||
$(this).parents("div.control-group").find(".list_count").val(parseInt(index)+1)
|
||||
$(this).parents(".controls").prev(".multipleInput").append(NewNode);
|
||||
$(this).parents(".controls").prev(".multipleInput").find('.controls:last input').val("");
|
||||
removeInput();
|
||||
checkMultipleInput();
|
||||
return false;
|
||||
})
|
||||
$(".status select").each(function (i) {
|
||||
$(this).change(function () {
|
||||
$(".status option:selected").eq(i).each(function () {
|
||||
if($(this).attr("value")=="alumna") {
|
||||
$(this).parents(".status").nextAll(".graduated").removeClass("hide");
|
||||
$(this).parents(".status").nextAll(".graduated").find("select").removeAttr("disabled");
|
||||
}else{
|
||||
$(this).parents(".status").nextAll(".graduated").addClass("hide");
|
||||
$(this).parents(".status").nextAll(".graduated").find("select").attr({disabled:''});
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
$('.onoff').live('click',function () {
|
||||
if($(this).parents("h4").length==1) {
|
||||
$(this).parents(".map-block").toggleClass("disabled");
|
||||
$(this).parents(".map-block").find(".form-horizontal").toggleClass("hide");
|
||||
if($(this).parents(".map-block").hasClass("disabled")){
|
||||
$(this).text("OFF");
|
||||
}else{
|
||||
$(this).text("ON");
|
||||
}
|
||||
}
|
||||
if($(this).parents("legend").length==1) {
|
||||
$(this).toggleClass("disabled");
|
||||
$(this).parents("legend").next("div").toggleClass("hide");
|
||||
if($(this).parents("legend").next("div").hasClass("hide")){
|
||||
$(this).text("OFF");
|
||||
$(this).siblings(".attribute_field_disabled").val("true");
|
||||
}else{
|
||||
$(this).text("ON");
|
||||
$(this).siblings(".attribute_field_disabled").val("false");
|
||||
}
|
||||
checkSwitch();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(".dataType").change(function () {
|
||||
$(this).parents("legend").next("div").find("div[class^='type']").addClass("hide");
|
||||
$(this).parents("legend").next("div").find("."+$(this).find("option:selected").attr("ref")).removeClass("hide");
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="button" class="btn btn-success add-attributes"><%= t(:add_attribute_field) %></button>
|
||||
<%= hidden_field_tag 'sub_role[id]', params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= render 'js/support_member_form_js' %>
|
||||
<% end -%>
|
||||
Reference in new issue
Block a user