From 9e4686a5652dbabf08778502339216b586f62c9f Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Mon, 2 Sep 2013 11:20:39 +0800 Subject: [PATCH] Fixed Site Info completely and added search engine page --- app/controllers/admin/sites_controller.rb | 5 + app/views/admin/items/_site_bar.html.erb | 3 +- app/views/admin/sites/_side_bar.html.erb | 3 +- app/views/admin/sites/search_engine.html.erb | 119 ++++++++++++ app/views/admin/sites/site_info.html.erb | 186 ++----------------- config/routes.rb | 1 + 6 files changed, 147 insertions(+), 170 deletions(-) create mode 100644 app/views/admin/sites/search_engine.html.erb diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index e81965d0..651d8bb3 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -55,6 +55,11 @@ class Admin::SitesController < OrbitBackendController end + def search_engine + + end + + def ui_theme end diff --git a/app/views/admin/items/_site_bar.html.erb b/app/views/admin/items/_site_bar.html.erb index c9de06cc..92033e0e 100644 --- a/app/views/admin/items/_site_bar.html.erb +++ b/app/views/admin/items/_site_bar.html.erb @@ -25,7 +25,8 @@
  • <%= link_to admin_site_site_info_path(@site), :class => active_for_action('sites', 'site_info') do %><%end%>
  • -
  • +
  • <%= link_to admin_site_search_engine_path(@site), :class => active_for_action('sites', 'site_info') do %><%end%>
  • +
  • diff --git a/app/views/admin/sites/_side_bar.html.erb b/app/views/admin/sites/_side_bar.html.erb index c9de06cc..92033e0e 100644 --- a/app/views/admin/sites/_side_bar.html.erb +++ b/app/views/admin/sites/_side_bar.html.erb @@ -25,7 +25,8 @@
  • <%= link_to admin_site_site_info_path(@site), :class => active_for_action('sites', 'site_info') do %><%end%>
  • -
  • +
  • <%= link_to admin_site_search_engine_path(@site), :class => active_for_action('sites', 'site_info') do %><%end%>
  • +
  • diff --git a/app/views/admin/sites/search_engine.html.erb b/app/views/admin/sites/search_engine.html.erb new file mode 100644 index 00000000..7a7f1cdc --- /dev/null +++ b/app/views/admin/sites/search_engine.html.erb @@ -0,0 +1,119 @@ +<% # encoding: utf-8 %> + +<% 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 %> + + + <%= stylesheet_link_tag "lib/wrap-nav"%> + <%= stylesheet_link_tag "lib/main-forms"%> + <%= stylesheet_link_tag "lib/togglebox"%> + + <%= javascript_include_tag 'lib/ckeditor/ckeditor' %> + <%= javascript_include_tag 'lib/ckeditor/replace/site_info' %> + <%= javascript_include_tag 'lib/site_set' %> + + + <%= form_for @site, :url => admin_site_path(@site), :html => {:class => "form-horizontal main-forms"} do |f| %> + +
    + +
    + + + + + + +
    + + <% @site_valid_locales.each do |locale|%> + <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> +
    + +
    + <%= f.fields_for :title_translations do |f| %> + <%= f.text_field locale, :class => "input-xxlarge", :value => (@site.title_translations[locale] rescue nil) %> + <% end %> +
    +
    + <% end %> + <% end %> + + +
    + +
    + <%= f.check_box :title_always_on, :class => "toggle-check" %> +
    +
    + +
    + + + <% @site_valid_locales.each do |locale|%> + <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> + +
    +
    + <%= f.fields_for :sub_menu_translations do |f| %> + <%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.sub_menu_translations[locale] rescue nil) %> + <% end %> +
    +
    + <%end%> + <%end%> + + +
    + +
    + +
    +
    + +
    + + +
    + +
    + +
    +
    + + +
    + <% @site_valid_locales.each do |locale|%> + <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> + +
    +
    + <%= f.fields_for :terms_of_user_translations do |f| %> + <%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.terms_of_user_translations[locale] rescue nil) %> + <% end %> +
    +
    +
    + <%end%> + <%end%> + +
    + +
    + <%= f.submit t("submit"), :class => "btn btn-primary" %> + <%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %> +
    + +
    + +
    + <% end %> \ No newline at end of file diff --git a/app/views/admin/sites/site_info.html.erb b/app/views/admin/sites/site_info.html.erb index 9505896a..7a7f1cdc 100644 --- a/app/views/admin/sites/site_info.html.erb +++ b/app/views/admin/sites/site_info.html.erb @@ -14,9 +14,6 @@ <%= javascript_include_tag 'lib/site_set' %> -
    -
    - <%= form_for @site, :url => admin_site_path(@site), :html => {:class => "form-horizontal main-forms"} do |f| %>
    @@ -60,7 +57,8 @@
    -
    + <% @site_valid_locales.each do |locale|%> + <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
    @@ -68,8 +66,9 @@ <%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.sub_menu_translations[locale] rescue nil) %> <% end %>
    -
    -
    +
    + <%end%> + <%end%>
    @@ -82,27 +81,6 @@
    - -
    - -
    -
    - -
    -
    -
    - - -
    - -
    - -
    -
    - -
    -
    + <%end%> + <%end%>
    - - + +
    + <%= f.submit t("submit"), :class => "btn btn-primary" %> + <%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
    - - - - -
    - <%= f.submit t("submit"), :class => "btn btn-primary" %> - <%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
    - <% end %> - - -
    - - -
    - <%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %> -
    -
    - -
    -
    -
    - -
    -
    - <% @site_valid_locales.each do |locale|%> - <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> -
    - -
    - <%= f.fields_for :title_translations do |f| %> - <%= f.text_field locale, :class => "input-xxlarge", :value => (@site.title_translations[locale] rescue nil) %> - <% end %> -

    <%= (t 'site.title_help').html_safe %>

    -
    -
    - <% end %> - <% end %> -
    - -
    - <%= f.check_box :frontend_closed %><%= I18n.t('site.frontend_closed') %>
    - <%= f.check_box :backend_openness_on %><%= I18n.t('site.backend_openness_on') %> -

    <%= (t 'site.search_help').html_safe %>

    -
    -
    -
    - -
    - <%= text_field_tag 'site[search][domains]',(@site.search["domains"] rescue nil), {:class => "input-xxlarge" ,:placeholder => t("search.domains") }%> - <%= text_field_tag 'site[search][sitesearch]',(@site.search["sitesearch"] rescue nil),{ :class => "input-xxlarge" ,:placeholder => t("search.sitesearch") }%> -

    <%= (t 'site.search_help').html_safe %>

    -
    -
    - - <% @site_valid_locales.each do |locale|%> - <%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %> -
    - -
    - <%= f.fields_for :keywords do |f| %> - <%= f.text_area locale, :class => "input-xxlarge textarea-height-s", :value => (@site.keywords(locale) rescue nil) %> - <% end %> -

    <%= (t 'site.keywords_help').html_safe %>

    -
    -
    -
    - -
    - <%= f.fields_for :description do |f| %> - <%= f.text_area locale, :class => "input-xxlarge textarea-height-s", :value => (@site.description(locale) rescue nil) %> - <% end %> -

    <%= (t 'site.description_help').html_safe %>

    -
    -
    -
    - -
    - <%= f.fields_for :sub_menu_translations do |f| %> - <%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.sub_menu_translations[locale] rescue nil) %> - <% end %> -
    -
    -
    - -
    - <%= f.fields_for :footer_translations do |f| %> - <%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.footer_translations[locale] rescue nil) %> - <% end %> -

    <%= (t 'site.footer_help').html_safe %>

    -
    -
    -
    - -
    - <%= f.file_field :default_image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %> - - - <% if @site.default_image %> - <%= image_tag( @site.default_image, :size=>"120x120") rescue ''%> - <% else %> - - <% end %> -
    - <% if @site.default_image.file %> - - <% end %> -
    -
    - <% end %> - <% end %> -
    - -
    - -
    -
    -
    -
    -
    -
    - <%= f.submit t("submit"), :class => "btn btn-primary" %> - <%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %> -
    - <% end %> -
    + <% end %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 91c41a61..01fb03fe 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -190,6 +190,7 @@ Orbit::Application.routes.draw do resources :sites do get 'mail_setting' get 'site_info' + get 'search_engine' get 'sitemap' get 'sitemap_frontend' get 'sitemap_toggle', :on => :member