Add Preference and search engine

This commit is contained in:
saurabhbhatia 2013-09-02 17:31:34 +08:00
parent 1558cfdb4e
commit 6e032a8757
6 changed files with 81 additions and 102 deletions

View File

@ -59,6 +59,10 @@ class Admin::SitesController < OrbitBackendController
end end
def preference
end
def ui_theme def ui_theme

View File

@ -33,6 +33,7 @@ class Site
field :footer, localize: true field :footer, localize: true
field :sub_menu, localize: true field :sub_menu, localize: true
field :terms_of_user, localize: true field :terms_of_user, localize: true
field :google_analytics
field :mobile_on, :type => Boolean, :default => false field :mobile_on, :type => Boolean, :default => false

View File

@ -1,14 +1,3 @@
<!-- <nav id="sidebar">
<h2 class="position"><a href="#"><i class="icons-flow-tree"></i></a></h2>
<div id="sidebar-menu">
<div class="scroller">
</div>
</div>
<div class="sub-nav-block-list">
</div>
<div class="sub-nav-arrow"></div>
</nav> -->
<nav id="sidebar"> <nav id="sidebar">
<h2 class="position"><a href="#"><i class="icons-cog"></i></a></h2> <h2 class="position"><a href="#"><i class="icons-cog"></i></a></h2>
<div id="sidebar-menu"> <div id="sidebar-menu">
@ -27,7 +16,8 @@
<li title="Search Engine"><%= link_to admin_site_search_engine_path(@site), :class => active_for_action('sites', 'search_engine') do %><span><i class="icons-search"></i></span><%end%></li> <li title="Search Engine"><%= link_to admin_site_search_engine_path(@site), :class => active_for_action('sites', 'search_engine') do %><span><i class="icons-search"></i></span><%end%></li>
<li title="Preference"><a href="/orbit_4.0.1/admin/preference/index.shtml?sidebarNavList=7&amp;subNavBlockList=0"><span><i class="icons-cog"></i></span></a></li> <li title="Preference"><%= link_to admin_site_preference_path(@site), :class => active_for_action('sites', 'preference') do %><span><i class="icons-cog"></i></span><%end%></li>
<li title="System Info"><a href="/orbit_4.0.1/admin/system_info/index.shtml?sidebarNavList=8&amp;subNavBlockList=0"><span><i class="icons-info-2"></i></span></a></li> <li title="System Info"><a href="/orbit_4.0.1/admin/system_info/index.shtml?sidebarNavList=8&amp;subNavBlockList=0"><span><i class="icons-info-2"></i></span></a></li>
</ul> </ul>
</div> </div>

View File

@ -0,0 +1,5 @@
<% 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 %>
system_info.html.erb

View File

@ -17,95 +17,75 @@
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "form-horizontal main-forms"} do |f| %> <%= form_for @site, :url => admin_site_path(@site), :html => {:class => "form-horizontal main-forms"} do |f| %>
<fieldset> <fieldset>
<!-- Input Area --> <!-- Input Area -->
<div class="input-area"> <div class="input-area">
<!-- Language Tabs -->
<div class="nav-name"><strong>Language</strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each do |locale|%>
<%#= raise @site_valid_locales.inspect %>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %>
<% end %>
</ul>
<!-- Language --> <!-- Title-->
<div class="tab-content language-area">
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group input-title"> <div class="control-group input-title">
<label class="control-label muted"><%= t 'site.title' %></label> <label class="control-label muted">Google Search Syntax</label>
<div class="controls"> <div class="controls">
<%= f.fields_for :title_translations do |f| %> <%= text_field_tag 'site[search][sitesearch]',(@site.search["sitesearch"] rescue nil),{ :class => "input-block-level" ,:placeholder => t("search.sitesearch") }%>
<%= f.text_field locale, :class => "input-xxlarge", :value => (@site.title_translations[locale] rescue nil) %>
<% end %>
</div> </div>
</div> </div>
<% end %>
<% end %>
<!-- Always shoe in the title bar -->
<div class="control-group">
<label class="control-label muted">Always show in the title bar
</label>
<div class="controls">
<%= f.check_box :title_always_on, :class => "toggle-check" %>
</div>
</div>
<hr>
<!-- CKeditor Site Header --> <!-- CKeditor Site Header -->
<% @site_valid_locales.each do |locale|%> <div class="control-group input-content">
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> <label class="control-label muted">Google Analytics Code</label>
<label class="control-label muted"><%= t('site.header')%></label>
<div class="controls"> <div class="controls">
<div class="textarea"> <div class="textarea">
<%= f.fields_for :sub_menu_translations do |f| %> <%= f.text_area :google_analytics, :class => "input-block-level"%>
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.sub_menu_translations[locale] rescue nil) %>
<% end %>
</div> </div>
</div> </div>
<%end%>
<%end%>
<!-- Sitemap menu in Header -->
<div class="control-group">
<label class="control-label muted">Sitemap menu in header
</label>
<div class="controls">
<input type="checkbox" class="toggle-check" data-disabled="true">
</div>
</div> </div>
<hr> <hr>
<!-- Terms of Use -->
<div class="control-group">
<label class="control-label muted">Terms of Use
</label>
<div class="controls">
<input type="checkbox" class="toggle-check terms" data-disabled="true" checked="checked">
</div>
</div>
<!-- CKeditor Default Terms of Use -->
<div class="control-group input-content hide">
<% @site_valid_locales.each do |locale|%> <% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<label class="control-label muted">Default Terms of Use</label> <div class="control-group">
<label class="control-label muted">Site Keywords</label>
<div class="controls"> <div class="controls">
<div class="textarea"> <div class="tab-content textarea-lang">
<%= f.fields_for :terms_of_user_translations do |f| %> <div class="btn-group" data-toggle="buttons-radio">
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.terms_of_user_translations[locale] rescue nil) %> <% @site_valid_locales.each do |locale|%>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => "btn #{(active_when_current_locale_eq locale)}" %>
<% end %> <% end %>
</div> </div>
<div class="tab-pane fade active in" id="keywords_en_0">
<%= f.fields_for :keywords do |f| %>
<%= f.text_area locale, :class => "resizable",:rows=>3, :value => (@site.keywords(locale) rescue nil) %>
<% end %>
</div>
</div>
</div> </div>
</div> </div>
<%end%> <%end%>
<%end%> <%end%>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label muted">Site Description</label>
<div class="controls">
<div class="tab-content textarea-lang">
<div class="btn-group" data-toggle="buttons-radio">
<% @site_valid_locales.each do |locale|%>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => "btn #{(active_when_current_locale_eq locale)}" %>
<% end %>
</div>
<div class="tab-pane fade active in" id="description_en_0">
<%= f.fields_for :description do |f| %>
<%= f.text_area locale, :class => "resizable",:rows=>3, :value => (@site.description(locale) rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<%end%>
<%end%>
</div> </div>
<!-- Form Actions --> <!-- Form Actions -->
<div class="form-actions"> <div class="form-actions">
@ -113,7 +93,5 @@
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %> <%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</div> </div>
</div>
</fieldset> </fieldset>
<% end %> <% end %>

View File

@ -197,6 +197,7 @@ Orbit::Application.routes.draw do
get 'system_info' get 'system_info'
get 'ui_theme' get 'ui_theme'
get 'change_design' get 'change_design'
get 'preference'
end end
resources :tags do resources :tags do