From a82fef3ea2d9600fdbaf2dfde16dbd2ab6b51246 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Thu, 31 Dec 2015 16:08:46 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E6=96=B0?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=E4=B8=8D=E8=83=BD=E8=A2=AB?=
=?UTF-8?q?=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_resources_list.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb
index 621efc902..a0a1377f1 100644
--- a/app/views/users/_resources_list.html.erb
+++ b/app/views/users/_resources_list.html.erb
@@ -7,7 +7,7 @@
<% attachments.each do |attach| %>
<% end %>
@@ -27,7 +27,7 @@
新增
<%= field.field_type == "Post" ? "帖子" : "资源" %>
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
- <%= field.hide==0?"设为隐藏":"设为显示" %>
+ <%= field.hide==0?"设为隐藏":"设为可见" %>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
编辑
diff --git a/app/views/organizations/hide_org_subfield.js.erb b/app/views/organizations/hide_org_subfield.js.erb
index 09ed3c280..18241c269 100644
--- a/app/views/organizations/hide_org_subfield.js.erb
+++ b/app/views/organizations/hide_org_subfield.js.erb
@@ -1,2 +1,2 @@
-$("#hide_<%= @org_subfield.id %>").text("设为显示");
+$("#hide_<%= @org_subfield.id %>").text("设为可见");
$("#org_subfield_<%= @org_subfield.id %>").css("display", "none");
\ No newline at end of file
From 527897bff0c8a11bb646816fa170680da96f7acc Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Thu, 31 Dec 2015 16:23:10 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=BB=84=E7=BB=87?=
=?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E6=A0=8F?=
=?UTF-8?q?=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/organization.rb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/models/organization.rb b/app/models/organization.rb
index 350dc3080..fcb777fb6 100644
--- a/app/models/organization.rb
+++ b/app/models/organization.rb
@@ -9,9 +9,15 @@ class Organization < ActiveRecord::Base
has_many :org_subfields, :dependent => :destroy
has_many :users, :through => :org_members
validates_uniqueness_of :name
- after_create :save_as_org_activity
+ after_create :save_as_org_activity, :add_default_subfields
def save_as_org_activity
OrgActivity.create(:user_id => User.current.id, :org_act_id => self.id, :org_act_type => 'CreateOrganization', :container_id => self.id, :container_type => 'Organization')
end
+
+ def add_default_subfields
+ OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default')
+ OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default')
+ OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default')
+ end
end
From b06bd513474f0869713c8138b2f810303ee80c7d Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Thu, 31 Dec 2015 17:06:49 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E5=BA=93=E6=9B=B4=E6=96=B0=E8=B5=84=E6=BA=90=E5=85=AC=E5=BC=80?=
=?UTF-8?q?=E7=A7=81=E6=9C=89=E5=B1=9E=E6=80=A7=E7=9A=84=E6=97=B6=E5=80=99?=
=?UTF-8?q?=20=E9=9C=80=E8=A6=81=E5=8C=BA=E5=88=86=20=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/attachments/update_file_dense.js.erb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/views/attachments/update_file_dense.js.erb b/app/views/attachments/update_file_dense.js.erb
index 110d3fc7c..747024dec 100644
--- a/app/views/attachments/update_file_dense.js.erb
+++ b/app/views/attachments/update_file_dense.js.erb
@@ -1,5 +1,10 @@
+<% if @attachment.container_type == 'Course' %>
$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)),
:remote=>true,:class=>"postOptionLink",:method => :post) %>");
+<%else%>
+$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)),
+ :remote=>true,:class=>"f_l re_open",:method => :post) %>");
+<%end %>
<%if @attachment.is_public? %>
$("#image_private_<%= @attachment.id%>").html('')
<%else%>