diff --git a/app/models/user/user.rb b/app/models/user/user.rb index a2c7e2472..09e2f45a4 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -7,7 +7,7 @@ class User mount_uploader :avatar, AvatarUploader - field :admin, :type => Boolean, :default => true + field :admin, :type => Boolean, :default => false field :active_role field :user_id field :sid diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index ac19b4687..0b93a2b21 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -23,6 +23,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController def index + + email_group_data + # @bulletins = Bulletin.all # @bulletins = Bulletin.desc("postdate desc") get_categorys('BulletinCategory',params[:bulletin_category_id]) @@ -116,6 +119,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # POST /bulletins # POST /bulletins.xml def create + + email_group_data + @tags = get_tags if params[:bulletin_link] @@ -221,6 +227,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController def update + email_group_data + @bulletin = Bulletin.find(params[:id]) # @bulletin.image.clear if params[:bulletin][:image_del] == '1' diff --git a/vendor/built_in_modules/announcement/app/models/bulletin_file.rb b/vendor/built_in_modules/announcement/app/models/bulletin_file.rb index 2912fc976..4540399b4 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin_file.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin_file.rb @@ -11,4 +11,14 @@ class BulletinFile belongs_to :bulletin + validate :check_file_title + + private + + def check_file_title + if self.title.blank? + errors.add( :file, I18n.t("announcement.file_name_not_null")) + end + end + end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index c3694ee31..284bf8276 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -22,7 +22,7 @@ <% end %> -
+