Compare commits

...
11 changed files with 69 additions and 40 deletions

No files matched your search

@@ -107,15 +107,18 @@ $(function() {
}
event.preventDefault();
});
$('#module_widget').on('change', '.checkbox-groups input', function(event) {
var $checked = $(this);
if($checked.attr('type') == 'checkbox') {
if($checked.hasClass('select_all') && $checked.prop('checked')) {
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
} else if($checked.prop('checked') && !$checked.hasClass('lang-enable')) {
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
} else {
if($checked.hasClass('select_all')) {
if($checked.prop('checked')){
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', true);
$checked.closest('.checkbox').siblings('.groups').find("input[type=hidden]").removeAttr('name');
}else{
$checked.closest('.checkbox').siblings('.groups').find('input[type="checkbox"]').prop('checked', false);
$checked.closest('.checkbox').siblings('.groups').find("input[type=hidden]").attr('name', 'page_part['+$checked.closest('.checkbox-groups').data('for')+'][]');
}
} else if($checked.hasClass('lang-enable')) {
if($checked.prop('checked')) {
$checked.closest('.active-link').addClass('active').siblings('active-link').removeClass('active').end().find('.active-mune').slideDown(300);
if(_status) {
@@ -129,6 +132,19 @@ $(function() {
$(this).find('input:eq(0)').prop('checked', true);
})
}
} else {
var checkboxes_size = $checked.closest('.groups').find("input[type=checkbox]").length,
checked_size = $checked.closest('.groups').find("input:checked").length;
if(checkboxes_size == checked_size)
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', true);
else
$checked.closest('.groups').siblings('.checkbox').find('.select_all').prop('checked', false);
if(checked_size == 0)
$checked.closest('.groups').find("input[type=hidden]").attr('name', 'page['+$checked.closest('.checkbox-groups').data('for')+'][]');
else
$checked.closest('.groups').find("input[type=hidden]").removeAttr('name');
}
return false;
} else if($checked.attr('type') == 'radio' && !$(this).closest('div').hasClass('active-mune')) {
+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
+8 -7
View File
@@ -97,25 +97,26 @@
<%= f.select :widget_path, @widget_paths, {}, selected: (@part.widget_path rescue nil), class: "input-xlarge change" %>
</div>
</div>
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_categories.blank? %>" id="page-category-groups">
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_categories.blank? %>" id="page-category-groups" data-for="category">
<%= f.label :categories, t(:categories), class: "control-label muted" %>
<div class="controls">
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, false, class: "select_all" %> <%= t(:all) %>
<%= check_box_tag nil, nil, (@part.category.size == @module_app_categories.size ? true : false), class: "select_all" %> <%= t(:all) %>
<% end %>
<div class="groups" id="page-category">
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
<%= category.title %>
<% end if @module_app_categories %>
<input type="hidden" value>
</div>
</div>
</div>
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_tags.blank? %>" id="page-tags-groups">
<div class="control-group input-content checkbox-groups <%= 'hide' if @module_app_tags.blank? %>" id="page-tags-groups" data-for="tag">
<%= f.label :tags, t(:tags), class: "control-label muted" %>
<div class="controls">
<%= content_tag :label, class: "checkbox" do %>
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
<%= check_box_tag nil, nil, (@part.tag.size == @module_app_tags.size ? true : false), class: "select_all" %> <%= t(:all) %>
<% end %>
<div class="groups" id="page-tags">
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
@@ -162,8 +163,8 @@
</script>
<script>
function toggleChecked(status) {
$(".checkbox").each( function() {
$(this).attr("checked",status);
})
$(".checkbox").each( function() {
$(this).attr("checked",status);
})
}
</script>
+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")