Updated fixes for site info - desktop openess, title always displayed

This commit is contained in:
saurabhbhatia 2013-10-16 18:33:57 +08:00
parent 2bcecc322e
commit 155039ac16
10 changed files with 28 additions and 35 deletions

View File

@ -60,7 +60,7 @@ class Admin::SitesController < OrbitBackendController
end
def preference
end

View File

@ -140,7 +140,9 @@ class ApplicationController < ActionController::Base
# update session if passed
session[:locale] = params[:locale] if params[:locale]
browser_locale = condition = nil
default_locale = @site.default_locale if @site.default_locale.present?
# check if locale is valid for non site pages
if LIST[:forbidden_item_names].include?(env['PATH_INFO'].split('/')[1].to_s)
condition = VALID_LOCALES.include?(session[:locale])
elsif session[:locale]
@ -152,7 +154,7 @@ class ApplicationController < ActionController::Base
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
condition = @site.in_use_locales.include?(browser_locale)
end
session[:locale] = condition ? (default_locale || browser_locale || session[:locale]) : I18n.default_locale.to_s
session[:locale] = condition ? ( browser_locale || session[:locale] || default_locale) : I18n.default_locale.to_s
I18n.locale = session[:locale].to_sym
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
@site_valid_locales = site_locales_default_head(@site.valid_locales)

View File

@ -340,10 +340,11 @@ class DesktopController< ApplicationController
render :json=>b.to_json
end
private
protected
def check_desktop_open
if Me.desktop_closed && current_user.nil? #Need to be change
@site = Site.first
if @site.desktop_closed #Need to be change
redirect_to '/admin/dashboards'
end
end

View File

@ -180,7 +180,7 @@ module ApplicationHelper
page_title = page.page_title ? page.page_title : page.title
if page.root? && @site.title
res << @site.title
elsif @site.title && @site.title_always_on
elsif @site.title && !@site.title_always_on
res << @site.title + ' - ' + page_title
else
res << page_title

View File

@ -21,7 +21,6 @@ class Site
field :title_always_on, :type => Boolean, :default => false
field :dashbroad_allow_visitor, :type => Boolean, :default => false
field :mail_settings, :type => Hash
field :enabled_for, :type => Array, :default => nil
field :disk_space, :type => String
field :system_package_info, :type => Hash,:default=>{}
@ -30,6 +29,7 @@ class Site
field :department
mount_uploader :default_image, ImageUploader
mount_uploader :favicon, ImageUploader
field :search,:type => Hash
field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit']

View File

@ -1,3 +1,4 @@
<%= Rails.logger.info"@@@@@@@@@@@@@@@@"+design.inspect%>
<tr class="with_action">
<td class="span1"><%= check_box_tag 'to_delete[]', design.id, false, :class => "checkbox_in_list" %></td>
<td class="span2">

View File

@ -5,7 +5,7 @@
</h6>
<ul>
<% sitemap_block.children.each_with_index do |child, i| %>
<li "clear <%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
<li class="<%= 'disabled' if !child.show_in_sitemap_for(temp_locale) %>">
<h6>
<input type="checkbox" id="<%= child.id %>" class="toggle-check onoff" temp_locale="<%= temp_locale %>" data-deploy="right">
<span><%= "#{sitemap_block_counter + 1}-#{i + 1}" %> <%= child.title_translations[temp_locale] %></span>

View File

@ -146,6 +146,8 @@
<div class="control-group">
<label class="control-label muted">Default Language</label>
<div class="controls">
<%= @site_in_use_locales %>
<% @site_in_use_locales.each do |locale| %>
<%= check_box_tag :default_locale, locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
<%= I18nVariable.from_locale(locale) %>
@ -156,10 +158,9 @@
<label class="control-label muted">Enable Language</label>
<div class="controls">
<% @site_valid_locales.each do |valid_locale| %>
<%= check_box_tag 'site[enabled_for][]', valid_locale, (@site.enabled_for.nil?), :class=>"toggle-check" %>
<%= I18nVariable.from_locale(valid_locale) %>
<% end %>
<%= hidden_field_tag 'site[enabled_for][]', '' %>
<%= check_box_tag "site[in_use_locales][]", locale, @site.valid_locales.include?(locale), :class=>"toggle-check" %>
<%= I18nVariable.from_locale(valid_locale) %>
<% end %>
</div>
</div>
@ -173,7 +174,7 @@
<!-- if this page editing please add class "fileupload-edit" -->
<div class="fileupload fileupload-new clearfix" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if @site.default_image %>
<% if @site.default_image %>
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
<% else %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
@ -188,16 +189,7 @@
<%end%>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Cancel</a>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
<% if @site.default_image.file.present? %>
<label class="checkbox">
<%= check_box_tag 'site[remove_default_image]' %>
<%= t(:delete_) %>
</label>
<% end %>
</label>
</div>
</div>
</div>
</div>
@ -205,6 +197,7 @@
</div>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">

View File

@ -55,7 +55,6 @@
</div>
<hr>
<!-- CKeditor Site Header -->
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
@ -70,6 +69,15 @@
<%end%>
<%end%>
<!-- Sitemap menu in Header -->
<div class="control-group">
<label class="control-label muted">Sitemap menu in header
</label>
<div class="controls">
<%= f.check_box :sitemap_menu_in_header, :class => "toggle-check" %>
</div>
</div>
<hr>
<!-- CKeditor Site Footer -->
@ -85,16 +93,6 @@
</div>
<%end%>
<%end%>
<!-- Sitemap menu in Header -->
<div class="control-group">
<label class="control-label muted">Sitemap menu in header
</label>
<div class="controls">
<%= f.check_box :sitemap_menu_in_header, :class => "toggle-check" %>
</div>
</div>
<hr>
<!-- Terms of Use -->

View File

@ -12,8 +12,6 @@
<% 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 %>
<h3>Sitemap</h3>
<div id="sitemap">
<ul id="map-tree-language" class="nav nav-pills">
<% @site_valid_locales.each_with_index do |locale, i| %>