diff --git a/app/assets/stylesheets/structure.css b/app/assets/stylesheets/structure.css index 1b97b52..b23aa00 100644 --- a/app/assets/stylesheets/structure.css +++ b/app/assets/stylesheets/structure.css @@ -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; } \ No newline at end of file diff --git a/app/views/pages/_member_frontend_field.html.erb b/app/views/pages/_member_frontend_field.html.erb index 7061281..672b9d9 100644 --- a/app/views/pages/_member_frontend_field.html.erb +++ b/app/views/pages/_member_frontend_field.html.erb @@ -5,29 +5,31 @@ -
- - - - - - - Add role -
- +
-
- - Save - Cancel +
+ +
+ + +
+
+ +
+ +
+ + + +
+
+ + Add role +
@@ -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( "" ); 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; - }) - + }) diff --git a/app/views/pages/_modify_member_frontend_fields.html.erb b/app/views/pages/_modify_member_frontend_fields.html.erb index b00ca67..ffe180f 100644 --- a/app/views/pages/_modify_member_frontend_fields.html.erb +++ b/app/views/pages/_modify_member_frontend_fields.html.erb @@ -4,6 +4,43 @@

Modify Fields

- \ No newline at end of file + + + +