forked from saurabh/orbit4-5
Merge branch 'master' of gitlab.tp.rulingcom.com:saurabh/orbit4-5 into nccu
This commit is contained in:
commit
7210f46f35
|
@ -8,6 +8,10 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
#form_for_attribs {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.current-roles {
|
||||
list-style: none;
|
||||
margin: 0 0 20px 0;
|
||||
|
@ -18,8 +22,10 @@
|
|||
margin-bottom: 8px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eee;
|
||||
background: #fff;
|
||||
-webkit-box-shadow: 0 0 2px 0 rgba(0,0,0,.2);
|
||||
box-shadow: 0 0 2px 0 rgba(0,0,0,.2);
|
||||
cursor: move;
|
||||
}
|
||||
.role-value {
|
||||
display: inline-block;
|
||||
|
@ -37,8 +43,19 @@
|
|||
.remove-role:hover {
|
||||
color: #ff4444;
|
||||
}
|
||||
.attr.control-label {
|
||||
text-align: left;
|
||||
width: 120px;
|
||||
}
|
||||
.attr.controls {
|
||||
margin-left: 100px;
|
||||
}
|
||||
|
||||
.link-to-show {
|
||||
float: right;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.preloader-wrap {
|
||||
text-align: center;
|
||||
}
|
|
@ -5,29 +5,31 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="form-inline controls-row">
|
||||
<label>Attribute Type: </label>
|
||||
<select class="role-selector" id="type_selector" style="width:100px;">
|
||||
|
||||
</select>
|
||||
<label> Attribute: </label>
|
||||
<select class="role-selector attrb-selector" id="profile_selector">
|
||||
|
||||
</select>
|
||||
<select class="role-selector hide attrb-selector" id="custom_selector">
|
||||
|
||||
</select>
|
||||
<select class="role-selector hide attrb-selector" id="role_selector">
|
||||
|
||||
</select>
|
||||
<a href="#" class="add-role btn btn-default">Add role</a>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal controls-row">
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="hidden" value="<%= @page_id %>">
|
||||
<a href="#" id="form_for_attribs_btns" class="btn btn-primary">Save</a>
|
||||
<a href="#" class="btn" data-dismiss="modal">Cancel</a>
|
||||
<div class="attr-type-wrap control-group">
|
||||
<label class="attr control-label">Attribute Type: </label>
|
||||
<div class="attr controls">
|
||||
<select class="role-selector" id="type_selector">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="attr-wrap control-group">
|
||||
<label class="attr control-label"> Attribute: </label>
|
||||
<div class="attr controls">
|
||||
<select class="role-selector attrb-selector" id="profile_selector">
|
||||
</select>
|
||||
<select class="role-selector hide attrb-selector" id="custom_selector">
|
||||
</select>
|
||||
<select class="role-selector hide attrb-selector" id="role_selector">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="#" class="add-role btn btn-info">Add role</a>
|
||||
<input type="hidden" value="<%= @page_id %>">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
@ -92,7 +94,6 @@
|
|||
// Remove the select role and append it back to select element
|
||||
function removeRole( e ) {
|
||||
var el = $( this ).closest( "li" ).remove();
|
||||
$( "select" ).append( "<option>" + el.find( ".role-value" ).text() + "</option>" );
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
@ -101,33 +102,7 @@
|
|||
$( ".current-roles" ).on( "click", ".remove-role", removeRole );
|
||||
$("#form_for_attribs ul.current-roles").sortable();
|
||||
|
||||
$("#form_for_attribs #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;
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,43 @@
|
|||
<h3>Modify Fields</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<img src="/assets/preloader.gif" />
|
||||
<div class="preloader-wrap">
|
||||
<img src="/assets/preloader.gif" />
|
||||
</div>
|
||||
</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>
|
||||
|
|
Loading…
Reference in New Issue