From 89a919163c58a751f13d07cdb47ae14574fd1d02 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 26 Jan 2016 15:25:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E6=97=A6=E7=BB=84=E7=BB=87=E7=A7=81?= =?UTF-8?q?=E6=9C=89=EF=BC=8C=E5=B0=B1disabled=E6=8E=89=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E6=B8=B8=E5=AE=A2=E4=B8=8B=E8=BD=BD=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/new.html.erb | 5 +++-- app/views/organizations/setting.html.erb | 14 ++++++++++++-- public/javascripts/application.js | 13 +++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb index ea7fbbb30..e12bf3849 100644 --- a/app/views/organizations/new.html.erb +++ b/app/views/organizations/new.html.erb @@ -30,14 +30,15 @@
  • - + (打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)
  • - + (打钩为允许游客下载文件) +
  • diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 9ec118bec..b9b2f9b4c 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -63,11 +63,12 @@
    公开 : - class="ml3" /> + class="ml3" />
    下载支持 : - class="ml3" /> + name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />  允许游客下载 + <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
    保存 <% 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(""); +// } +// }); \ No newline at end of file diff --git a/public/javascripts/application.js b/public/javascripts/application.js index f982d92f6..8fba6770a 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -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("(私有组织不允许游客下载资源)"); + + } +}