Compare commits

..
9 changed files with 39 additions and 27 deletions

No files matched your search

+5 -5
View File
@@ -153,15 +153,15 @@ class ApplicationController < ActionController::Base
if LIST[:forbidden_item_names].include?(env['PATH_INFO'].split('/')[1].to_s)
condition = VALID_LOCALES.include?(session[:locale])
#check if the default locale is present or not
elsif session[:locale]
condition = @site.in_use_locales.include?(session[:locale])
elsif params[:locale]
condition = @site.in_use_locales.include?(params[:locale])
elsif @site.default_locale.present?
default_locale = @site.default_locale
condition = @site.in_use_locales.include?(default_locale)
elsif @site.enable_language_detection
#check enable langauge detection
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
condition = @site.in_use_locales.include?(browser_locale)
elsif @site.default_locale.present?
default_locale = @site.default_locale
condition = @site.in_use_locales.include?(default_locale)
end
session[:locale] = condition ? (browser_locale || session[:locale] || default_locale) : I18n.default_locale.to_s
+12 -8
View File
@@ -1,19 +1,23 @@
<% if @menu_page %>
<% if @menu_page.children.present? %>
<div class='category_list'>
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
<ul class='list'>
<% @menu_page.visible_children.each do |child| %>
<% if @menu_page.visible_children.nil?%>
<p>Test</p>
<li class="<%= @page_id.eql?(child.parent.id) ? 'active' : nil %>">
<a href="<%= (child.parent.class.to_s.eql?('Page') ? '/' + child.parent.path : child.parent.url) %>"><%= child.parent.title %></a>
</li>
<% else %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
</li>
<% end %>
<% end %>
</ul>
</div>
<% else %>
<div class='category_list'>
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
<ul class='list'>
<% @menu_page.parent.parent.visible_children.each do |child| %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
</li>
<% end %>
</ul>
</div>
@@ -1,5 +1,5 @@
<%= stylesheet_link_tag "default_widget" %>
<script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.js'></script>
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
<!-- <script type='text/javascript' src='/assets/lib/jquery.mu.image.resize.degsin.js'></script> -->
<div id="bulletin_widget">
@@ -1,6 +1,5 @@
<%= stylesheet_link_tag "default_widget" %>
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
<div id="archive_file_widget">
<%= render 'index' %>
@@ -1,6 +1,5 @@
<%= stylesheet_link_tag "default_widget" %>
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
<%= javascript_include_tag "mobile/jquery.mu.image.resize.js" %>
<div id="archive_file_widget">
<%= render 'index' %>
@@ -107,11 +107,17 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
image.tag_ids.each do |tag|
tags << get_tags.include?(tag)
end
if image.file.theater.present?
@image_file = image.file.theater.url
else
@image_file = image.file.url
end
output << {
image_title: image.title,
image_description: image.description,
image_file: { url: "http://#{request.host_with_port}#{image.file.url}",
image_file: { url: "http://#{request.host_with_port}#{@image_file}",
thumb: "http://#{request.host_with_port}#{image.file.thumb.to_s}"},
image_tag_names: tags}
end
@@ -91,9 +91,10 @@ class WritingBook
title << self.publisher if self.publisher.present?
title << self.isbn if self.isbn.present?
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
title << pd[0]+"/"+pd[1]
if !self.publish_date.nil?
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
title << pd[0]+"/"+pd[1]
end
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
title.join(', ')
@@ -88,9 +88,11 @@ class WritingConference
title << self.authors if self.authors.present?
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
if !self.publication_date.nil?
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
title << pd[0]
end
title << pd[0]
title << self.paper_title if self.paper_title.present?
title << self.conference_title if self.conference_title.present?
title << self.location if self.location.present?
@@ -94,9 +94,10 @@ class WritingJournal
title << self.authors if self.authors.present?
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
title << pd[0]
if !self.publication_date.nil?
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
title << pd[0]
end
title << self.paper_title if self.paper_title.present?
title << self.journal_title if self.journal_title.present?
title << self.vol_no if (self.vol_no.present? && self.vol_no != "0")