From 4120be6f8ef05d87fd969e6d8ccbb27f8d14c073 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Mon, 14 Oct 2013 16:47:34 +0800 Subject: [PATCH] fixes in sitemap, site preference --- Gemfile | 3 ++- app/controllers/pages_controller.rb | 2 +- app/models/site.rb | 2 +- app/views/admin/sites/preference.html.erb | 6 ++--- app/views/admin/sites/sitemap.html.erb | 27 ++++++++++------------- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index 38a925823..ceece7b65 100644 --- a/Gemfile +++ b/Gemfile @@ -97,7 +97,8 @@ group :test, :development do gem "watchr" gem "spork" gem "capybara" - gem 'rack-mini-profiler' + #gem 'rack-mini-profiler' + gem "better_errors" # gem 'yard' # gem "bluecloth" end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 69a011d99..ec1008715 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -114,7 +114,7 @@ class PagesController < ApplicationController end def check_frontend_open - if !Site.first.frontend_closed && current_user.nil? #Need to be change + if Site.first.frontend_open && current_user.nil? #Need to be change redirect_to '/admin/dashboards' end end diff --git a/app/models/site.rb b/app/models/site.rb index ccaab8403..68fe40a44 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -12,7 +12,7 @@ class Site field :private_key, :type => Binary field :public_key, :type => Binary - field :frontend_closed, :type => Boolean, :default => false + field :frontend_open, :type => Boolean, :default => true field :backend_openness_on, :type => Boolean, :default => false field :desktop_closed, :type => Boolean, :default => false field :sitemap_menu_in_header, :type => Boolean, :default => false diff --git a/app/views/admin/sites/preference.html.erb b/app/views/admin/sites/preference.html.erb index 4115e2ec3..61b802f88 100644 --- a/app/views/admin/sites/preference.html.erb +++ b/app/views/admin/sites/preference.html.erb @@ -114,10 +114,10 @@
- +
- <%= f.check_box :frontend_closed , :class=>"toggle-check"%> - Only can be viewed by users logged in + <%= f.check_box :frontend_open , :class=>"toggle-check"%> + If Checked, the frontend will be open for all users.
diff --git a/app/views/admin/sites/sitemap.html.erb b/app/views/admin/sites/sitemap.html.erb index 4adf90e09..98e87a477 100644 --- a/app/views/admin/sites/sitemap.html.erb +++ b/app/views/admin/sites/sitemap.html.erb @@ -12,32 +12,29 @@ <% content_for :side_bar do %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %> <% end %> - -

Sitemap

-
- + <% @site_valid_locales.each_with_index do |locale, i| %> +
  • > + + <%= I18nVariable.from_locale(locale) %> + +
  • + <% end %> + +
    - <% @site_valid_locales.each_with_index do |temp_locale, i| %> -
      +
        "> <%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
      <% end %> -
    +
    -
    -
    - +
    <% content_for :page_specific_javascript do %>