forked from saurabh/orbit4-5
47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
<div id="modify_fields_to_show" class="modal hide fade" role="dialog">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h3>Modify Fields</h3>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="preloader-wrap">
|
|
<img src="/assets/preloader.gif" />
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
|
|
<a href="#" id="form_for_attribs_btns" class="btn btn-primary">Save</a>
|
|
<a href="#" class="btn" data-dismiss="modal">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
$("#modify_fields_to_show #form_for_attribs_btns").on("click",function(){
|
|
var data = [];
|
|
$("#form_for_attribs ul.current-roles li").each(function(i){
|
|
var opts = {};
|
|
opts["key"] = $(this).data("attrib-key");
|
|
opts["type"] = $(this).data("attrib-type");
|
|
opts["sort"] = i + 2;
|
|
// opts["human_readable"] = $(this).find("span.role-value").text();
|
|
if($(this).find("input[type=checkbox]").is(":checked")){
|
|
opts["link_to_show"] = true;
|
|
}
|
|
if(opts["key"] == "discipline"){
|
|
opts["max_length"] = 12;
|
|
}
|
|
data.push(opts);
|
|
})
|
|
$.ajax({
|
|
url : "/pages/save_member_frontend_fields",
|
|
data : {"fields" : data, "page_id" : $("#form_for_attribs input[type=hidden]").val()},
|
|
type : "post",
|
|
dataType : "json"
|
|
}).done(function(){
|
|
$("#modify_fields_to_show").modal("hide");
|
|
})
|
|
return false;
|
|
})
|
|
|
|
</script>
|