From 9f3042c4fea83b5b741913b6a1380f852acf8199 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Wed, 4 Dec 2013 11:42:39 +0800 Subject: [PATCH] Fix for mailer --- app/controllers/admin/sites_controller.rb | 7 ++++++- app/controllers/admin/users_new_interface_controller.rb | 2 +- app/models/site.rb | 2 +- app/models/user/user.rb | 7 ++----- app/views/admin/sites/responsive_setting.html.erb | 9 +++++---- app/views/mobile/_menu.mobile.erb | 2 ++ .../built_in_modules/announcement/app/models/bulletin.rb | 4 ++++ .../views/panel/video/front_end/channel_videos.html.erb | 8 -------- 8 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 vendor/built_in_modules/video/app/views/panel/video/front_end/channel_videos.html.erb diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 44e4ac77..ecc5535c 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -71,7 +71,12 @@ class Admin::SitesController < OrbitBackendController end def responsive_setting - + @bulletins = Bulletin.all + @bulletin_categories = [] + @bulletins.each do |bulletin| + @bulletin_categories << bulletin.get_bulletin_category + end + @categories = @bulletin_categories end diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index c492083f..fe8ccd87 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -9,7 +9,7 @@ class Admin::UsersNewInterfaceController < OrbitMemberController def registration_approval page_num = params[:page] || 1 - @users = User.approval_pending.page(page_num).per(12).desc("_id") + @users = User.approval_pending.page(page_num).per(12).desc("_id").not_guest_and_approved_user end def approve_registration diff --git a/app/models/site.rb b/app/models/site.rb index e7f8db64..79238d82 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -19,7 +19,7 @@ class Site field :sitemap_menu_in_header, :type => Boolean, :default => false field :enable_terms_of_use, :type => Boolean, :default => false field :enable_language_detection, :type => Boolean, :default => false - field :enable_announcement_mobile, :type => Boolean, :default => false + field :announcement_category, :type => Array field :title_always_on, :type => Boolean, :default => false field :dashbroad_allow_visitor, :type => Boolean, :default => false diff --git a/app/models/user/user.rb b/app/models/user/user.rb index f1d80bb3..222bbb68 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -22,11 +22,6 @@ class User field :cache_dept,type: Hash field :status_record,type: Hash field :approved, type: Boolean, :default => false - field :reset_password_token, :type => String - field :reset_password_sent_at, :type => Time - field :remember_created_at, :type => Time - - attr_accessible :remember_me has_and_belongs_to_many :approving_apps, class_name: 'AuthApproval', inverse_of: 'authorized_users' has_and_belongs_to_many :managing_apps, class_name: 'AuthManager', inverse_of: 'authorized_users' @@ -63,6 +58,8 @@ class User before_save :rebuild_status_record scope :remote_account, where(:nccu_id.ne => nil) scope :not_guest_user, all_of(:name.ne => "guest").and(:approved => true) + scope :not_guest_and_approved_user, all_of(:name.ne => "guest").and(:approved => false) + scope :approval_pending, where(:approved => false) validates :user_id, diff --git a/app/views/admin/sites/responsive_setting.html.erb b/app/views/admin/sites/responsive_setting.html.erb index a9e098f4..02bafcef 100644 --- a/app/views/admin/sites/responsive_setting.html.erb +++ b/app/views/admin/sites/responsive_setting.html.erb @@ -26,13 +26,14 @@ -
+
diff --git a/app/views/mobile/_menu.mobile.erb b/app/views/mobile/_menu.mobile.erb index ec92ea84..57fbf0c6 100644 --- a/app/views/mobile/_menu.mobile.erb +++ b/app/views/mobile/_menu.mobile.erb @@ -1,7 +1,9 @@ \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb index c76371b1..80ab2e0b 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb @@ -67,6 +67,10 @@ class Bulletin self.category.title end + def get_bulletin_category + self.category + end + def share_item Item.first(conditions:{name: 'announcement'}) end diff --git a/vendor/built_in_modules/video/app/views/panel/video/front_end/channel_videos.html.erb b/vendor/built_in_modules/video/app/views/panel/video/front_end/channel_videos.html.erb deleted file mode 100644 index 5be9eba7..00000000 --- a/vendor/built_in_modules/video/app/views/panel/video/front_end/channel_videos.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

Videos

-
    -<% @client_videos.videos.each do |v| %> - <% @video = v.video_id.split(/tag:youtube.com,2008:video:+/).last %> - <% @vd = UnvlogIt.new("https://www.youtube.com/watch?v=#{@video}")%> -
  • <%= @vd.title %> -

    <%= @vd.embed_html(200, 150).html_safe %>
  • - <%end%> \ No newline at end of file