diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 68bcd2b22..6c587645c 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -63,6 +63,7 @@ class OrganizationsController < ApplicationController @organization.description = params[:organization][:description] @organization.is_public = params[:organization][:is_public] @organization.allow_guest_download = params[:organization][:allow_guest_download] == '1' ? 1 : 0 + @organization.show_mode = params[:show_mode] @organization.creator_id = User.current.id member = OrgMember.new(:user_id => User.current.id) @@ -127,6 +128,7 @@ class OrganizationsController < ApplicationController # @organization.domain = params[:organization][:domain] @organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0 @organization.allow_guest_download = params[:organization][:allow_guest_download] == 'on' ? 1 : 0 + @organization.show_mode = params[:show_mode] #@organization.name = params[:organization][:name] @organization.save respond_to do |format| diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb index b0c961d82..efe481b77 100644 --- a/app/views/organizations/new.html.erb +++ b/app/views/organizations/new.html.erb @@ -28,6 +28,13 @@ value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>

+
  • + 显示模式    : + + + + +
  • diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index c0ca2cfe4..39848d192 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -72,6 +72,13 @@
    +
    + 显示模式 : + /> + + /> + +
    公开 : class="ml3" />
    diff --git a/db/migrate/20160328022312_add_coulumn_show_mode_to_organizations.rb b/db/migrate/20160328022312_add_coulumn_show_mode_to_organizations.rb new file mode 100644 index 000000000..11f3fa22e --- /dev/null +++ b/db/migrate/20160328022312_add_coulumn_show_mode_to_organizations.rb @@ -0,0 +1,5 @@ +class AddCoulumnShowModeToOrganizations < ActiveRecord::Migration + def change + add_column :organizations, :show_mode, :integer, :default => 0 + end +end diff --git a/db/migrate/20160328022623_set_show_mode_for_organizations.rb b/db/migrate/20160328022623_set_show_mode_for_organizations.rb new file mode 100644 index 000000000..719dfc1ff --- /dev/null +++ b/db/migrate/20160328022623_set_show_mode_for_organizations.rb @@ -0,0 +1,12 @@ +class SetShowModeForOrganizations < ActiveRecord::Migration + def up + Organization.transaction do + Organization.all.each do |org| + org.update_attribute(:show_mode, 0) + end + end + end + + def down + end +end