add new member with role interface. add more not usable.
role management new attribute is ok. delete is ok.
This commit is contained in:
1 parent
fe0e49c3e9
commit
beb843f75b
25 files changed
+1159
-512
No files matched your search
@@ -1,14 +1,139 @@
|
||||
<% content_for :secondary do %>
|
||||
<%= render 'admin/users/side_bar' %>
|
||||
<%= form_for @attribute,:url => admin_info_path(@attribute) ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
<div class="map-block back">
|
||||
<h4><span><%= t("admin.info")%></span></h4>
|
||||
<div class="form-horizontal">
|
||||
<div class="clear">
|
||||
<div class="control-group pull-left">
|
||||
<label class="control-label" for="key"><%= t("admin.key") %></label>
|
||||
<div class="controls">
|
||||
<% if @attribute.new_record? %>
|
||||
<%= f.text_field :key,:placeholder=>"Key" %>
|
||||
<% else %>
|
||||
<div><%= @attribute.key%></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial=>"placeholder_block",:locals=>{:value=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t("admin.infos.item_name"),:field_name=>"info[title_translations]"}%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="map-block back attributes">
|
||||
<h4><span><%= t("admin.attributes")%></span></h4>
|
||||
<%= render :partial=>"attribute_field",:collection=>@attribute.attribute_fields%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i,t("admin.infos.add_attribute_field"),:class=>"icon-plus icon-white"),admin_info_add_attribute_field_path(@attribute),:class=>"btn btn-primary",:remote => true%>
|
||||
<%= f.submit t("admin.infos.save"),:class=>"btn btn-primary"%>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<% end %>
|
||||
|
||||
<div id="profile">
|
||||
<%= form_for @attribute, :url => eval("admin_#{@attribute_type}_path(@attribute)") do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => "admin/#{@attribute_type}s/form", :locals => { :f => f, :is_new => false } %>
|
||||
<div class='button_bar'>
|
||||
<%= link_back %>
|
||||
<%= link_to t('update'), "#", :onclick=>"$('#edit_#{@attribute_type}_#{@attribute.id}').submit()" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<script>
|
||||
var CloneTarget ;
|
||||
|
||||
var NewNode;
|
||||
|
||||
$(document).ready(function(){
|
||||
// function mas(){
|
||||
// $('.site-map').masonry({
|
||||
// itemSelector: '.map-block',
|
||||
// columnWidth: 450,
|
||||
// isAnimated: true
|
||||
// });
|
||||
// }
|
||||
|
||||
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>
|
||||
<% end -%>
|
||||
Reference in new issue
Block a user