From ceeec3af120ca3c69607dad1acbf857a881c3b44 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 8 Jan 2016 19:33:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/views/layouts/base_org.html.erb | 2 +- .../agree_apply_subdomain.js.erb | 2 +- app/views/organizations/setting.html.erb | 2 +- app/views/users/_user_message_org.html.erb | 27 ++++++------------- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 18eb25675..9f80503d8 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -312,7 +312,7 @@ class OrganizationsController < ApplicationController def agree_apply_subdomain @organization = Organization.find(params[:organization_id]) @organization.update_attribute(:domain, params[:org_domain]) - if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=#{params[:org_domain]}").count == 0 + if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=?",params[:org_domain]).count == 0 OrgMessage.create(:user_id => params[:user_id], :organization_id => @organization.id, :message_type => 'AgreeApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain]) end end diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 58dee20b8..2007aec5a 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -163,7 +163,7 @@
diff --git a/app/views/organizations/agree_apply_subdomain.js.erb b/app/views/organizations/agree_apply_subdomain.js.erb index df25d018c..314d48e15 100644 --- a/app/views/organizations/agree_apply_subdomain.js.erb +++ b/app/views/organizations/agree_apply_subdomain.js.erb @@ -1 +1 @@ -$("#agree_apply_subdomain").text("已同意申请"); \ No newline at end of file +$("#agree_apply_subdomain_<%= params[:act_id] %>").text("已同意申请"); \ No newline at end of file diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index bcc0a0c4b..2e9058c40 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -140,7 +140,7 @@ $("#add_subfield_form").submit(); } function apply_subdomain(id, domain){ - var reg = new RegExp("[a-zA-Z0-9_]{1,}"); + var reg = new RegExp("^[a-zA-Z0-9_]{1,}$"); if (reg.exec(domain)){ $.ajax({ url:"<%= apply_subdomain_organization_path %>", diff --git a/app/views/users/_user_message_org.html.erb b/app/views/users/_user_message_org.html.erb index b2801a618..5bf1c8950 100644 --- a/app/views/users/_user_message_org.html.erb +++ b/app/views/users/_user_message_org.html.erb @@ -12,24 +12,13 @@ <%= ma.content %>
  • - <% if ma.status == 0 %> - <%=link_to "同意", agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :message_id => ma.id ), - :id => 'agree_apply_subdomain', - :method => 'post', - :remote => true, - :class => "green_btn_cir ml10", - :style => "color:#fff" %> - <%=link_to "拒绝", agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id,:message_id => ma.id ), - :id => 'agree_apply_subdomain', - :method => 'post', - :remote => true, - :class => "green_btn_cir ml10", - :style => "color:#fff" %> - <% elsif ma.status == 1 %> - 已同意 - <% elsif ma.status == 2 %> - 已拒绝 - <% end %> + <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请", + agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ), + :id => "agree_apply_subdomain_#{ma.id}", + :method => 'post', + :remote => true, + :class => "green_btn_cir ml10", + :style => "color:#fff" %>
  • <%= time_tag(ma.created_at).html_safe %>
  • @@ -40,7 +29,7 @@
  • - '>管理员<%= ma.status == 1 ? '同意':'拒绝' %>了您的子域名申请: + '>管理员同意了您的子域名申请:
  • <%= ma.content %> From 0ac99571ded9953c7a8a8d426d281412f4e53001 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 8 Jan 2016 19:50:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_detail_info.html.erb | 2 +- public/stylesheets/share.css | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/users/_show_detail_info.html.erb b/app/views/users/_show_detail_info.html.erb index ca2bc67db..3849b304c 100644 --- a/app/views/users/_show_detail_info.html.erb +++ b/app/views/users/_show_detail_info.html.erb @@ -5,7 +5,7 @@
    -

    <%= user %>

    +

    <%= user %>

    diff --git a/public/stylesheets/share.css b/public/stylesheets/share.css index 59b3b63f9..ea45a8b41 100644 --- a/public/stylesheets/share.css +++ b/public/stylesheets/share.css @@ -27,5 +27,4 @@ a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; backg .upload_box{ width:430px; margin:15px auto;} a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center; margin-left:10px; margin-bottom:10px; padding:2px 10px;} a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;} -.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} -.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;} \ No newline at end of file +.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} \ No newline at end of file From 5d819625c00f5fa8ec42267c33c59eedc8ed99b5 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 8 Jan 2016 20:09:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E4=BD=BF=E7=94=A8=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E4=B8=8A=E4=BC=A0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 2 +- app/views/files/upload_files_menu.js.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index c6773ef57..bca9de22b 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -826,6 +826,6 @@ class FilesController < ApplicationController end def upload_files_menu - p 1 + end end diff --git a/app/views/files/upload_files_menu.js.erb b/app/views/files/upload_files_menu.js.erb index 3e44f5644..e083fac85 100644 --- a/app/views/files/upload_files_menu.js.erb +++ b/app/views/files/upload_files_menu.js.erb @@ -1,5 +1,5 @@ <% if @project %> - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/upload_project_files_on_navbar',:locals => {:container => @project}) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_project_files',:locals => {:project => @project,:project_attachment_type => 1}) %>'); showModal('ajax-modal', '513px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("");