solved conflict for member_new_ui

This commit is contained in:
Spen authored and saurabhbhatia committed 2013-08-12 15:40:34 +08:00
1 parent 9c7558847a
commit 6c514770bc
92 files changed
+3204 -2102

No files matched your search

@@ -0,0 +1,31 @@
<tr id="<%= dom_id attribute %>" class="<%= attribute.disabled ? 'disable' : '' %>">
<td>
<span class="label label-info"><%= attribute.title %></span>
<div class="quick-edit">
<ul class="nav nav-pills">
<li><%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class=>"open-slide" %></li>
<% if @attribute_type == 'role' %>
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
<li><%= link_to t(:status), eval("admin_role_statuses_path(:role_id=>attribute)") %></li>
<li><%= link_to t(:category), eval("admin_role_categorys_path(:role_id=>attribute)") %></li>
<% end %>
<li><%#= link_to attribute.disabled ? t(:disable) : t(:enable) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %></li>
</ul>
</div>
</td>
<td class="action span3">
<div class="toggle-control" style="float: right;">
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %>
<label><b></b></label>
</div>
</div>
<% if !attribute.is_built_in? %>
<%= link_to (content_tag :i,'',:class=>'icon-trash')+t(:delete_), eval("admin_#{@attribute_type}_path(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("#{@attribute_type}") %><b class="icons-arrow-down-4"></b></a></th>
</tr>
</thead>
<tbody>
<%= render partial: 'admin/attributes/attribute', collection: @attributes %>
</tbody>
</table>
@@ -0,0 +1 @@
$("#<%= dom_id @attribute %>").remove();
+71 -155
View File
@@ -1,162 +1,78 @@
<% 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">
<h4><span><%= t(eval(":#{@attribute_type}"))%></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 @attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key%></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[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>
<% if @attribute._type == "Info" %>
<div class="map-block back attributes">
<h4><span><%= @attribute.title+ t(:field)%></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"shared/attribute_field/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_info_add_attribute_field_path(@attribute),:class=>"btn btn-primary",:remote => true )%>
</div>
<% end %>
</div>
<div class="form-actions form-fixed pagination-right">
<%= 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", :id=>'info' } do |f| %>
<h3><%= t(eval(":#{@attribute_type}"))%></h3>
<fieldset>
<div id="basic-area" class="input-area">
<div class="basic">
<div class="attributes-header clearfix">
<h4>Basic</h4>
</div>
<div class="attributes-body">
<div class="control-group">
<label class="control-label muted" for="key_0">Key</label>
<div class="controls">
<% if @attribute.new_record? %>
<%= f.text_field :key, :placeholder => t(:key) %>
<% else %>
<div><%= @attribute.key %></div>
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
<div class="control-group">
<label class="control-label muted" for=""><%= t(:to_search) %></label>
<div class="controls">
<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>
</div>
</div>
</div>
</div>
</fieldset>
<h3><%= @attribute.title %></h3>
<fieldset>
<div id="attributes-area" class="input-area">
<%= render :partial=>"shared/attribute_field/attribute_field",:collection=>@attribute.attribute_fields%>
</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 -%>
+18 -53
View File
@@ -1,60 +1,25 @@
<% 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 %>
<% 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="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i,t("new.#{@attribute_type}"),:class=>"icon-plus"),eval("new_admin_#{@attribute_type}_path"),:class=>"btn btn-primary open-slide"%>
</div>
</div>
<div class="subnav">
<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="#"><%= t("#{@attribute_type}") %><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>
<% @attributes.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("edit_admin_#{@attribute_type}_path(attribute)") %></li>
<% if @attribute_type == 'role' %>
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
<li><%= link_to t(:status), eval("admin_role_statuses_path(:role_id=>attribute)") %></li>
<li><%= link_to t(:category), eval("admin_role_categorys_path(:role_id=>attribute)") %></li>
<% end %>
<li><%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :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, :#{@attribute_type} => {:disabled => false})"), :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)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %></li>
<% end %>
</ul>
</div>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i,t("new.#{@attribute_type}"),:class=>"icon-plus icon-white"),eval("new_admin_#{@attribute_type}_path"),:class=>"btn btn-primary pull-right"%>
<div id="attributes_index">
<%= render 'admin/attributes/index' %>
</div>
<%#= link_to content_tag(:i, nil, class: "icon-edit"), eval("edit_admin_#{node.class.to_s.downcase}_path(node)"), class: "open-slide tip", title: t(:edit) %>
<%#= link_to content_tag(:i, nil, class: "icons-newspaper"), new_admin_page_path(:parent_id => node.id), class: "open-slide tip", title: t(:add_page) if node.class.to_s.eql?('Page') %>
<%#= javascript_include_tag "lib/jquery.pageslide.js" %>
+3
View File
@@ -0,0 +1,3 @@
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
$.pageslide.close();
openSlide();
+10 -3
View File
@@ -10,11 +10,11 @@
<div class="controls">
<label class="radio inline">
<%= f.radio_button :to_search, true %>
Yes
<%= t(:yes_)%>
</label>
<label class="radio inline">
<%= f.radio_button :to_search, false %>
No
<%= t(:no_)%>
</label>
</div>
</div>
@@ -29,7 +29,14 @@
<% end %>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
<% @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 %>
<%#= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
</div>
</div>
</div>