frontend widget plus show page fix

This commit is contained in:
rulingcom 2015-06-03 17:38:31 +08:00
parent a7a91c4be6
commit 177df2738b
5 changed files with 681 additions and 542 deletions

View File

@ -232,21 +232,21 @@ var AgendaView = function(calendar){
'</div>' + '</div>' +
'</div>'; '</div>';
var event_list_template = '<div class="col-md-8">' + var event_list_template = '<div class="col-md-8 agenda-event">' +
'<table class="table table-condensed table-bordered event_list">' + '<table class="table table-condensed table-bordered event_list">' +
'<thead>' + '<thead>' +
'<tr>' + '<tr>' +
'<th>Date</th>' + '<th>Date</th>' +
'<th>Time</th>' + '<th>Time</th>' +
'<th>Events</th>' + '<th>Events</th>' +
'</tr>' + '</tr>' +
'</thead>' + '</thead>' +
'<tbody>' + '<tbody>' +
'<tr>' + '<tr>' +
'<td colspan="3" class="no_events">No events for this month.</td>' + '<td colspan="3" class="no_events">No events for this month.</td>' +
'</tr>' + '</tr>' +
'</tbody>' + '</tbody>' +
'</table>' + '</table>' +
'</div>'; '</div>';
var head_template = '<div>' + var head_template = '<div>' +
@ -256,7 +256,7 @@ var AgendaView = function(calendar){
'<label>To</label>' + '<label>To</label>' +
'<select name="end_month" class="form-control input-sm" />' + '<select name="end_month" class="form-control input-sm" />' +
'<select name="end_year" class="form-control input-sm" />' + '<select name="end_year" class="form-control input-sm" />' +
'<button id="show_events" class="btn btn-sm bt-filter">Show Events</button>' + '<button id="show_events" class="btn btn-sm bt-filter btn-primary">Show Events</button>' +
'</div>'; '</div>';
var event_template = '<tr>' + var event_template = '<tr>' +
@ -407,6 +407,8 @@ var AgendaView = function(calendar){
if($(this).find("tr").length > 1) if($(this).find("tr").length > 1)
$(this).find("td.no_events").parent().remove(); $(this).find("td.no_events").parent().remove();
}) })
// nano scroller here
} }
}) })
var eventDom = function(event){ var eventDom = function(event){

View File

@ -1,9 +1,10 @@
var CalendarModuleMonth = function(date,dom,subpart){ var CalendarModuleMonth = function(date,dom,subpart,url){
_this = this; _this = this;
var template = dom.find(".month_template"), var template = dom.find(".month_template"),
monthNames = ['January','February','March','April','May','June','July','August','September','October','November','December'], monthNames = ['January','February','March','April','May','June','July','August','September','October','November','December'],
initialDate = date, initialDate = date,
subpartid = subpart, subpartid = subpart,
index_url = url,
fetchInterval = null, fetchInterval = null,
month = date.getMonth(), month = date.getMonth(),
year = date.getFullYear(), year = date.getFullYear(),
@ -127,6 +128,11 @@
var dt = inserting_date + "-" + month + "-" + year, var dt = inserting_date + "-" + month + "-" + year,
td = dom.find("td[data-date-node=" + dt + "]"); td = dom.find("td[data-date-node=" + dt + "]");
td.addClass("w-calendar-event"); td.addClass("w-calendar-event");
if(index_url != ""){
td.on("click",function(){
window.location.href = "http://" + window.location.host + index_url;
})
}
inserting_date++; inserting_date++;
if(inserting_date > lastDay.getDate() || (ed.getMonth() == month && inserting_date > ed.getDate())){ if(inserting_date > lastDay.getDate() || (ed.getMonth() == month && inserting_date > ed.getDate())){
break; break;

File diff suppressed because it is too large Load Diff

View File

@ -13,8 +13,12 @@ class CalendarsController < ApplicationController
def widget def widget
part = OrbitHelper.get_current_widget part = OrbitHelper.get_current_widget
{ {
"extras" => {"subpart-id"=>part.id.to_s} "extras" => {
"subpart-id" => part.id.to_s,
"more_url" => OrbitHelper.widget_more_url
}
} }
end end

View File

@ -6,7 +6,6 @@
<%= stylesheet_link_tag "fullcalendar"%> <%= stylesheet_link_tag "fullcalendar"%>
<%= stylesheet_link_tag "calendar"%> <%= stylesheet_link_tag "calendar"%>
<div id="orbit_calendar" class="month_view"> <div id="orbit_calendar" class="month_view">
<div class="clearfix cal-fn"> <div class="clearfix cal-fn">
<div id='sec2'> <div id='sec2'>