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>';
var event_list_template = '<div class="col-md-8">' +
'<table class="table table-condensed table-bordered event_list">' +
'<thead>' +
'<tr>' +
'<th>Date</th>' +
'<th>Time</th>' +
'<th>Events</th>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<td colspan="3" class="no_events">No events for this month.</td>' +
'</tr>' +
'</tbody>' +
'</table>' +
var event_list_template = '<div class="col-md-8 agenda-event">' +
'<table class="table table-condensed table-bordered event_list">' +
'<thead>' +
'<tr>' +
'<th>Date</th>' +
'<th>Time</th>' +
'<th>Events</th>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<td colspan="3" class="no_events">No events for this month.</td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'</div>';
var head_template = '<div>' +
@ -256,7 +256,7 @@ var AgendaView = function(calendar){
'<label>To</label>' +
'<select name="end_month" 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>';
var event_template = '<tr>' +
@ -407,6 +407,8 @@ var AgendaView = function(calendar){
if($(this).find("tr").length > 1)
$(this).find("td.no_events").parent().remove();
})
// nano scroller here
}
})
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;
var template = dom.find(".month_template"),
monthNames = ['January','February','March','April','May','June','July','August','September','October','November','December'],
initialDate = date,
subpartid = subpart,
index_url = url,
fetchInterval = null,
month = date.getMonth(),
year = date.getFullYear(),
@ -127,6 +128,11 @@
var dt = inserting_date + "-" + month + "-" + year,
td = dom.find("td[data-date-node=" + dt + "]");
td.addClass("w-calendar-event");
if(index_url != ""){
td.on("click",function(){
window.location.href = "http://" + window.location.host + index_url;
})
}
inserting_date++;
if(inserting_date > lastDay.getDate() || (ed.getMonth() == month && inserting_date > ed.getDate())){
break;

File diff suppressed because it is too large Load Diff

View File

@ -13,8 +13,12 @@ class CalendarsController < ApplicationController
def 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

View File

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