Compare commits

...
Author SHA1 Message Date
harrybomrah 234a6f0ae6 fixed template updation from site preferences 2013-11-05 19:19:36 +08:00
harrybomrah 98a03c2e40 now only approved announcement can be viewed when backend is open 2013-11-05 18:18:11 +08:00
harrybomrah 9d7af2ccac fixed the edit link problem in site settings 2013-11-05 16:54:33 +08:00
harrybomrah af103fa427 gallery frontend ui fixed. 2013-11-05 13:28:10 +08:00
saurabhbhatia 1945921fcb authorized user now able edit page context 2013-11-05 13:01:58 +08:00
Spen ced7a59555 fix new ui archive and link frontend 2013-11-05 11:27:35 +08:00
saurabhbhatia 3d758cabb3 Updated orbit core lib for module app 2013-11-05 11:25:35 +08:00
saurabhbhatia 54f778f17d Updated Calendar frontend 2013-11-04 23:03:28 +08:00
rulingcom b1867dd47a new code logic for saving tree.. should work fine even if the node positions fail 2013-11-04 22:20:50 +08:00
harrybomrah 3db075b9d2 side bar for calendar fixed. 2013-11-04 18:31:10 +08:00
Manson Wang 7ad05ef034 Dashboard with Google Chart 2013-11-04 17:48:51 +08:00
harrybomrah 2c8705ac3e fixed site structure and also member roles side bar problem. 2013-11-04 17:39:16 +08:00
saurabhbhatia 2b97d4ca22 Updated Theme in design 2013-11-04 16:31:09 +08:00
saurabhbhatia 3816314b5b Fixed Temaplte Module with Info and Images 2013-11-04 16:12:30 +08:00
saurabhbhatia 1f3f9831ad Fixed Openness Issue 2013-11-04 15:44:51 +08:00
harrybomrah eaa87b3dd8 new categories for calendar with colors inside.. plus changed the working of calendar. it has now categories like all other modules 2013-11-04 15:17:50 +08:00
saurabhbhatia 17f31d1e25 Fix for Site preference 2013-11-04 09:41:28 +08:00
39 changed files with 392 additions and 615 deletions

No files matched your search

+1 -2
View File
@@ -71,8 +71,7 @@ gem 'redis-search'
gem 'syslog-logger'
gem "recaptcha", :require => "recaptcha/rails"
gem 'puma'
gem 'request-log-analyzer'
gem "chartkick"
gem 'usagewatch'
# Gems used only for assets and not required
@@ -12,6 +12,7 @@ $(function() {
}
else {
setForm(item.data('form'));
if( $( ".color-picker" ).length ) $(".color-picker").miniColors("value",item.data("form").color);
pageslide.find('form').attr('action', '/admin/module_apps/' + item.data('module') + '/categories/' + item.data('id'));
pageslide.find('form').attr('method', 'put');
}
@@ -81,7 +81,7 @@ function customOpenSlide() {
} else {
$('#pageslide form').prop('method', 'post')
};
_type == 'page' ? pageSetting(element.data('id'), _edit) : linkSetting(element.data('id'), _edit);
_type == 'page' ? pageSetting(element.data('id'), _edit) : linkSetting(element.data('id'), _edit, pageslide);
}
});
$iFrame.pageslide({
@@ -237,8 +237,8 @@ function pageSetting(id, edit) {
};
};
function linkSetting(id, edit) {
$linkPublishedTrue = $('#link_is_published_true');
function linkSetting(id, edit, ps) {
$linkPublishedTrue = ps.find('#link_is_published_true');
_status = edit;
if(_status) {
$.ajax({
@@ -250,6 +250,7 @@ function linkSetting(id, edit) {
})
.done(function(data) {
_linkData = data;
console.log($linkPublishedTrue)
data.public ? $linkPublishedTrue.prop('checked', true) : $linkPublishedTrue.prop('checked', false);
$linkPublishedTrue.prop('checked') ? $('.link-options').slideDown(300) : $('.link-options').slideUp(300);
$.each(_linkData.link, function(index, val) {
@@ -286,7 +287,6 @@ function getView(module_id, id) {
cache: false,
});
}
$(function() {
$pageModule = null,
$pageF2E = null,
@@ -327,7 +327,11 @@ $(function() {
} else {
position = $(ui.item).index();
};
$.post("<%= Rails.application.routes.url_helpers.update_position_admin_items_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position } );
var next_sibling = $(ui.item).next(),
next_sibling_id = null;
if( next_sibling )
next_sibling_id = next_sibling.attr("id");
$.post("<%= Rails.application.routes.url_helpers.update_position_admin_items_path %>", { id: ui.item.attr('id'), parent_id: (ui.item.parent().closest('li').attr('id') || ui.item.parent().closest('ol').attr('id')), position: position, "next_sibling_id" : next_sibling_id } );
}
});
$(".sortable").delegate(".brand, .delete", clickEvent, function(e){
@@ -56,4 +56,10 @@
width: 26px;
height: 3px;
background: url(miniColors/line.gif) center no-repeat;
}
.miniColors-trigger.btn {
background-image: none;
height: 16px;
width: 0px;
}
+1 -2
View File
@@ -54,10 +54,9 @@ class Admin::DesignsController < OrbitBackendController
when 'javascripts', 'themes'#, 'images'
@object = @design.send(params[:type]).find(params[:object_id])
end
Dir.mktmpdir('f_path') { |dir|
temp_file = File.new(dir + '/' + File.basename(@object.file.url), 'w+')
temp_file.write(params[:file][:content].force_encoding('UTF-8'))
temp_file.write(params[:html_code].force_encoding('UTF-8'))
@object.remove_file!
@object.file = temp_file
@object.save
+1 -1
View File
@@ -24,7 +24,7 @@ class Admin::ItemsController < OrbitBackendController
def update_position
item = Item.find(params[:id])
item.shift_to(params[:parent_id], params[:position].to_i)
item.shift_to(params[:parent_id], params[:position].to_i, params[:next_sibling_id])
render :nothing => true, status: 200
end
+10 -1
View File
@@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base
helper_attr :site_valid_locales
def check_backend_openness
if Site.first.backend_openness_on
if !Site.first.backend_openness_on
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
end
end
@@ -341,9 +341,18 @@ class ApplicationController < ActionController::Base
else
objects = get_viewable(object_class, query)
end
if (!user_signed_in? && object_class == "bulletin")
objects = get_bulletins_for_open_backend(objects)
end
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
end
def get_bulletins_for_open_backend(objects)
objects.select{|object| object.is_rejected == false && object.is_pending == false}
end
def get_string_value_from_object(object)
s = object.name_translations[I18n.locale.to_s] unless s rescue nil
s = object.title_translations[I18n.locale.to_s] unless s rescue nil
+1 -1
View File
@@ -130,7 +130,7 @@ class PagesController < ApplicationController
end
def check_frontend_open
if Site.first.frontend_open && current_user.nil? #Need to be change
if !Site.first.frontend_open && current_user.nil? #Need to be change
redirect_to '/admin/dashboards'
end
end
+30 -6
View File
@@ -1,5 +1,5 @@
module ApplicationHelper
Time.zone = ActiveSupport::TimeZone[+8.hours]
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
@@ -223,25 +223,49 @@ module ApplicationHelper
end
def display_visitors(options={})
Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
Impression.where(options).count
end
def display_visitors_today
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
display_visitors(created_at: {'$gte' => Time.now.beginning_of_day, '$lte' => Time.now})
end
def display_visitors_this_week
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
display_visitors(created_at: {'$gte' => Time.now-7.days, '$lte' => Time.now})
end
def display_visitors_this_month
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
display_visitors(created_at: {'$gte' => Time.now-30.days, '$lte' => Time.now})
end
def display_visitors_this_year
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
display_visitors(created_at: {'$gte' => Time.now-365.days, '$lte' => Time.now})
end
def get_month_traffic
result = []
(0..30).each do |i|
visits = Impression.where( created_at: {
'$gte' => Time.now.beginning_of_day-i.days,
'$lte' => Time.now.end_of_day-i.days}
).count
result.push([ Time.now.beginning_of_day-i.days, visits])
end
[:name=> t(:visitors_count),:data=>result]
end
# def get_today_traffic
# result = []
# (0..30).each do |i|
# the_day = i.day.ago
# visits = Impression.where( created_at: {'$gte' => the_day.beginning_of_day, '$lte' => the_day.end_of_day}).count
# # result.push([ the_day.to_time.to_i, visits])
# result.push([ the_day.strftime("%m %d"), visits])
# # result.push({'x'=> i, 'y'=> visits})
# end
# result
# end
def display_date_time(object)
object.strftime("%Y-%m-%d %H:%M")
end
+15 -13
View File
@@ -44,17 +44,23 @@ class Item
a
end
def shift_to(new_parent, position)
def find_by_parent_and_position(parent, position)
parent.children.detect{|child| child.position == position}
end
def shift_to(new_parent, position, next_sibling_id)
position = position.to_i
new_parent = Item.find(new_parent)
current_position_sibling = find_by_parent_and_position(new_parent, position)
if current_position_sibling
if self.position > current_position_sibling.position
self.move_above(current_position_sibling)
else
self.move_below(current_position_sibling)
end
elsif self.parent != new_parent
if next_sibling_id
next_sibling = Item.find(next_sibling_id)
self.move_above(next_sibling)
else
self.move_to_bottom
end
if self.parent != new_parent
self.parent = new_parent
save
end
@@ -86,10 +92,6 @@ class Item
end
end
def find_by_parent_and_position(parent, position)
parent.children.detect{|child| child.position == position}
end
# Enable the validation for parent_id
def validates_presence_of_parent_id?
true
+29 -383
View File
@@ -2,399 +2,45 @@
<h2>
<i class="icons-book-2"></i>
<span class="break"></span>
Server Loading
<%= t(:server_usage) %>
</h2>
</div>
<div class="box-content" style='overflow: hidden;'>
<div id="cpu_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></div>
<div id="mem_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></div>
<div id="disk_usage" style="min-width: 230px; max-width: 220px; height: 220px; display: inline-block; margin-left: -5px;"></div>
<span id="cpu_usage" style="display:inline-block;margin: 0 auto"></span>
<span id="mem_usage" style="display:inline-block;margin: 0 auto"></span>
<span id="disk_usage" style="display:inline-block;margin: 0 auto"></span>
</div>
<script type="text/javascript">
google.load('visualization', '1', {packages:['gauge']});
var UsageTpye = {'CPU':{'fn':'get_cpu_usage','chart':null,'id':'cpu_usage','interval':2000},
'Mem':{'fn':'get_mem_usage','chart':null,'id':'mem_usage','interval':5000},
'Disk':{'fn':'get_disk_usage','chart':null,'id':'disk_usage','interval':30000}};
$(function () {
get_cpu_usage();
get_mem_usage();
get_disk_usage();
$.each(UsageTpye,function(type,option){
option['chart'] = new google.visualization.Gauge(document.getElementById(option['id']));
update_usage(type,option);
setInterval(function() { update_usage(type,option); }, option['interval']);
});
});
function get_cpu_usage(){
$('#cpu_usage').highcharts({
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: 'CPU Usage'
},
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
// the value axis
yAxis: {
min: 0,
max: 100,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
title: {
text: ''
},
plotBands: [{
from: 0,
to: 60,
color: '#55BF3B' // green
}, {
from: 60,
to: 80,
color: '#DDDF0D' // yellow
}, {
from: 80,
to: 100,
color: '#DF5353' // red
}]
},
series: [{
name: 'CPU Usage',
data: [0],
dataLabels: {
formatter: function () {
var usage = this.y;
return '<span style="color:#339">'+ usage + ' %</span><br/>';
},
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#DDD'],
[1, '#FFF']
]
}
},
tooltip: {
valueSuffix: ' %'
}
}]
},
function(chart) {
update_cpu_usage(chart);
setInterval(function() {
update_cpu_usage(chart);
}, 2000);
});
}
function update_usage(type,option){
$.get('/admin/dashboards/'+option['fn'],function(usage){
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
[type, parseInt(usage)]
]);
function update_cpu_usage(chart){
$.get('/admin/dashboards/get_cpu_usage',function(usage){
var point = chart.series[0].points[0],
newVal = Math.round(usage);
point.update(newVal);
});
}
function get_mem_usage(){
$('#mem_usage').highcharts({
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
var options = {
width: 400, height: 180,
redFrom: 80, redTo: 100,
yellowFrom:60, yellowTo: 80,
minorTicks: 5
};
title: {
text: 'Memory Usage'
},
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
// the value axis
yAxis: {
min: 0,
max: 100,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
title: {
text: ''
},
plotBands: [{
from: 0,
to: 60,
color: '#55BF3B' // green
}, {
from: 60,
to: 80,
color: '#DDDF0D' // yellow
}, {
from: 80,
to: 100,
color: '#DF5353' // red
}]
},
series: [{
name: 'Memory Usage',
data: [0],
dataLabels: {
formatter: function () {
var usage = this.y;
return '<span style="color:#339">'+ usage + ' %</span><br/>';
},
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#DDD'],
[1, '#FFF']
]
}
},
tooltip: {
valueSuffix: ' %'
}
}]
},
function(chart) {
update_mem_usage(chart)
setInterval(function() {
update_mem_usage(chart);
}, 5000);
});
}
function update_mem_usage(chart){
$.get('/admin/dashboards/get_mem_usage',function(usage){
var point = chart.series[0].points[0],
newVal = Math.round(usage);
point.update(newVal);
});
}
function get_disk_usage(){
$('#disk_usage').highcharts({
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: 'Disk Usage'
},
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
// the value axis
yAxis: {
min: 0,
max: 100,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
title: {
text: ''
},
plotBands: [{
from: 0,
to: 60,
color: '#55BF3B' // green
}, {
from: 60,
to: 80,
color: '#DDDF0D' // yellow
}, {
from: 80,
to: 100,
color: '#DF5353' // red
}]
},
series: [{
name: 'Disk Usage',
data: [0],
dataLabels: {
formatter: function () {
var usage = this.y;
return '<span style="color:#339">'+ usage + ' %</span><br/>';
},
backgroundColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, '#DDD'],
[1, '#FFF']
]
}
},
tooltip: {
valueSuffix: ' %'
}
}]
},
function(chart) {
update_disk_usage(chart);
setInterval(function() {
update_disk_usage(chart);
}, 60000);
});
}
function update_disk_usage(chart){
$.get('/admin/dashboards/get_disk_usage',function(usage){
var point = chart.series[0].points[0],
newVal = Math.round(usage);
point.update(newVal);
option['chart'].draw(data, options);
});
}
</script>
+24 -52
View File
@@ -2,61 +2,33 @@
<h2>
<i class="icons-book-2"></i>
<span class="break"></span>
Traffic Loading
<%= t(:monthly_traffic)%>
</h2>
</div>
<div class="box-content">
<div id="month_traffic" style="min-width: 310px; height: 230px; margin: 0 auto"></div>
<div id="month_traffic" style="min-width: 310px; margin: 0 auto">
<%= line_chart get_month_traffic, :height => "200px", :name => 'Visit',
:library => {
legend: 'none',
chartArea:{ width: '95%', left: 50, right: 0},
hAxis:{format:'MMM-d',gridlines:{color: '#CCC', count: 31}},
vAxis:{minValue:-100,viewWindowMode: 'maximized'}
} %>
</div>
</div>
<script type="text/javascript">
$(function () {
$.getJSON('/admin/dashboards/get_month_traffic', function (data) {
// console.log(data);
dates = [];
visits = [];
$.each(data,function(key,value){
// console.log(value);
$.each(value,function(date,visit){
dates.push(date);
visits.push(visit);
});
});
$('#month_traffic').highcharts({
chart: {
type: 'spline'
},
title: {
text: 'Monthly Traffic',
x: 0 //center
},
xAxis: {
categories: dates
},
yAxis: {
title: {
text: 'Number of visits'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: ''
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'Visits',
data: visits
}]
});
});
});
renderLineChart = function (element, series, opts) {
waitForLoaded(function () {
var options = jsOptions(series, opts);
var data = createDataTable(series, "datetime");
var formatter = new google.visualization.DateFormat({
pattern: options.pattern
});
formatter.format(data, 0);
var chart = new google.visualization.LineChart(element);
resize(function () {
chart.draw(data, options);
});
});
};
</script>
+4 -9
View File
@@ -1,20 +1,15 @@
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/highslide/highslide-full.min.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/highslide/highslide.config.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="http://www.highcharts.com/highslide/highslide.css" />
<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
<section id="main-wrap">
<div class="wrap-inner initial">
<div class="row-fluid">
<% if is_admin? %>
<div class="box span6">
<div id='server_loading'>
<%= render 'server_loading' %>
</div>
</div>
<div class="box span4">
<% end %>
<div class="box span6">
<div id='traffic'>
<%= render 'traffic' %>
</div>
+33 -1
View File
@@ -64,6 +64,10 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">CSS <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="active"><a href="#html_0" data-toggle="tab"><%= @design.layout.name %></a></li>
<% @design.themes.each do |theme| %>
<li><a href="#<%= dom_id theme %>" data-toggle="tab"><%= theme.name %></a></li>
<%end%>
<li><a href="#css_0" data-toggle="tab"><%= @design.css_default.name %></a></li>
<li><a href="#css_1" data-toggle="tab"><%= @design.css_reset.name %></a></li>
</ul>
@@ -76,6 +80,26 @@
<% end %>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Theme <b class="caret"></b></a>
<ul class="dropdown-menu">
<% @design.themes.each do |theme| %>
<li><a href="#<%= dom_id theme %>" data-toggle="tab"><%= theme.name %></a></li>
<% end %>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Images <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#images" data-toggle="tab">Images</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Template Info<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#info" data-toggle="tab">Template Info</a></li>
</ul>
</li>
</ul>
<div id="code-groups" class="tab-content">
<div class="clearfix tab-pane fade active in" id="html_0">
@@ -93,8 +117,16 @@
<%= render :partial => 'tab_form', :locals => {:type => :css_reset, :object => @design.css_reset} %>
</div>
<div class="clearfix tab-pane fade active in" id="images">
<%= render :partial => 'images' %>
</div>
<div class="clearfix tab-pane fade active in" id="info">
<%= render :partial => 'form' %>
</div>
<% @design.javascripts.each do |js| %>
<div class="clearfix tab-pane fade active in" id="#<%= dom_id js %>">
<div class="clearfix tab-pane fade active in" id="<%= dom_id js %>">
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
</div>
<% end %>
+1 -1
View File
@@ -164,7 +164,7 @@
<label class="control-label muted">Default Language</label>
<div class="controls">
<% @site_in_use_locales.each do |locale| %>
<%= radio_button_tag "site[default_locale]", locale, @locale == locale , @site.in_use_locales.include?(locale),:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %>
<%= radio_button_tag "site[default_locale]", locale, @locale == locale,:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %>
<% end %>
</div>
</div>
@@ -6,7 +6,7 @@
<div id="sidebar-menu">
<div class="scroller">
<%= content_tag :ul, :class => "sidebar-nav" do -%>
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%>
<%= content_tag :li, :class => active_for_controllers('users_new_interface','roles') do -%>
<%= link_to( ( content_tag(:span, content_tag(:i, nil, :class => 'icons-user'))), admin_users_new_interface_index_path) %>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('plugins') do -%>
@@ -30,7 +30,7 @@
<%= content_tag :li, link_to((content_tag(:span, t(:add_member))), new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_authorization))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_registration))), '#'), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_role))),admin_roles_path ), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_role))),admin_roles_path ), :class => active_for_action('roles', 'index') if (is_admin? rescue nil) %>
<%= content_tag :li, link_to((content_tag(:span, t(:member_info))), edit_admin_info_path(Info.first.id.to_s)), :class => active_for_action('users_new_interfacexx', 'index') if (is_admin? rescue nil) and Info.first %>
<% end -%>
</div>
+1 -1
View File
@@ -21,7 +21,7 @@
</li>
<!-- Desktop -->
<% if !@site.desktop_closed%>
<% if @site.desktop_closed%>
<li id="orbit-desktop">
<a href="<%= desktop_path %>" role="button">
<i class="icons-screen"></i> <span class="hide"><%= t(:desktop) %></span>
+2 -1
View File
@@ -1,6 +1,7 @@
defaults: &defaults
main_public_key: 'lib/main_public_key.pem'
store_ip: 'redmine.rulingcom.com:3001'
# store_ip: 'redmine.rulingcom.com:3001'
store_ip: 'tp.rulingcom.com:33335'
orbit: 'Orbit'
ruling_digital: 'RulingDigital'
+3
View File
@@ -289,6 +289,7 @@ en:
menu_enabled_for: Menu enabled for
module: Module
module_authorization: Module Authorization
monthly_traffic: Monthly Traffic
more_plus: more+
most_visited_page: Most Visited Page
multilingual: Multilingual
@@ -377,6 +378,7 @@ en:
search_: Search
search_google: Search Google
setup_member: Member setup
server_usage: Server Usage
show: Show
show_mode:
index: Index
@@ -516,6 +518,7 @@ en:
vertical: Vertical
view: View
view_count: View count
visitors_count: Visits
visitors_this_month: This month's visitors
visitors_this_week: This week's visitors
visitors_this_year: This year's visitors
+3
View File
@@ -290,6 +290,7 @@ zh_tw:
menu_enabled_for: 選單啟用
module: 模組
module_authorization: 模組授權
monthly_traffic: 本月流量
more_plus: 更多+
most_visited_page: 最多瀏覽頁面
multilingual: 多語系
@@ -378,6 +379,7 @@ zh_tw:
search_: 搜尋
search_google: 搜尋Google
setup_member: 會員設定
server_usage: 主機負載
show: 顯示
show_mode:
index: 檢索
@@ -517,6 +519,7 @@ zh_tw:
vertical: 垂直的
view: 檢視
view_count: 查看次數
visitors_count: 造訪人次
visitors_this_month: 本月造訪人次
visitors_this_week: 本星期造訪人次
visitors_this_year: 今年造訪人次
+2 -2
View File
@@ -279,8 +279,8 @@ module OrbitCoreLib
end
def check_user_can_use
unless current_or_guest_user.admin? || @module_app.is_manager?(current_or_guest_user) || @module_app.is_sub_manager?(current_or_guest_user) || @module_app.can_approve?(current_or_guest_user)
redirect_to root_url
unless current_or_guest_user.admin? || (@module_app.is_manager?(current_or_guest_user) if @module_app.present?) || (@module_app.is_sub_manager?(current_or_guest_user) if @module_app.present?) || (@module_app.can_approve?(current_or_guest_user) if @module_app.present?)
redirect_to admin_dashboards_url
end
end
@@ -20,6 +20,8 @@ class ArchiveFile
field :title, localize: true
field :create_user_id
field :update_user_id, :class_name => "User"
scope :can_display,where(is_hidden: false)
# belongs_to :archive_file_category
@@ -4,78 +4,22 @@ class Panel::CalendarNew::BackEnd::EventCategoriesController < OrbitBackendContr
# GET /events
# GET /events.json
def index
@event_categories = EventCategory.all
@module_app_id = @module_app.id rescue nil
@categories = get_categories_for_index
@categories = @categories.page(params[:page]).per(10)
respond_to do |format|
format.html # index.html.erb
format.json { render json: @event_categories }
format.json { render json: @categories }
end
end
# GET /events/1
# GET /events/1.json
def show
@event_category = EventCategory.find(params[:id])
def list
@module_app_id = @module_app.id rescue nil
respond_to do |format|
format.html # show.html.erb
format.json { render json: @event_category }
end
end
# GET /events/new
# GET /events/new.json
def new
@event_category = EventCategory.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @event_category }
end
end
# GET /events/1/edit
def edit
@event_category = EventCategory.find(params[:id])
end
def create
@event_category = EventCategory.new(params[:event_category])
respond_to do |format|
if @event_category.save
format.html { redirect_to panel_calendar_new_back_end_event_categories_path, notice: 'Category was successfully created.' }
format.json { render json: @event_category, status: :created, location: @event_category }
else
format.html { render action: "new" }
format.json { render json: @event_category.errors, status: :unprocessable_entity }
end
end
end
def update
@event_category = EventCategory.find(params[:id])
respond_to do |format|
if @event_category.update_attributes(params[:event_category])
format.html { redirect_to panel_calendar_new_back_end_event_categories_path, notice: 'Category was successfully updated.' }
format.json { head :no_content }
#format.js
else
format.html { render action: "edit" }
format.json { render json: @event_category.errors, status: :unprocessable_entity }
#format.js
end
end
end
def destroy
@event_category = EventCategory.find(params[:id])
@event_category.destroy
respond_to do |format|
format.html { redirect_to panel_calendar_new_back_end_event_categories_path }
format.json { head :no_content }
end
@categories = get_categories_for_index
@categories = @categories.page(params[:page]).per(10)
render :layout => false
end
end
@@ -40,6 +40,7 @@ class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController
# GET /events/new.json
def new
@event = Event.new
@categories = get_categories_for_index
@end_d_t = ""
@start_d_t = ""
@all_day = false;
@@ -61,15 +62,13 @@ class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController
@start_d_t = params[:startDate]
end
render :layout => false
#respond_to do |format|
# format.html # new.html.erb
# format.json { render json: @event }
#end
end
# GET /events/1/edit
def edit
@event = Event.find(params[:id])
@categories = get_categories_for_index
@end_d_t = @event.end.strftime("%Y/%m/%d %H:%M").to_s
@start_d_t = @event.start.strftime("%Y/%m/%d %H:%M").to_s
@all_day = @event.all_day
@@ -80,12 +79,8 @@ class Panel::CalendarNew::BackEnd::EventsController < OrbitBackendController
# POST /events
# POST /events.json
def create
@event = Event.new(params[:event])
# if params[:event][:period] == "Does not repeat"
#else
# @event_recurring = EventRecurring.new(params[:event])
#end
@event = Event.new(params[:event])
if @event.present? && @event.save
render json: @event.to_json
else
@@ -0,0 +1,45 @@
class Panel::CalendarNew::FrontEnd::EventsController < OrbitWidgetController
# GET /events
# GET /events.json
def initialize
super
@app_title = 'calendar'
end
def index
@item = Page.find(params[:page_id])
@title = @item.title
if !@item.frontend_data_count.blank?
@page_num = @item.frontend_data_count
else
@page_num = 10
end
if params[:start].present? && params[:end].present?
sdt = Time.at(params[:start].to_i)
edt = Time.at(params[:end].to_i)
@monthly_events = Event.monthly_event(sdt,edt)
@re = Event.recurring_event(sdt,edt)
@events = @monthly_events.inject(@re, :<<)
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @events }
end
end
def show
@event = Event.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @event }
end
end
def agenda
agenda_start = Date.parse(params[:agenda_start])
agenda_end = Date.parse(params[:agenda_end])
@events = Event.agenda_events(agenda_start,agenda_end)
render :json=>@events.to_json
end
end
+8 -9
View File
@@ -4,6 +4,7 @@ require 'date'
class Event
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCategory::Categorizable
include Mongoid::MultiParameterAttributes
field :title
@@ -12,13 +13,11 @@ class Event
field :end, type: DateTime
field :all_day, type: Boolean
field :recurring, type: Boolean
field :event_category_id
field :frequency
field :period
attr_accessor :agenda_start, :agenda_end, :get_agenda_events
belongs_to :event_category
validates_presence_of :title, :message => "Please fill the title of the Event"
@@ -42,8 +41,8 @@ class Event
:end => self.end.rfc822,
:allDay => self.all_day,
:recurring => self.recurring,
:calendar => self.event_category_id,
:color => EventCategory.find(self.event_category_id).color,
:calendar => self.category_id,
:color => Category.find(self.category_id).custom_value,
:edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(self.id),
:delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(self.id)
}
@@ -64,13 +63,13 @@ class Event
@i = TimeDifference.between(re.start,end_date).in_days.to_i
(1..@i).each do |i|
@start_date = re.start + i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
elsif re.start < start_date
@i = TimeDifference.between(start_date,end_date).in_days.to_i
(0..@i-1).each do |i|
@start_date = start_date.to_date + i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @start_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
end
when "Weekly"
@@ -81,7 +80,7 @@ class Event
@start_date += (7*re.frequency.to_i)
@end_date += (7*re.frequency.to_i)
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @end_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>@start_date, :end => @end_date, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
when "Monthly"
if !(start_date..end_date).cover?(re.start)
@@ -91,7 +90,7 @@ class Event
@start_date = sd
sd = sd >> @i*re.frequency.to_i
ed = ed >> @i*re.frequency.to_i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
when "Yearly"
if !(start_date..end_date).cover?(re.start)
@@ -101,7 +100,7 @@ class Event
@start_date = sd
sd = sd >> 12 * @i*re.frequency.to_i
ed = ed >> 12 * @i*re.frequency.to_i
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.event_category_id.to_s, :color => EventCategory.find(re.event_category_id).color, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
@recurring << {:id => re.id, :title=>re.title, :note=>re.note, :start=>sd, :end => ed, :allDay => re.all_day, :recurring => re.recurring, :calendar => re.category_id.to_s, :color => Category.find(re.category_id).custom_value, :edit_url => Rails.application.routes.url_helpers.edit_panel_calendar_new_back_end_event_path(re.id), :delete_url => Rails.application.routes.url_helpers.panel_calendar_new_back_end_event_path(re.id)}
end
end
end
@@ -0,0 +1,21 @@
<tr class="<%= 'disable' if category.disable %>">
<% @site_valid_locales.each_with_index do |locale, i| %>
<td>
<%= category.title_translations[locale] %>
<% if i == 0 %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if is_admin?%>
<li><%= link_to t(:edit), '#', class: "open-slide", data: {title: t(:edit_category), id: category.id.to_s, module: @module_app_id.to_s, form: category.title_translations.merge(color: category.custom_value)} %></li>
<li><%= link_to show_toggle_archive_btn(category), toggle_admin_module_app_category_path(@module_app_id, category), method: :post, remote: true, class: "archive_toggle" %></li>
<% end %>
<% if is_manager? || is_admin? %>
<li><%= link_to t(:category_auth), admin_authorizations_path(@module_app.key, 'category_authorization', category.id) %></li>
<% end %>
</ul>
</div>
<% end %>
</td>
<% end %>
<td><span class="badge" style="background-color: <%= category.custom_value %>;"><%= category.custom_value %></span></td>
</tr>
@@ -0,0 +1,12 @@
<%= flash_messages %>
<%= f.error_messages %>
<%= label_tag("color", t("calendar.color")) %>
<div class="input-append">
<%= f.text_field :custom_value, id: "color", :class => "color-picker miniColors input-small", :size => "7", :maxlength => "7", :autocomplete=>"off",:value=>"9100FF" %>
</div>
<%= f.fields_for :title_translations do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= label_tag "name-#{locale}", "#{t(:name)} (#{I18nVariable.from_locale(locale)})" %>
<%= f.text_field locale, :class => 'input-large', :value => (@category.title_translations[locale] rescue ''), placeholder: t(:name), id: locale %>
<% end %>
<% end %>
@@ -1,28 +1,65 @@
<table class="table main-list">
<%= stylesheet_link_tag "jquery.miniColors" %>
<%= javascript_include_tag "jquery.miniColors.min" %>
<%= javascript_include_tag "admin/categories" %>
<div id="categories_index">
<table class="table main-list">
<thead>
<tr>
<th class="span1"><%= t('event_category.name') %></th>
<th class="span1"><%= t('event_category.color') %></th>
<%if is_manager? %>
<th class="span1"><%= t('event_category.edit') %></th>
<th class="span1"><%= t('event_category.delete') %></th>
<tr class="sort-header">
<% @site_valid_locales.each_with_index do |locale, i| %>
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
<% end %>
<th class="span2"><a href="#"><%= t('event_category.color') %></a></th>
</tr>
</thead>
<tbody id="tbody_locations" class="sort-holder">
<% @event_categories.each do |event_category| %>
<tr class="with_action">
<td><%= event_category.name %></td>
<td><%= event_category.color%></td>
<%if is_manager? %>
<td><%= link_to 'Edit', edit_panel_calendar_new_back_end_event_category_path(event_category) %></td>
<td><%= link_to 'Destroy', panel_calendar_new_back_end_event_category_path(event_category), method: :delete , :confirm => t(:sure?) %></td>
<%end%>
</tr>
<% end %>
<tbody>
<%= render partial: 'category', collection: @categories %>
</tbody>
</table>
<%= link_to "Add", new_panel_calendar_new_back_end_event_category_path, :class => "btn btn-primary pull-right", :id=>"create_event_btn", :ref=>"add-btn" %>
</p>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), '#', class: "btn btn-primary open-slide", data: {title: t(:add_category), id: 'new', module: @module_app_id.to_s } %>
</div>
<div class="pagination pagination-centered">
<%= paginate @categories unless @categories.blank? %>
</div>
</div>
</div>
<div id="pageslide">
<div class="page-title clearfix">
<a class="pull-right" href="javascript:$.pageslide.close()">
<i class="icons-arrow-left-2"></i>
</a>
<span></span>
</div>
<div class="view-page">
<div class="nano">
<div class="content">
<%= form_for :category, url: nil, html:{:id=>"color"}, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
</div>
</div>
</div>
</div>
<script type="text/javascript">
if($('.color-picker').length > 0){
$('.color-picker').miniColors(); // just in category view
$('.miniColors-trigger').addClass('btn');
}
$("form#color").bind("ajax:complete",function(){
$.get("<%= panel_calendar_new_back_end_event_categories_list_path %>",function(data){
$("#categories_index").html(data);
openSlide();
})
})
</script>
@@ -0,0 +1,13 @@
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @site_valid_locales.each_with_index do |locale, i| %>
<th class="<%= 'span5' if i <= 1 %>"><a href="#"><%= t(:_locale, :locale => locale) %></a></th>
<% end %>
<th class="span2"><a href="#"><%= t('event_category.color') %></a></th>
</tr>
</thead>
<tbody>
<%= render partial: 'category', collection: @categories %>
</tbody>
</table>
@@ -52,7 +52,7 @@
</div>
<div class="row-fluid">
<%= f.label "Calendar", :class=>"control-label span3" %>
<%= f.collection_select :event_category_id, EventCategory.all, :id, :name%>
<%= f.select :category_id, @categories.collect{|t| [ t.title, t.id ]} %>
</div>
<div class="row-fluid">
<label class="checkbox inline"><%= f.check_box :recurring,:id=>"recurring_checkbox", :checked => @recurring %> Recurring</label>
+6 -4
View File
@@ -2,14 +2,16 @@ Rails.application.routes.draw do
namespace :panel do
namespace :calendar_new do
namespace :back_end do
match 'event_categories/list' => "event_categories#list"
resources :event_categories
match 'events/agenda' => 'events#agenda', :as => :agenda
resources :events
end
namespace :front_end do
match 'events/agenda' => 'events#agenda', :as => :agenda
resources :events
end
namespace :front_end do
match 'events/agenda' => 'events#agenda', :as => :agenda
resources :events, except: [:new, :edit, :update, :destroy]
end
end
end
end
+9 -9
View File
@@ -16,33 +16,33 @@ module CalendarNew
front_end do
app_page 'events' do
frontend_i18n "calendar_new.frontend.events"
frontend_i18n "calendar_new.frontend.events"
end
end
side_bar do
head_label_i18n 'calendar.calendar',:icon_class=>"icons-calendar"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['events'],:public=>['panel/calendar_new/back_end/tags']})
active_for_controllers ({:private=>['events','event_categories'],:public=>['panel/calendar_new/back_end/tags']})
head_link_path "panel_calendar_new_back_end_events_path"
context_link 'calendar.categories',
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
:priority=>2,
:active_for_category => 'CalendarNew',
:available_for => [:manager]
# context_link 'calendar.categories',
# :link_path=>"admin_module_app_categories_path(get_module_app)" ,
# :priority=>2,
# :active_for_category => 'CalendarNew',
# :available_for => [:manager]
context_link 'tags',
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
:priority=>4,
:active_for_tag => 'CalendarNew',
:available_for => [:manager]
context_link 'calendar.color',
context_link 'calendar.categories',
:link_path=>"panel_calendar_new_back_end_event_categories_path" ,
:priority=>3,
:active_for_tag => 'CalendarNew',
:active_for_category => 'CalendarNew',
:available_for => [:manager]
end
end
@@ -220,14 +220,19 @@ var galleryAPI = function(){
$img.fadeOut(200,function(){
g.loadstart();
if($rslide.hasClass("fullscreen"))
if($rslide.hasClass("fullscreen")){
$img.attr({"src":dom.attr("data-content")}).css("height","100%").load(function(){
g.loadcomplete();
$img.fadeIn(200);
});
else
$img.attr({"src":dom.attr("data-content")}).css("height","auto");
}else{
$img.attr({"src":dom.attr("data-content")}).css("height","auto").load(function(){
console.log(dom.attr("data-content"));
g.loadcomplete();
$img.fadeIn(200);
});;
}
if($rslide.hasClass("fullscreen")){
$img.css({"padding":($rslide.height()-$img.height())/2})
}
@@ -236,7 +241,7 @@ var galleryAPI = function(){
if(rcom.getInternetExplorerVersion() == -1){
if(pageurl!=window.location){
pageurl = "gallery?id="+pageurl+"&controller_action=theater";
pageurl = window.location.pathname.replace("/","")+"?id="+pageurl+"&controller_action=theater";
window.history.pushState({path:pageurl},'',pageurl);
}
}else{
@@ -144,6 +144,9 @@
-moz-transition: all 0.3s ease;
}
.rslide.fullscreen { position: fixed; z-index: 99; }
.rslide.fullscreen .comp img{
width: auto;
}
.rslideinside {
}
.comp {
@@ -156,7 +159,7 @@
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
}
.comp img{ display: block; width: auto; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; }
.comp img{ display: block; width: 100%; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; }
.comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; }
.rslidenav {
position: absolute;
@@ -25,7 +25,7 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
end
else
@categoryids.each do |id|
category = GalleryCategory.find(id)
category = Category.find(id)
if @tags
if @tags.kind_of?(Array)
@tags.each do |tag|
@@ -44,8 +44,9 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
@albs = Array.new
album.each do |values|
tags = Tag.find(values.tagged_ids).map{|t| t.name}
category = GalleryCategory.find(values.gallery_category_id).name
@albs << {"_id"=>values.id,"show_path"=>panel_gallery_front_end_album_path(values),"cover"=>values.cover,"cover_path"=>values.cover_path,"description"=>values.description,"category_name"=>category,"gallery_category_id" => values.gallery_category_id,"name"=>values.name,"tag_ids"=>values.tag_ids,"tag_names"=>tags}
category = Category.find(values.category_id).title
@albs << {"_id"=>values.id,"show_path"=>panel_gallery_front_end_album_path(values),"cover"=>values.cover,"cover_path"=>values.cover_path,"description"=>values.description,"category_name"=>category,"gallery_category_id" => values.category_id,"name"=>values.name,"tag_ids"=>values.tag_ids,"tag_names"=>tags}
end
@output << @albs
end
@@ -85,8 +86,8 @@ class Panel::Gallery::FrontEnd::AlbumsController < OrbitWidgetController
@albumid = @image.gallery_album_id
@album = GalleryAlbum.find(@albumid)
@images = @album.gallery_images.all
tags = @album.tag_ids
@tagnames = Tag.find(tags.tagged_ids).map{|t| t.name}
tags = @album.tagged_ids
@tagnames = Tag.find(tags).map{|t| t.name}
@back_link = panel_gallery_front_end_album_path(@albumid)
end
end
@@ -20,7 +20,7 @@
</script>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "galleryAPI_frontend" %>
<%= javascript_include_tag "jquery.tinyscrollbar" %>
<%#= javascript_include_tag "jquery.tinyscrollbar" %>
<%= javascript_include_tag "rss" %>
<% end %>
@@ -27,7 +27,7 @@
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "galleryAPI_frontend" %>
<%= javascript_include_tag "jquery.tinyscrollbar" %>
<%#= javascript_include_tag "jquery.tinyscrollbar" %>
<%= javascript_include_tag "rss" %>
<% end %>
@@ -18,6 +18,8 @@ class WebLink
field :create_user_id
field :update_user_id, :class_name => "User"
scope :can_display,where(is_hidden: false)
# belongs_to :web_link_category
before_save :clean_tags