2012-10-08 08:58:33 +00:00
|
|
|
|
<div class="user-info">
|
|
|
|
|
<div class="user-avatar pull-left">
|
|
|
|
|
<p class="reflective"></p>
|
|
|
|
|
<% if @user.avatar? %>
|
|
|
|
|
<%= image_tag(@user.avatar.thumb.url) %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= image_tag "person.png" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<%= file_field_tag 'file' %>
|
|
|
|
|
<%= hidden_field_tag :avatar_cache %>
|
|
|
|
|
</div>
|
|
|
|
|
<label>
|
|
|
|
|
<%= f.check_box :admin %>
|
2012-10-29 08:10:07 +00:00
|
|
|
|
<span><%= t(:admin) %>:</span>
|
2012-10-08 08:58:33 +00:00
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%= render :partial=>"infos"%>
|
2012-10-24 06:46:25 +00:00
|
|
|
|
<%= render :partial=>"roles"%>
|
2012-10-18 10:36:21 +00:00
|
|
|
|
|
|
|
|
|
<% content_for :page_specific_javascript do -%>
|
2012-10-24 06:46:25 +00:00
|
|
|
|
<script>
|
|
|
|
|
// $('.site-map').masonry({
|
|
|
|
|
// itemSelector: '.map-block',
|
|
|
|
|
// columnWidth: 450,
|
|
|
|
|
// isAnimated: true
|
2012-10-18 10:36:21 +00:00
|
|
|
|
// });
|
2012-10-24 06:46:25 +00:00
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
function subrole_disable_field( triggled_object, switch_value_str){
|
|
|
|
|
var switch_field = triggled_object.attr("for");
|
|
|
|
|
$("input.subrole_disable_field[for="+switch_field+"]").val(switch_value_str)
|
|
|
|
|
}
|
2012-10-18 10:36:21 +00:00
|
|
|
|
|
2012-10-24 06:46:25 +00:00
|
|
|
|
function checkSwitch() {
|
|
|
|
|
$(".groups").each(function() {
|
|
|
|
|
$(this).find('.form-horizontal > .hide').length < $(this).find('.form-horizontal > div').length ? $(this).removeClass("disabled") : $(this).addClass("disabled")
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function checkMultipleInput() {
|
|
|
|
|
$(".multipleInput").each(function() {
|
|
|
|
|
$(this).find('.controls').length==1 ? $(this).addClass("plural") : $(this).removeClass("plural")
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function removeInput(){
|
|
|
|
|
$(".removeInput").click(function (){
|
|
|
|
|
$(this).parents(".controls").remove();
|
|
|
|
|
checkMultipleInput();
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
checkSwitch();
|
|
|
|
|
checkMultipleInput();
|
|
|
|
|
removeInput();
|
|
|
|
|
$(".help-block a").click(function (){
|
|
|
|
|
var $CloneTarget = $(this).parents(".controls").prev(".multipleInput").find('.controls:last');
|
|
|
|
|
$(this).parents(".controls").prev(".multipleInput").append($CloneTarget.clone());
|
|
|
|
|
$(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:''});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
2012-10-18 10:36:21 +00:00
|
|
|
|
})
|
2012-10-24 06:46:25 +00:00
|
|
|
|
$('.onoff').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");
|
|
|
|
|
// console.log("LV1");
|
|
|
|
|
// console.log($(this));
|
|
|
|
|
}else{
|
|
|
|
|
$(this).text("ON");
|
|
|
|
|
// console.log("LV1");
|
|
|
|
|
// console.log($(this));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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");
|
|
|
|
|
console.log("LV2");
|
|
|
|
|
subrole_disable_field($(this),"true");
|
|
|
|
|
}else{
|
|
|
|
|
$(this).text("ON");
|
|
|
|
|
console.log("LV2");
|
|
|
|
|
subrole_disable_field($(this),"false");
|
|
|
|
|
}
|
|
|
|
|
checkSwitch();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
});
|
2012-10-18 10:36:21 +00:00
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<% end -%>
|