Calander view updated...

This commit is contained in:
Harry Bomrah 2012-11-01 10:45:22 +08:00 committed by chris
parent 228d43d0e2
commit 2e809c5c19
9 changed files with 18 additions and 10 deletions

View File

@ -334,7 +334,7 @@ var orbitDesktop = function(dom){
if(tile.data_category == "app")
$li = $('<li id="'+tile._id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile.data_content+'" class="appicon" onclick="return false;"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
else
$li = $('<li id="'+tile._id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">Loading...</div></li>');
$li = $('<li id="'+tile.data_content+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile._id+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">Loading...</div></li>');
$group.find('.col'+colindex).append($li);
}

View File

@ -81,7 +81,7 @@
<% end -%>
<% end %>
<%= content_tag :li, :class => active_for_controllers('archive_files', 'tags', 'archive_file_categorys') do -%>
<%= content_tag :li, :class => active_for_controllers('archive_files', 'panel/archive/back_end/tags', 'archive_file_categorys') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-asset') + content_tag(:span, t('admin.archive')), panel_archive_back_end_archive_files_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('archive_files', 'tags', 'archive_file_categorys')) do -%>
<%= content_tag :li, link_to((t('admin.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_archive_back_end_archive_files_path), :class => active_for_action('archive_file', 'index') %>
@ -91,14 +91,14 @@
<% end -%>
<% end -%>
<%= content_tag :li, :class => active_for_controllers('cals') || active_for_app_auth("calendar") do -%>
<%= content_tag :li, :class => active_for_controllers('cals','panel/calendar/back_end/tags') || active_for_app_auth("calendar") do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-calendar') + content_tag(:span, t('admin.calendar')), panel_calendar_back_end_cals_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('cals','calendar_categories') ) do -%>
<%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %>
<%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %>
<%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %>
<%= content_tag :li, link_to((t('calendar.calendars') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_calendar_back_end_cal_path), :class => active_for_action('cals','new') %>
<%#= content_tag :li, link_to(t('gallery.tags'), panel_gallery_back_end_tags_path), :class => active_for_action('/panel/gallery/back_end/tags', 'index') %>
<%= content_tag :li, link_to((t('admin.calendars') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_calendar_back_end_cal_path), :class => active_for_action('cals','new') %>
<%= content_tag :li, link_to(t('admin.tags'), panel_calendar_back_end_tags_path), :class => active_for_action('/panel/calendar/back_end/tags', 'index') %>
<%#= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "gallery"}))), :class => active_for_app_auth('gallery') if (is_admin? rescue nil) %>
<% end -%>
<% end %>

View File

@ -141,7 +141,7 @@ en:
attributes: Attributes
author: Author
calendar: Calendar
gprs: GPRS
gprs: GPS
cant_delete_self: You can not delete yourself.
cant_revoke_self_admin: You can not revoke your admin role yourself.
category: Category

View File

@ -1,7 +1,7 @@
class Panel::Calendar::BackEnd::CalsController < OrbitBackendController
include AdminHelper
include Panel::Calendar::BackEnd::CalsHelper
before_filter :force_order_for_user
def index
@calendars = Cal.all
end
@ -237,7 +237,7 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController
# color = Cal.find(event.cal_id).color
# @events << {"id"=>event.id,"index"=>i,"start_date"=>event.start_date, "total_days" => no_of_days, "title" => event.title,"color"=>color,"show_link"=>panel_calendar_back_end_event_path(event)}
# end
events = Event.all.where(:cal_id.in=>fromcalendars).asc(:start_date).desc(:total_days)
events = Event.where(:cal_id.in=>fromcalendars).asc(:start_date).desc(:total_days)
events.each_with_index do |event,i|
# @temp = Array.new
startdt = Date.new(event.start_year,event.start_month)
@ -290,8 +290,9 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController
def get_week_events
week = params[:week].to_i
year = params[:year].to_i
fromcalendars = params[:calendars]
@d = getWeekDataSet(week,year)
events = Event.where(:start_week.lte => week).and(:start_year => year).and(:end_week.gte => week).and(:start_year => year).asc(:start_week).asc(:start_date)
events = Event.where(:cal_id.in=>fromcalendars).and(:start_week.lte => week).and(:start_year => year).and(:end_week.gte => week).and(:start_year => year).asc(:start_week).asc(:start_date)
@events = Array.new
events.each_with_index do |event,i|
# @temp = Array.new
@ -346,6 +347,7 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController
day = params[:date].to_i
month = params[:month].to_i
year = params[:year].to_i
fromcalendars = params[:calendars]
dt = Date.new(year,month,day)
week = dt.strftime("%U")
events = Event.where(:start_month.lte => month).and(:start_year => year).and(:end_month.gte => month)

View File

@ -0,0 +1,6 @@
class Panel::Calendar::BackEnd::TagsController < Admin::TagsController
def initialize
super
@app_title = 'calendar'
end
end

View File

@ -13,7 +13,7 @@ Rails.application.routes.draw do
resources :cals
resources :events
resources :tags
end
end
end