一旦组织私有,就disabled掉允许游客下载选项

hjq_dianming_api
ouyangxuhua 10 years ago
parent fbff28d70e
commit 89a919163c

@ -30,14 +30,15 @@
</li>
<li class=" mb5 ml80">
<label >公开&nbsp;&nbsp;</label>
<input id="organization_is_public" name="organization[is_public]" type="checkbox" value="1" checked="checked">
<input id="organization_is_public" name="organization[is_public]" onblur="disable_down($(this), $('#organization_alow_download'), $('#allow_down_hint'));" type="checkbox" value="1" checked="checked">
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)</span>
<div class="cl"></div>
</li>
<li class=" mb5" style="margin-left:40px; ">
<label >允许游客下载:</label>
<input id="organization_alow_download" name="organization[allow_guest_download]" type="checkbox" value="1" checked="checked">
<input id="organization_alow_download" name="organization[allow_guest_download]" type="checkbox" value="1" checked="checked">
<span class="c_grey">(打钩为允许游客下载文件)</span>
<span class="c_green f12" id="allow_down_hint"></span>
<div class="cl"></div>
</li>
<li class=" ml125" >

@ -63,11 +63,12 @@
</div>
<div class="cl"></div>
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span>
<input type="checkbox" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
<input type="checkbox" id="is_public" onblur="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
</div>
<div class="orgRow mb10 mt5"><span style="margin-left:10px;">下载支持&nbsp;: </span>
<input type="checkbox" style="margin-top:5px;" name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
<input id="allow_download" type="checkbox" style="margin-top:5px;" <%= @organization.is_public? ? "":"DISABLED" %> name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
&nbsp;<span>允许游客下载</span>
<span class="c_green f12" id="allow_down_hint"><%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %></span>
</div>
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org(<%=@organization.id %>);">保存</a>
<% end %>
@ -187,4 +188,13 @@
$("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入");
}
}
// $(document).ready(function(){
// if ( $("#is_public").attr("checked") != true){
// alert($(this).attr("checked"));
// $("#allow_download").attr("checked", false);
// $("#allow_download").attr("disabled", true);
// $("#allow_down_hint").html("");
// }
// });
</script>

@ -1135,3 +1135,16 @@ function chooseSendType(res_id,res_ids, user_id, send_type){
}
lastSendType = sendType;
}
function disable_down(source, des, hint){
if (source.attr("checked")){
des.attr("disabled", false);
hint.html("");
}
else{
des.attr("checked", false);
des.attr("disabled", true);
hint.html("(私有组织不允许游客下载资源)");
}
}

Loading…
Cancel
Save