Added Enable and disable terms of use, sitemap
This commit is contained in:
1 parent
5c8a57e700
commit
55fa1cef4f
11 files changed
+84
-26
No files matched your search
@@ -12,7 +12,16 @@ class FrontController < ApplicationController
|
||||
end
|
||||
|
||||
def show_footer
|
||||
render :text => @site.footer
|
||||
@page = Page.find(:all, :conditions => {:name => /terms/i})
|
||||
@name = @page.first.name
|
||||
@url = "/#{@name}"
|
||||
|
||||
if @site.enable_terms_of_use
|
||||
render :text => (@site.footer + "<a href='#{@url}'>Terms of Use</a>")
|
||||
else
|
||||
render :text => @site.footer
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def show_menu
|
||||
@@ -21,7 +30,15 @@ class FrontController < ApplicationController
|
||||
end
|
||||
|
||||
def show_site_sub_menu
|
||||
render :text => @site.sub_menu
|
||||
@page = Page.find(:all, :conditions => {:name => /sitemap/i})
|
||||
@name = @page.first.name
|
||||
@url = "/#{@name}"
|
||||
|
||||
if @site.sitemap_menu_in_header
|
||||
render :text => (@site.sub_menu + "<a href='#{@url}'>Sitemap</a>")
|
||||
else
|
||||
render :text => @site.sub_menu
|
||||
end
|
||||
end
|
||||
|
||||
def show_sitemap
|
||||
@@ -43,6 +60,11 @@ class FrontController < ApplicationController
|
||||
@tags = module_app.sorted_tags_for_cloud
|
||||
end
|
||||
|
||||
def show_terms_of_use
|
||||
@site = Site.first rescue nil
|
||||
@terms = @site.terms_of_use
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def menu_level(page, current_page, current, menu)
|
||||
|
||||
@@ -9,7 +9,7 @@ class PagesController < ApplicationController
|
||||
|
||||
if @item
|
||||
delayed_impressionist(@item)
|
||||
render_page
|
||||
render_page
|
||||
else
|
||||
redirect_to '/admin/dashboards',:notice=>t(:need_home)
|
||||
# render :text => t(:need_home)
|
||||
@@ -19,6 +19,7 @@ class PagesController < ApplicationController
|
||||
def show
|
||||
#begin
|
||||
@item = Item.first(:conditions => {:path => params[:page_name]})
|
||||
|
||||
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
|
||||
delayed_impressionist(@item)
|
||||
case @item.class.to_s
|
||||
|
||||
+3
-1
@@ -15,6 +15,8 @@ class Site
|
||||
field :frontend_closed, :type => Boolean, :default => false
|
||||
field :backend_openness_on, :type => Boolean, :default => false
|
||||
field :desktop_closed, :type => Boolean, :default => false
|
||||
field :sitemap_menu_in_header, :type => Boolean, :default => false
|
||||
field :enable_terms_of_use, :type => Boolean, :default => true
|
||||
|
||||
field :title_always_on, :type => Boolean, :default => false
|
||||
field :dashbroad_allow_visitor, :type => Boolean, :default => false
|
||||
@@ -34,7 +36,7 @@ class Site
|
||||
field :title, localize: true
|
||||
field :footer, localize: true
|
||||
field :sub_menu, localize: true
|
||||
field :terms_of_user, localize: true
|
||||
field :terms_of_use, localize: true
|
||||
field :google_analytics
|
||||
field :default_locale
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<%= f.hidden_field :public_r_tag_object_id, :value => @part.page.id %>
|
||||
<%#= f.select :public_r_tag_object_id, options_for_select([t(:horizontal), t(:vertical)], t(:horizontal)) %>
|
||||
<% elsif @r_tag.eql?('sitemap') %>
|
||||
<% elsif @r_tag.eql?('terms_of_use') %>
|
||||
<% elsif @r_tag.eql?('breadcrumb') %>
|
||||
<% else %>
|
||||
<%= f.select :public_r_tag_object_id, options_from_collection_for_select(@tag_objects, :id, :title, :selected => @part.public_r_tag_object_id) %>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
<!-- Always shoe in the title bar -->
|
||||
<div class="control-group">
|
||||
<label class="control-label muted">Always show in the title bar
|
||||
<label class="control-label muted"><%= t :always_display_title %>
|
||||
</label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :title_always_on, :class => "toggle-check" %>
|
||||
@@ -70,12 +70,28 @@
|
||||
<%end%>
|
||||
<%end%>
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- CKeditor Site Footer -->
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
|
||||
<label class="control-label muted"><%= t('site.footer')%></label>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= f.fields_for :footer_translations do |f| %>
|
||||
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.footer_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</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">
|
||||
<%= f.check_box :sitemap_menu_in_header, :class => "toggle-check" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,27 +102,25 @@
|
||||
<label class="control-label muted">Terms of Use
|
||||
</label>
|
||||
<div class="controls">
|
||||
<input type="checkbox" class="toggle-check terms" data-disabled="true" checked="checked">
|
||||
<%= f.check_box :enable_terms_of_use, :class => "toggle-check" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CKeditor Default Terms of Use -->
|
||||
<div class="control-group input-content hide">
|
||||
<!-- CKeditor Site Footer -->
|
||||
<% @site_valid_locales.each do |locale|%>
|
||||
<%= 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>
|
||||
<label class="control-label muted"><%= t('site.default_terms_of_use')%></label>
|
||||
<div class="controls">
|
||||
<div class="textarea">
|
||||
<%= 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) %>
|
||||
<%= f.fields_for :terms_of_use_translations do |f| %>
|
||||
<%= f.text_area locale, :class => "ckeditor input-block-level", :value => (@site.terms_of_use_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%end%>
|
||||
</div>
|
||||
<%end%>
|
||||
<%end%>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- Form Actions -->
|
||||
<div class="form-actions">
|
||||
<%= f.submit t("submit"), :class => "btn btn-primary" %>
|
||||
|
||||
@@ -21,16 +21,17 @@
|
||||
|
||||
<ul id="map-tree-language" class="nav nav-pills">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? " class=active" : '' %>><a data-toggle="tab" href="#<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<li <%= ( i == 0 ) ? " class=active" : '' %>><a data-toggle="tab" href="#<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab-content map-tree-content">
|
||||
<div class="line"></div>
|
||||
|
||||
<% @site_valid_locales.each_with_index do |temp_locale, i| %>
|
||||
<ul id="<%= temp_locale %>" class="map-tree tab-pane fade in active">
|
||||
<ul id="<%= temp_locale %>" class="map-tree tab-pane fade in active">
|
||||
<%= render :partial => 'sitemap_block', :collection => @items, :locals => {:temp_locale => temp_locale} %>
|
||||
</ul>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -61,18 +62,18 @@
|
||||
}
|
||||
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?temp_locale=' + $(this).attr('temp_locale'));
|
||||
});
|
||||
$(document).on('click', 'h4 .onoff', function () {
|
||||
$(document).on('click', 'h6 .onoff', function () {
|
||||
$(this).parents(".map-block").toggleClass("disabled");
|
||||
if($(this).parents("h4").parents("li").attr("class").indexOf("disabled") > 0){
|
||||
if($(this).parents("h6").parents("li").attr("class").indexOf("disabled") > 0){
|
||||
$(this).text("<%= t('off_upcase') %>")
|
||||
$(this).parents(".map-block").find('li').addClass('disabled')
|
||||
$(this).parents(".map-block").find('button').text("<%= t('off_upcase') %>")
|
||||
$(this).parents(".map-block").find('li button').attr('disabled', 'disabled')
|
||||
$(this).parents(".map-block").find('checkbox').text("<%= t('off_upcase') %>")
|
||||
// $(this).parents(".map-block").find('li checkbox').attr('disabled', 'disabled')
|
||||
} else {
|
||||
$(this).text("<%= t('on_upcase') %>")
|
||||
$(this).parents(".map-block").find('li').removeClass('disabled')
|
||||
$(this).parents(".map-block").find('button').text("<%= t('on_upcase') %>")
|
||||
$(this).parents(".map-block").find('li button').removeAttr("disabled")
|
||||
$(this).parents(".map-block").find('checkbox').text("<%= t('on_upcase') %>")
|
||||
// $(this).parents(".map-block").find('li checkbox').removeAttr("disabled")
|
||||
}
|
||||
$.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle?parent=true&temp_locale=' + $(this).attr('temp_locale'));
|
||||
});
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<%= @terms.html_safe %>
|
||||
Reference in new issue
Block a user