Merge branch 'new_member' of github.com:Rulingcom/orbit into new_member
Conflicts: vendor/built_in_modules/personal_patent/app - %BDƻs/assets/images/personal_patent/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/assets/javascripts/personal_patent/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/assets/stylesheets/personal_patent/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/application_controller.rb vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/tags_controller.rb vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patent_categorys_controller.rb vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.00.rb vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/back_end/writing_patents_controller.rb vendor/built_in_modules/personal_patent/app - %BDƻs/controllers/panel/personal_patent/plugin/writing_patents_controller.rb vendor/built_in_modules/personal_patent/app - %BDƻs/helpers/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/mailers/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/models/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/models/personal_patent_tag.rb vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent.rb vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_category.rb vendor/built_in_modules/personal_patent/app - %BDƻs/models/writing_patent_file.rb vendor/built_in_modules/personal_patent/app - %BDƻs/views/.gitkeep vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_form.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/_writing_patent_category.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/create.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/destroy.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/edit.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/index.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/new.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patent_categorys/update.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_filter.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_form_file.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_list_writing_patent_category.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_sort_headers.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/_writing_patent_category_qe.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/create_writing_patent_setting.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/destroy.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/edit.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/index.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/index.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/new.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/show.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/toggle_enable.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/update_writing_patent_setting.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/writing_patent_category_quick_add.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/writing_patent_category_quick_edit.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/back_end/writing_patents/writing_patent_setting.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_filter.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_form.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_form_file.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_sort_headers.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/_writing_patent.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/destroy.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/edit.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/index.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/index.js.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/new.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/show.html.erb vendor/built_in_modules/personal_patent/app - %BDƻs/views/panel/personal_patent/plugin/writing_patents/toggle_enable.js.erb
This commit is contained in:
commit
664c6d2f61
68 files changed
+1393
-572
No files matched your search
+255
-15
@@ -27,6 +27,13 @@ Date.prototype.getWeek = function (dowOffset) {
|
||||
return weeknum;
|
||||
};
|
||||
|
||||
Date.prototype.daysInMonth = function(){
|
||||
var daysArray = [31,28,31,30,31,30,31,31,30,31,30,31];
|
||||
if(this.getFullYear()%4 == 0)
|
||||
daysArray[1] = 29;
|
||||
|
||||
return daysArray[this.getMonth()];
|
||||
}
|
||||
|
||||
var calendarAPI = function(){
|
||||
c = this;
|
||||
@@ -36,17 +43,20 @@ var calendarAPI = function(){
|
||||
this.cur_month = c.today.getMonth()+1;
|
||||
this.cur_year = c.today.getFullYear();
|
||||
this.cur_week = c.today.getWeek();
|
||||
this.cur_date = c.today.getDate();
|
||||
this.view = null;
|
||||
this.monthlist = ["","January","February","March","April","May","June","July","August","September","October","November","December"];
|
||||
this.initialize = function(){
|
||||
$(window).load(function(){
|
||||
// c.loadMonthView(c.cur_month,c.cur_year);
|
||||
c.loadWeekView(c.cur_week,c.cur_year);
|
||||
// c.loadWeekView(c.cur_week,c.cur_year);
|
||||
c.loadDayView(c.cur_date,c.cur_month,c.cur_year);
|
||||
bindHandlers();
|
||||
})
|
||||
var bindHandlers = function(){
|
||||
$(".event").live("click",function(){
|
||||
c.displayEvent($(this));
|
||||
$(".event").live("click",function(e){
|
||||
var pos = {"x":e.clientX,"y":e.clientY};
|
||||
c.displayEvent($(this),pos);
|
||||
})
|
||||
|
||||
$("#create_event_btn").click(function(){
|
||||
@@ -73,7 +83,7 @@ var calendarAPI = function(){
|
||||
c.loadWeekView(c.cur_week,c.cur_year);
|
||||
break;
|
||||
case 'day':
|
||||
c.loadDayView();
|
||||
c.loadDayView(c.cur_date,c.cur_month,c.cur_year);
|
||||
break;
|
||||
case 'agenda':
|
||||
c.loadAgendaView();
|
||||
@@ -104,6 +114,22 @@ var calendarAPI = function(){
|
||||
}
|
||||
c.loadWeekView(w,y);
|
||||
break;
|
||||
case "day":
|
||||
var d,w,y;
|
||||
d = c.cur_date - 1;
|
||||
m = c.cur_month;
|
||||
y = c.cur_year;
|
||||
if(d == 0){
|
||||
var dx = new Date(c.cur_year,c.cur_month-2);
|
||||
d = dx.daysInMonth();
|
||||
m--;
|
||||
}
|
||||
if(m == 0){
|
||||
m = 12;
|
||||
y = y - 1;
|
||||
}
|
||||
c.loadDayView(d,m,y);
|
||||
break;
|
||||
}
|
||||
|
||||
})
|
||||
@@ -132,10 +158,40 @@ var calendarAPI = function(){
|
||||
}
|
||||
c.loadWeekView(w,y);
|
||||
break;
|
||||
case "day":
|
||||
var d,w,y;
|
||||
var dx = new Date(c.cur_year,c.cur_month-1);
|
||||
if(c.cur_date == dx.daysInMonth()){
|
||||
d = 1;
|
||||
m = c.cur_month + 1;
|
||||
}else{
|
||||
d = c.cur_date + 1;
|
||||
m = c.cur_month;
|
||||
}
|
||||
|
||||
if(m == 13){
|
||||
m = 1;
|
||||
y = c.cur_year + 1;
|
||||
}else{
|
||||
y = c.cur_year;
|
||||
}
|
||||
|
||||
c.loadDayView(d,m,y);
|
||||
break;
|
||||
}
|
||||
})
|
||||
$("button#today_btn").click(function(){
|
||||
c.loadMonthView();
|
||||
switch (c.view){
|
||||
case "week":
|
||||
c.loadWeekView();
|
||||
break;
|
||||
case "month":
|
||||
c.loadMonthView();
|
||||
break;
|
||||
case "day":
|
||||
c.loadDayView();
|
||||
break;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -156,7 +212,7 @@ var calendarAPI = function(){
|
||||
if($('#calendar_month').length > 0){
|
||||
var $c_table = $('#calendar_month');
|
||||
var sum_h = 0;
|
||||
var context_h = $('#main-sidebar').outerHeight();
|
||||
var context_h = $(window).height() - $('#orbit-bar').height();
|
||||
$('#main-wrap > *').not('#orbit_calendar, .modal').each(function(){
|
||||
sum_h += $(this).outerHeight();
|
||||
});
|
||||
@@ -215,6 +271,8 @@ var calendarAPI = function(){
|
||||
var recordcurdate = true;
|
||||
|
||||
if(allow){
|
||||
if(evnt.title=="Navratri")
|
||||
console.log(pos);
|
||||
if(pos == 1){
|
||||
var colspan = 0;
|
||||
if(evnt.total_days>7){
|
||||
@@ -231,13 +289,13 @@ var calendarAPI = function(){
|
||||
$eventrow.html('<td colspan="'+colspan+'" class="main_td" pos="'+pos+'"><div class="event" link="'+evnt.show_link+'" style="background-color: '+evnt.color+';">'+evnt.title+'</div></td>');
|
||||
}else{
|
||||
if($eventrow.html()==""){
|
||||
$eventrow.append('<td colspan="'+(pos-1)+'">');
|
||||
$eventrow.append('<td colspan="'+(pos-1)+'"></td>');
|
||||
}else{
|
||||
if((lastno+1)!=thisno){
|
||||
var inposition = parseInt($eventrow.find("td.main_td:last").attr("pos"));
|
||||
var curcolspan = $eventrow.find("td.main_td:last").attr("colspan");
|
||||
var colspan = pos - (inposition+parseInt(curcolspan));
|
||||
$eventrow.append('<td colspan="'+colspan+'">');
|
||||
$eventrow.append('<td colspan="'+colspan+'"></td>');
|
||||
}
|
||||
}
|
||||
var colspan = 0;
|
||||
@@ -297,16 +355,182 @@ var calendarAPI = function(){
|
||||
}
|
||||
this.getEventsForWeek = function(week,year){
|
||||
$.getJSON("cals/getWeekEvents",{"week":week,"year":year},function(events){
|
||||
|
||||
var height = 15;
|
||||
var full_day_count = 0;
|
||||
var rowcount = 7;
|
||||
var tr = $("<tr></tr>");
|
||||
var pre = true;
|
||||
$.each(events,function(i,evnt){
|
||||
// console.log("rowcount: "+rowcount);
|
||||
// console.log("start:"+evnt.start);
|
||||
if(rowcount >= (7 - evnt.total_days)){
|
||||
if(tr.html()!=""){
|
||||
if(rowcount != 7){
|
||||
tr.append("<td colspan='"+(7-rowcount)+"'></td>");
|
||||
}
|
||||
$("table.all_day_event_holder").append(tr);
|
||||
}
|
||||
tr = null;
|
||||
tr = $('<tr></tr>');
|
||||
pre = true;
|
||||
}
|
||||
|
||||
if(evnt.all_day){
|
||||
full_day_count++;
|
||||
|
||||
var precountspan = 7 - evnt.total_days;
|
||||
if(pre){
|
||||
height+=20;
|
||||
$(".head_event_wrapper").height(height);
|
||||
$(".head_event_wrapper table").eq(0).height(height);
|
||||
tr.append('<td rowspan="1" style="width:60px;"> </td>');
|
||||
if(precountspan != 0){
|
||||
tr.append('<td colspan="'+precountspan+'"></td>');
|
||||
pre = false;
|
||||
}
|
||||
}
|
||||
var colcount = evnt.total_days;
|
||||
if(evnt.colcount != 0){
|
||||
colcount = evnt.colcount;
|
||||
}
|
||||
|
||||
rowcount = precountspan + colcount;
|
||||
|
||||
tr.append('<td colspan="'+colcount+'" class="all_day_event week_day" ><div class="event half" style="background-color: '+evnt.color+' ;color:#fff;" link="'+evnt.show_link+'"><dl><dt>'+evnt.title+'</dt><dd></dd></dl></div></td>');
|
||||
|
||||
// $(".week_day_header[date="+evnt.start_date+"]").append('<div class="event half" link="'+evnt.show_link+'" style="background-color: '+evnt.color+';color:#fff;"><dl><dt>'+evnt.title+'</dt><dd></dd></dl></div>');
|
||||
}else{
|
||||
|
||||
var starttime,endtime,displaystarttime,displayendtime;
|
||||
if(evnt.start_am_pm == "AM"){
|
||||
starttime = evnt.start_time;
|
||||
if(starttime == 12)
|
||||
starttime = 0;
|
||||
if(starttime == 12.5)
|
||||
starttime = 0.5;
|
||||
}else
|
||||
starttime = evnt.start_time + 12;
|
||||
|
||||
if(evnt.end_am_pm == "AM"){
|
||||
endtime = evnt.end_time;
|
||||
if(endtime == 12)
|
||||
endtime = 0;
|
||||
if(endtime == 12.5)
|
||||
endtime = 0.5;
|
||||
}else
|
||||
endtime = evnt.end_time + 12;
|
||||
|
||||
var temp = parseInt(evnt.start_time);
|
||||
|
||||
if (evnt.start_time > temp)
|
||||
displaystarttime = temp + ":30 " + evnt.start_am_pm;
|
||||
else
|
||||
displaystarttime = temp + ":00 " + evnt.start_am_pm;
|
||||
|
||||
temp = parseInt(evnt.end_time);
|
||||
|
||||
if (evnt.end_time > temp)
|
||||
displayendtime = temp + ":30 " + evnt.end_am_pm;
|
||||
else
|
||||
displayendtime = temp + ":00 " + evnt.end_am_pm;
|
||||
|
||||
var toppx = ((starttime * 2) * 20) + 1;
|
||||
var h = endtime - starttime;
|
||||
var halfhour = "";
|
||||
if(h == 0.5)
|
||||
halfhour = "half";
|
||||
h = 17 + 20 + (((h-1) * 2) * 20) + 1;
|
||||
var eventdom = $('<div class="event '+halfhour+'" link="'+evnt.show_link+'" style="background-color: '+evnt.color+';color:#fff; top:'+toppx+'px; height:'+h+'px;"><dl><dt>'+displaystarttime+' - '+displayendtime+'</dt><dd>'+evnt.title+'</dd></dl></div>');
|
||||
$(".week_day_body[date="+evnt.start_date+"] .inner").append(eventdom);
|
||||
}
|
||||
if(full_day_count == 0){
|
||||
tr.append('<td rowspan="1" style="width:60px;">');
|
||||
$("table.all_day_event_holder").append(tr);
|
||||
}
|
||||
|
||||
})
|
||||
if(tr.html()!=""){
|
||||
if(rowcount != 7){
|
||||
tr.append("<td colspan='"+(7-rowcount)+"'></td>");
|
||||
}
|
||||
$("table.all_day_event_holder").append(tr);
|
||||
}
|
||||
})
|
||||
}
|
||||
this.loadDayView = function(){
|
||||
$('#view_holder').load("cals/day_view", function() {
|
||||
$('.current_day_title').text('September 2, 2012');
|
||||
this.loadDayView = function(day,month,year){
|
||||
c.view = "day";
|
||||
if(!day){
|
||||
var dt = new Date();
|
||||
week = dt.getWeek();
|
||||
year = dt.getFullYear();
|
||||
day = dt.getDate();
|
||||
month = dt.getMonth()+1;
|
||||
}
|
||||
|
||||
c.cur_date = day;
|
||||
c.cur_month = month;
|
||||
c.cur_year = year;
|
||||
|
||||
$('#view_holder').load("cals/day_view?date="+day+"&month="+month+"&year="+year, function() {
|
||||
$('.current_day_title').text($("#day_header").text());
|
||||
c.getEventsForDay(day,month,year);
|
||||
})
|
||||
}
|
||||
this.getEventsForDay = function(day,month,year){
|
||||
$.getJSON("cals/getDayEvents",{"date":day,"month":month,"year":year},function(events){
|
||||
$.each(events,function(i,evnt){
|
||||
if(evnt.all_day){
|
||||
$(".all_day_event").append('<div class="event" link="'+evnt.show_link+'" style="background-color: '+evnt.color+';color:#fff;">'+evnt.title+'</div>')
|
||||
}else{
|
||||
var starttime,endtime,displaystarttime,displayendtime;
|
||||
if(evnt.start_am_pm == "AM"){
|
||||
starttime = evnt.start_time;
|
||||
if(starttime == 12)
|
||||
starttime = 0;
|
||||
if(starttime == 12.5)
|
||||
starttime = 0.5;
|
||||
}else
|
||||
starttime = evnt.start_time + 12;
|
||||
|
||||
if(evnt.end_am_pm == "AM"){
|
||||
endtime = evnt.end_time;
|
||||
if(endtime == 12)
|
||||
endtime = 0;
|
||||
if(endtime == 12.5)
|
||||
endtime = 0.5;
|
||||
}else
|
||||
endtime = evnt.end_time + 12;
|
||||
|
||||
var temp = parseInt(evnt.start_time);
|
||||
|
||||
if (evnt.start_time > temp)
|
||||
displaystarttime = temp + ":30 " + evnt.start_am_pm;
|
||||
else
|
||||
displaystarttime = temp + ":00 " + evnt.start_am_pm;
|
||||
|
||||
temp = parseInt(evnt.end_time);
|
||||
|
||||
if (evnt.end_time > temp)
|
||||
displayendtime = temp + ":30 " + evnt.end_am_pm;
|
||||
else
|
||||
displayendtime = temp + ":00 " + evnt.end_am_pm;
|
||||
|
||||
var toppx = ((starttime * 2) * 20) + 1;
|
||||
var h = endtime - starttime;
|
||||
var halfhour = "";
|
||||
if(h == 0.5)
|
||||
halfhour = "half";
|
||||
h = 17 + 20 + (((h-1) * 2) * 20) + 1;
|
||||
var eventdom = $('<div class="inner"><div class="event '+halfhour+'" link="'+evnt.show_link+'" style="background-color: '+evnt.color+';color:#fff; top:'+toppx+'px; height:'+h+'px;"><dl><dt>'+displaystarttime+' - '+displayendtime+'</dt><dd>'+evnt.title+'</dd></dl></div></div>');
|
||||
$(".event_holder").append(eventdom);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
this.loadAgendaView = function(){
|
||||
$('#view_holder').load("cals/week_view", function() {
|
||||
$('#view_holder').load("cals/agenda_view", function() {
|
||||
$('.current_day_title').text('September 2, 2012');
|
||||
})
|
||||
}
|
||||
@@ -338,11 +562,27 @@ var calendarAPI = function(){
|
||||
var domfor = $(this).attr("data-content");
|
||||
$("tr[for="+domfor+"]").remove();
|
||||
})
|
||||
$(".btn-edit-a").live("ajax:success",function(evt,form){
|
||||
$("#edit_area_" + $(this).attr("for")).html(form).slideDown();
|
||||
$("#edit_area_" + $(this).attr("for")).find(".color-picker").miniColors();
|
||||
})
|
||||
$(".bt-cancel").live("click",function(){
|
||||
$("#edit_area_" + $(this).attr("for")).html("").slideUp();
|
||||
})
|
||||
}
|
||||
this.displayEvent = function(dom){
|
||||
this.displayEvent = function(dom,pos){
|
||||
var url = dom.attr("link");
|
||||
c.event_quick_view_div.load(url,function(){
|
||||
c.event_quick_view_div.show()
|
||||
var x = pos.x;
|
||||
var y = pos.y;
|
||||
var winheight = $(window).height()
|
||||
if((x+c.event_quick_view_div.width()) > $(window).width()){
|
||||
x = x - c.event_quick_view_div.width();
|
||||
}
|
||||
if((y+c.event_quick_view_div.height()) > winheight){
|
||||
y = y - c.event_quick_view_div.height();
|
||||
}
|
||||
c.event_quick_view_div.css({"left":x+"px","top":y+"px"}).show()
|
||||
c.event_quick_view_div.find(".event-close-btn").click(function(){
|
||||
c.event_quick_view_div.empty().hide();
|
||||
})
|
||||
|
||||
@@ -32,22 +32,26 @@
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
padding: 1px 3px;
|
||||
font-weight: bold;
|
||||
box-shadow: inset 0 0 1px black;
|
||||
-webkit-box-shadow: inset 0 0 1px black;
|
||||
-moz-box-shadow: inset 0 0 1px black;
|
||||
}
|
||||
.event_list_wrapper {
|
||||
position: relative;
|
||||
}
|
||||
.event_list .cell {
|
||||
height: 38px;
|
||||
height: 39px;
|
||||
border: solid 1px #ddd;
|
||||
border-top: 0;
|
||||
}
|
||||
.event_list .divide {
|
||||
height: 18px;
|
||||
height: 19px;
|
||||
margin-bottom: 18px;
|
||||
border-bottom: solid 1px #eee;
|
||||
}
|
||||
.event_list .day_time {
|
||||
height: 30px;
|
||||
height: 31px;
|
||||
border-bottom: solid 1px #ddd;
|
||||
border-left: solid 1px #ddd;
|
||||
text-align: right;
|
||||
@@ -189,7 +193,7 @@
|
||||
}
|
||||
#calendar_day .all_day_event {
|
||||
background: #eee;
|
||||
border: solid 1px #ddd
|
||||
border: solid 1px #ddd;
|
||||
}
|
||||
#calendar_day .event_list .table {
|
||||
border-top: solid 1px #ddd;
|
||||
@@ -223,14 +227,14 @@
|
||||
}
|
||||
#calendar_week .header td {
|
||||
border: solid 1px #ddd;
|
||||
background-color: #eee;
|
||||
/*background-color: #eee;*/
|
||||
}
|
||||
#calendar_week .week_day {
|
||||
padding: 0 2px;
|
||||
border: solid 1px #ddd;
|
||||
}
|
||||
#calendar_week .header .week_day {
|
||||
padding: 1px 2px 10px 2px;
|
||||
padding: 2px 4px 0px 2px;
|
||||
}
|
||||
#calendar_week .event_list .event {
|
||||
position: absolute;
|
||||
@@ -250,7 +254,18 @@
|
||||
#calendar_week .event_holder .inner {
|
||||
margin: 0 8px 0 0;
|
||||
}
|
||||
|
||||
#calendar_week .all_day_event_holder {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
}
|
||||
#calendar_week .all_day_event_holder td {
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
}
|
||||
#calendar_week .all_day_event {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Vendored
+185
-32
@@ -11,6 +11,19 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController
|
||||
@calendars = Cal.all
|
||||
end
|
||||
|
||||
def edit
|
||||
@calendar = Cal.find(params[:id])
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def update
|
||||
@calendar = Cal.find(params[:id])
|
||||
@calendar.update_attributes(params[:cal])
|
||||
respond_to do |h|
|
||||
h.js
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
@calendar = Cal.new(params[:cal])
|
||||
@calendar.save!
|
||||
@@ -26,14 +39,30 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def day_view
|
||||
render :layout => false
|
||||
date = params[:date].to_i
|
||||
month = params[:month].to_i
|
||||
year = params[:year].to_i
|
||||
@cur_day = getDayName(date,month,year) + " " + month.to_s + "/" + date.to_s + " - " + year.to_s
|
||||
@hours = getHours(12)
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
def week_view
|
||||
week = params[:week]
|
||||
year = params[:year]
|
||||
week = params[:week].to_i
|
||||
year = params[:year].to_i
|
||||
@dates = week_dates(week,year)
|
||||
@range = week_range(week,year)
|
||||
@d = getWeekDataSet(week,year)
|
||||
t = Time.now
|
||||
dt = Date.new(t.year,t.month,t.day)
|
||||
today_cur_week = dt.strftime("%U").to_i
|
||||
|
||||
if week == today_cur_week && t.year == year
|
||||
@today = @d.index(t.day.to_s)
|
||||
else
|
||||
@today = 20
|
||||
end
|
||||
@hours = getHours(12)
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
@@ -59,48 +88,172 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController
|
||||
end
|
||||
|
||||
def get_month_events
|
||||
month = params[:month]
|
||||
year = params[:year]
|
||||
month = month.to_i
|
||||
year = year.to_i
|
||||
events = Event.where(:start_month.lt => month).and(:start_year => year).and(:end_month.gte => month).asc(:start_date).desc(:total_days)
|
||||
month = params[:month].to_i
|
||||
year = params[:year].to_i
|
||||
|
||||
# events = Event.where(:start_month.lt => month).and(:start_year => year).and(:end_month.gte => month).asc(:start_date).desc(:total_days)
|
||||
@events = Array.new
|
||||
no_of_days_in_month = getMonthDays(year)
|
||||
events.each_with_index do |event,i|
|
||||
no_of_days = event.total_days
|
||||
# events.each_with_index do |event,i|
|
||||
# no_of_days = event.total_days
|
||||
|
||||
if event.end_month > month
|
||||
no_of_days = no_of_days_in_month[month]
|
||||
elsif event.end_month == month
|
||||
no_of_days = event.end_date
|
||||
end
|
||||
# if event.end_month > month
|
||||
# no_of_days = no_of_days_in_month[month]
|
||||
# elsif event.end_month == month
|
||||
# no_of_days = event.end_date
|
||||
# end
|
||||
|
||||
no_of_days = no_of_days.to_i
|
||||
# no_of_days = no_of_days.to_i
|
||||
|
||||
color = Cal.find(event.cal_id).color
|
||||
@events << {"id"=>event.id,"index"=>i,"start_date"=>"1", "total_days" => no_of_days, "title" => event.title,"color"=>color,"show_link"=>panel_calendar_back_end_event_path(event)}
|
||||
end
|
||||
events = Event.where(:start_month => month).and(:start_year => year).asc(:start_date).desc(:total_days)
|
||||
# color = Cal.find(event.cal_id).color
|
||||
# @events << {"id"=>event.id,"index"=>i,"start_date"=>"1", "total_days" => no_of_days, "title" => event.title,"color"=>color,"show_link"=>panel_calendar_back_end_event_path(event)}
|
||||
# end
|
||||
# events = Event.where(:start_month => month).and(:start_year => year).asc(:start_date).desc(:total_days)
|
||||
# events.each_with_index do |event,i|
|
||||
# # @temp = Array.new
|
||||
# no_of_days = event.total_days
|
||||
# if event.end_month > month
|
||||
# no_of_days = no_of_days_in_month[month] - event.start_date
|
||||
# end
|
||||
# no_of_days = no_of_days.to_i
|
||||
# no_of_days += 1
|
||||
|
||||
# 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.asc(:start_date).desc(:total_days)
|
||||
events.each_with_index do |event,i|
|
||||
# @temp = Array.new
|
||||
no_of_days = event.total_days
|
||||
if event.end_month > month
|
||||
no_of_days = no_of_days_in_month[month] - event.start_date
|
||||
end
|
||||
no_of_days = no_of_days.to_i
|
||||
no_of_days += 1
|
||||
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)}
|
||||
startdt = Date.new(event.start_year,event.start_month)
|
||||
enddt = Date.new(event.end_year,event.end_month)
|
||||
range = startdt..enddt
|
||||
|
||||
dt = Date.new(year,month)
|
||||
if range === dt
|
||||
no_of_days = event.total_days
|
||||
start_date = event.start_date
|
||||
|
||||
if event.start_year < year
|
||||
no_of_days = no_of_days_in_month[month] - event.start_date
|
||||
no_of_days += 1
|
||||
temp = month + 12
|
||||
if event.start_month < temp
|
||||
start_date = 1
|
||||
end
|
||||
end
|
||||
if event.end_year > year
|
||||
no_of_days = no_of_days_in_month[month] - event.start_date
|
||||
no_of_days += 1
|
||||
temp = month + 12
|
||||
end
|
||||
if event.end_month > month
|
||||
no_of_days = no_of_days_in_month[month] - event.start_date
|
||||
no_of_days += 1
|
||||
elsif event.end_month == month
|
||||
no_of_days = event.end_date
|
||||
end
|
||||
|
||||
if event.start_month == month && event.end_month == month
|
||||
no_of_days = event.total_days
|
||||
no_of_days += 1
|
||||
end
|
||||
|
||||
if event.start_month < month
|
||||
start_date = 1
|
||||
end
|
||||
|
||||
color = Cal.find(event.cal_id).color
|
||||
@events << {"start_year"=>event.start_year, "id"=>event.id,"index"=>i,"start_date"=>start_date, "total_days" => no_of_days, "title" => event.title,"color"=>color,"show_link"=>panel_calendar_back_end_event_path(event)}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
render :json => @events.to_json
|
||||
end
|
||||
|
||||
def get_week_events
|
||||
week = params[:week]
|
||||
year = params[:year]
|
||||
events = Event.where(:start_week => week).and(:start_year => year)
|
||||
render :json => events.to_json
|
||||
week = params[:week].to_i
|
||||
year = params[:year].to_i
|
||||
@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 = Array.new
|
||||
events.each_with_index do |event,i|
|
||||
# @temp = Array.new
|
||||
days = event.total_days.to_i + 1
|
||||
colcount = 0
|
||||
startdt = event.start_date
|
||||
|
||||
all_day = event.all_day
|
||||
|
||||
if days > 1
|
||||
all_day = true
|
||||
end
|
||||
|
||||
if event.end_week > week && event.start_week < week
|
||||
days = 7
|
||||
end
|
||||
|
||||
if event.end_week == week
|
||||
days = @d.index(event.end_date.to_s).to_i
|
||||
end
|
||||
|
||||
if event.start_week == week
|
||||
days = 7 - @d.index(event.start_date.to_s).to_i
|
||||
end
|
||||
|
||||
|
||||
if event.start_week == week && event.end_week == week
|
||||
x = @d.index(event.end_date.to_s).to_i
|
||||
y = @d.index(event.start_date.to_s).to_i
|
||||
colcount = x - y
|
||||
colcount+=1
|
||||
|
||||
end
|
||||
|
||||
if event.start_week < week
|
||||
startdt = @d[0].to_i
|
||||
event.all_day = true
|
||||
if event.end_week == week
|
||||
colcount = 7 - @d.index(event.end_date.to_s).to_i
|
||||
days = 7;
|
||||
startdt = event.start_date
|
||||
end
|
||||
end
|
||||
|
||||
color = Cal.find(event.cal_id).color
|
||||
@events << {"id"=>event.id,"index"=>i,"start_date"=>startdt,"end_date"=>event.end_date ,"all_day"=>all_day, "start_week" => event.start_week, "end_week" => event.end_week, "total_days" => days, "title" => event.title,"color"=>color,"show_link"=>panel_calendar_back_end_event_path(event),"start_time"=>event.start_time,"end_time"=>event.end_time,"start_am_pm"=>event.start_am_pm,"end_am_pm"=>event.end_am_pm,"colcount"=>colcount}
|
||||
end
|
||||
render :json => @events.to_json
|
||||
end
|
||||
|
||||
def get_day_events
|
||||
day = params[:date].to_i
|
||||
month = params[:month].to_i
|
||||
year = params[:year].to_i
|
||||
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)
|
||||
@events = Array.new
|
||||
events.each_with_index do |event,i|
|
||||
days = event.total_days.to_i + 1
|
||||
colcount = 0
|
||||
|
||||
all_day = event.all_day
|
||||
|
||||
if days > 1
|
||||
all_day = true
|
||||
end
|
||||
startdt = Date.new(event.start_year,event.start_month,event.start_date)
|
||||
enddt = Date.new(event.end_year,event.end_month,event.end_date)
|
||||
|
||||
range = startdt..enddt
|
||||
|
||||
if range === dt
|
||||
color = Cal.find(event.cal_id).color
|
||||
@events << {"id"=>event.id,"index"=>i,"start_date"=>event.start_date,"end_date"=>event.end_date ,"all_day"=>all_day, "start_week" => event.start_week, "end_week" => event.end_week, "total_days" => days, "title" => event.title,"color"=>color,"show_link"=>panel_calendar_back_end_event_path(event),"start_time"=>event.start_time,"end_time"=>event.end_time,"start_am_pm"=>event.start_am_pm,"end_am_pm"=>event.end_am_pm}
|
||||
end
|
||||
end
|
||||
render :json => @events.to_json
|
||||
end
|
||||
|
||||
def week_number_test
|
||||
|
||||
Vendored
+14
@@ -42,6 +42,13 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController
|
||||
# if end_am_pm == "PM"
|
||||
# temp_end_time = $endtime + 12
|
||||
# end
|
||||
if params[:all_day]
|
||||
all_day = true
|
||||
$starttime = 0
|
||||
$endtime = 0
|
||||
else
|
||||
all_day = false
|
||||
end
|
||||
|
||||
final_start_time = Date.new(start_year.to_i,start_month.to_i,start_date.to_i)
|
||||
final_end_time = Date.new(end_year.to_i,end_month.to_i,end_date.to_i)
|
||||
@@ -67,6 +74,7 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController
|
||||
@event.total_days = total_days
|
||||
@event.start_week = start_week
|
||||
@event.end_week = end_week
|
||||
@event.all_day = all_day
|
||||
@event.save!
|
||||
|
||||
respond_to do |h|
|
||||
@@ -81,6 +89,12 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController
|
||||
@end_day_name = getDayName(@event.end_date,@event.end_month,@event.end_year)
|
||||
render :layout=>false
|
||||
end
|
||||
|
||||
def destroy
|
||||
event = Event.find(params[:id])
|
||||
event.delete
|
||||
render :json => {"success"=>"true"}.to_json
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+49
@@ -131,6 +131,55 @@ module Panel::Calendar::BackEnd::CalsHelper
|
||||
end
|
||||
range
|
||||
end
|
||||
|
||||
def getWeekDataSet(week_num,year)
|
||||
year = year.to_i
|
||||
week_num = week_num.to_i
|
||||
dates = Array.new
|
||||
|
||||
if week_num == 1
|
||||
weekstartday = monthStartDay(1,year)
|
||||
d = 31
|
||||
x = 0
|
||||
for i in d - (weekstartday - 2)..d
|
||||
dates << i.to_s
|
||||
x = x + 1
|
||||
end
|
||||
for i in 1..8 - weekstartday
|
||||
dates << i.to_s
|
||||
x = x + 1
|
||||
end
|
||||
else
|
||||
week_start = Date.commercial(year, week_num-1, 7)
|
||||
month = week_start.strftime("%m")
|
||||
month_days = getMonthDays(year)
|
||||
date = week_start.strftime("%d")
|
||||
x = date.to_i
|
||||
for i in 0..6
|
||||
d = x + i
|
||||
if d > month_days[month.to_i]
|
||||
d = d - month_days[month.to_i]
|
||||
end
|
||||
dates << d.to_s
|
||||
end
|
||||
end
|
||||
dates
|
||||
end
|
||||
|
||||
def getHours(format)
|
||||
hours = Array.new
|
||||
if format == 12
|
||||
hours << 12
|
||||
for i in 1..11
|
||||
hours << i
|
||||
end
|
||||
elsif format == 24
|
||||
for i in 0..23
|
||||
hours << i
|
||||
end
|
||||
end
|
||||
hours
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ class Event
|
||||
field :final_start_time, type: Date
|
||||
field :final_end_time, type: Date
|
||||
field :total_days, type: Integer
|
||||
field :all_day, type: Boolean
|
||||
|
||||
belongs_to :cal
|
||||
|
||||
|
||||
+4
-2
@@ -1,10 +1,12 @@
|
||||
<tr class="with_action" for="<%= calendar.id.to_s %>">
|
||||
<td>
|
||||
<span class="calendars_color_tag" style="background-color: <%= calendar.color %>"></span>
|
||||
<div id="edit_area_<%= calendar.id %>" style="display:hidden;"></div>
|
||||
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><a href="">Edit</a></li>
|
||||
<li><%= link_to t("calendar.delete"), panel_calendar_back_end_cal_path(calendar), :method => "delete",:remote => true, :confirm => t("gallery.sure?"),:class=>"btn-del-a", "data-content"=>calendar.id.to_s %></li>
|
||||
<li><%= link_to t("calendar.edit"), edit_panel_calendar_back_end_cal_path(calendar), :remote => true, :class=>"btn-edit-a", :for => calendar.id %></li>
|
||||
<li><%= link_to t("calendar.delete"), panel_calendar_back_end_cal_path(calendar), :method => "delete",:remote => true, :confirm => t("calendar.sure?"),:class=>"btn-del-a", "data-content"=>calendar.id.to_s %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Vendored
+220
-1
@@ -45,4 +45,223 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div id="calendar_week">
|
||||
<table class="table header">
|
||||
<tr>
|
||||
<th style="width: 44px;"></th>
|
||||
<th>Sun 9/11</th>
|
||||
<th>Mon 9/12</th>
|
||||
<th class="today">Tue 9/13</th>
|
||||
<th>Wed 9/14</th>
|
||||
<th>Thu 9/15</th>
|
||||
<th>Fri 9/16</th>
|
||||
<th>Sat 9/17</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8" style="border:0;">
|
||||
<div class="event_list_wrapper" style="height:50px;">
|
||||
<table style="position: absolute; width: 100%; height: 50px; top: 0;">
|
||||
<tr>
|
||||
<td style="border: 0; background: none; width: 60px;"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="all_day_event_holder">
|
||||
<tr>
|
||||
<td rowspan="2" style="width:60px;"></td>
|
||||
<td colspan="7" class="all_day_event week_day">
|
||||
<div class="event half" style="background-color: #ccffee;">
|
||||
<dl>
|
||||
<dt>10:30am - template</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1"></td>
|
||||
<td colspan="2" class="all_day_event week_day">
|
||||
<div class="event half" style="background-color: #ccffee;">
|
||||
<dl>
|
||||
<dt>10:30am - template</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="4"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="event_list">
|
||||
<table class="table cell_map">
|
||||
<tr height="0">
|
||||
<td style="width: 60px;"></td>
|
||||
<td colspan="7">
|
||||
<div class="event_list_wrapper">
|
||||
<div class="cell_wrapper">
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="day_time">12am</div>
|
||||
<div class="day_time">1am</div>
|
||||
<div class="day_time">2am</div>
|
||||
<div class="day_time">3am</div>
|
||||
<div class="day_time">4am</div>
|
||||
<div class="day_time">5am</div>
|
||||
<div class="day_time">6am</div>
|
||||
<div class="day_time">7am</div>
|
||||
<div class="day_time">8am</div>
|
||||
<div class="day_time">9am</div>
|
||||
<div class="day_time">10am</div>
|
||||
<div class="day_time">11am</div>
|
||||
<div class="day_time">12am</div>
|
||||
<div class="day_time">1pm</div>
|
||||
<div class="day_time">2pm</div>
|
||||
<div class="day_time">3pm</div>
|
||||
<div class="day_time">4pm</div>
|
||||
<div class="day_time">5pm</div>
|
||||
<div class="day_time">6pm</div>
|
||||
<div class="day_time">7pm</div>
|
||||
<div class="day_time">8pm</div>
|
||||
<div class="day_time">9pm</div>
|
||||
<div class="day_time">10pm</div>
|
||||
<div class="day_time">11pm</div>
|
||||
</td>
|
||||
<td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="week_day today">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
<div class="event" style="background-color: #ccffee; top: 117px;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
+50
-130
@@ -3,14 +3,14 @@
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th>
|
||||
<h2>Sunday 9/2</h2>
|
||||
<h2 id="day_header" style="display:none;"><%= @cur_day %></h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td class="all_day_event">
|
||||
<div class="event" style="background-color: #ffcc00;">event1</div>
|
||||
<div class="event" style="background-color: #ffcc00;">event2</div>
|
||||
<!-- <div class="event" style="background-color: #ffcc00;">event1</div>
|
||||
<div cla ss="event" style="background-color: #ffcc00;">event2</div> -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -18,136 +18,56 @@
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td style="width: 60px;">
|
||||
<div class="day_time">12am</div>
|
||||
<div class="day_time">1am</div>
|
||||
<div class="day_time">2am</div>
|
||||
<div class="day_time">3am</div>
|
||||
<div class="day_time">4am</div>
|
||||
<div class="day_time">5am</div>
|
||||
<div class="day_time">6am</div>
|
||||
<div class="day_time">7am</div>
|
||||
<div class="day_time">8am</div>
|
||||
<div class="day_time">9am</div>
|
||||
<div class="day_time">10am</div>
|
||||
<div class="day_time">11am</div>
|
||||
<div class="day_time">12am</div>
|
||||
<div class="day_time">1pm</div>
|
||||
<div class="day_time">2pm</div>
|
||||
<div class="day_time">3pm</div>
|
||||
<div class="day_time">4pm</div>
|
||||
<div class="day_time">5pm</div>
|
||||
<div class="day_time">6pm</div>
|
||||
<div class="day_time">7pm</div>
|
||||
<div class="day_time">8pm</div>
|
||||
<div class="day_time">9pm</div>
|
||||
<div class="day_time">10pm</div>
|
||||
<div class="day_time">11pm</div>
|
||||
<% @hours.each do |hour| %>
|
||||
<div class="day_time"><%= hour %>am</div>
|
||||
<% end %>
|
||||
<% @hours.each do |hour| %>
|
||||
<div class="day_time"><%= hour %>pm</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td style="position: relative;">
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
<div class="event" style="background-color: #66cc00; top: 0;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
<td>
|
||||
<div class="event_list_wrapper">
|
||||
<% @hours.each do |hour| %>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="event" style="background-color: #00aacc; top: 39px;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="event half" style="background-color: #ccffee; top: 117px;">
|
||||
<dl>
|
||||
<dt>10:30am - template</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="event" style="background-color: #00ffee; top: 195px; width: 85%;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="event over" style="background-color: #00ccee; top: 214px; left: 50%; width: 50%;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="event_holder">
|
||||
<!-- <div class="inner">
|
||||
<div class="event" style="background-color: #66cc00; top: 0;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="event" style="background-color: #00aacc; top: 39px;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="event half" style="background-color: #ccffee; top: 117px;">
|
||||
<dl>
|
||||
<dt>10:30am - template</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="event" style="background-color: #00ffee; top: 195px; width: 85%;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="event over" style="background-color: #00ccee; top: 214px; left: 50%; width: 50%;">
|
||||
<dl>
|
||||
<dt>10:30am - 11:00am</dt>
|
||||
<dd>template</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<%= form_for @calendar, :url => panel_calendar_back_end_cal_path(@calendar), :remote => true do |f| %>
|
||||
<h4>Edit</h4>
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
<%= label_tag("color", t("calendar.color")) %>
|
||||
<%= f.text_field :color, :class => "color-picker miniColors", :size => "5", :maxlength => "5", :autocomplete=>"off",:value=>@calendar.color %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= f.fields_for :name_translations do |name| %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag(locale, t("calendar.name")+"-"+I18nVariable.from_locale(locale)) %>
|
||||
<div class="controls">
|
||||
<%= name.text_field locale, :class => "input-xxlarge", :size=>"30", :value=>@calendar.name_translations[locale] %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="">
|
||||
<%= f.submit t("calendar.save"), :class=>"btn btn-primary" %>
|
||||
<button class="btn btn-primary bt-cancel" for="<%= @calendar.id %>">Cancel</button>
|
||||
</div>
|
||||
<% end %>
|
||||
+1
-1
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
<div id="event_create" class="modal" style="right: 8px; bottom: 50px; left: auto; top: auto; width: 380px; margin: 0;display:none;"></div>
|
||||
|
||||
<div id="event_quick_view" class="modal" style="width: 300px; top: 60%;display:none"></div>
|
||||
<div id="event_quick_view" class="modal" style="width: 300px; display:none; margin:0 0 0 0;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var calendar = new calendarAPI();
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
var tr = $("<%= j render :partial=>'calendar', :object=>@calendar %>");
|
||||
$("#calendar_list tr[for=<%= @calendar.id %>]").empty().html(tr.html());
|
||||
+65
-93
@@ -3,120 +3,85 @@
|
||||
<table class="table header">
|
||||
<tr>
|
||||
<th style="width: 44px;"></th>
|
||||
<% @dates.each do |day| %>
|
||||
<th><%= day %></th>
|
||||
<% @dates.each_with_index do |day,i| %>
|
||||
<% if @today == i %>
|
||||
<th class='today'><%= day %></th>
|
||||
<% else %>
|
||||
<th><%= day %></th>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 0; background: none;"></td>
|
||||
<td class="all_day_event week_day">
|
||||
<td colspan="8" style="border:0;">
|
||||
<div class="event_list_wrapper head_event_wrapper" style="height:50px;">
|
||||
<table style="position: absolute; width: 100%; height: 50px; top: 0;">
|
||||
<tr>
|
||||
<td style="border: 0; background: none; width: 60px;"></td>
|
||||
<% @d.each_with_index do |dt,i| %>
|
||||
<% if @today == i %>
|
||||
<td class="all_day_event week_day week_day_header today" date='<%= dt %>'></td>
|
||||
<% else %>
|
||||
<td class="all_day_event week_day week_day_header" date='<%= dt %>'></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="all_day_event_holder">
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
<!-- <div class="event half" style="background-color: #ccffee;">
|
||||
<dl>
|
||||
<dt>10:30am - template</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
</div> -->
|
||||
</td>
|
||||
<td class="all_day_event week_day">
|
||||
<!-- <td class="all_day_event week_day">
|
||||
</td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day">
|
||||
<!-- <div class="event half" style="background-color: #ccffee;">
|
||||
<div class="event half" style="background-color: #ccffee;">
|
||||
<dl>
|
||||
<dt>10:30am - template</dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
</div> -->
|
||||
</div>
|
||||
</td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td>
|
||||
<td class="all_day_event week_day"></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
<div class="event_list">
|
||||
<table class="table cell_map">
|
||||
<tr height="1">
|
||||
<tr height="0">
|
||||
<td style="width: 60px;"></td>
|
||||
<td colspan="7" style="position: relative;">
|
||||
<div class="cell_wrapper">
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
<td colspan="7">
|
||||
<div class="event_list_wrapper">
|
||||
<div class="cell_wrapper">
|
||||
<% @hours.each do |hour| %>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="divide"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="day_time">12am</div>
|
||||
<% @hours.each do |hour| %>
|
||||
<div class="day_time"><%= hour %>am</div>
|
||||
<% end %>
|
||||
<% @hours.each do |hour| %>
|
||||
<div class="day_time"><%= hour %>pm</div>
|
||||
<% end %>
|
||||
<!-- <div class="day_time">12am</div>
|
||||
<div class="day_time">1am</div>
|
||||
<div class="day_time">2am</div>
|
||||
<div class="day_time">3am</div>
|
||||
@@ -128,7 +93,7 @@
|
||||
<div class="day_time">9am</div>
|
||||
<div class="day_time">10am</div>
|
||||
<div class="day_time">11am</div>
|
||||
<div class="day_time">12am</div>
|
||||
<div class="day_time">12pm</div>
|
||||
<div class="day_time">1pm</div>
|
||||
<div class="day_time">2pm</div>
|
||||
<div class="day_time">3pm</div>
|
||||
@@ -139,15 +104,22 @@
|
||||
<div class="day_time">8pm</div>
|
||||
<div class="day_time">9pm</div>
|
||||
<div class="day_time">10pm</div>
|
||||
<div class="day_time">11pm</div>
|
||||
<div class="day_time">11pm</div> -->
|
||||
</td>
|
||||
<td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
<% @d.each_with_index do |dt,i| %>
|
||||
<% if i == @today %>
|
||||
<td class="week_day today week_day_body" date='<%= dt %>'>
|
||||
<% else %>
|
||||
<td class="week_day week_day_body" date='<%= dt %>'>
|
||||
<% end %>
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="week_day">
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- <td class="week_day">
|
||||
<div class="event_holder">
|
||||
<div class="inner">
|
||||
</div>
|
||||
@@ -188,7 +160,7 @@
|
||||
<div class="inner">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
+25
-25
@@ -11,7 +11,7 @@
|
||||
<div class="row-fluid">
|
||||
<% if !@all_day_disabled %>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" for="all_day"> All day
|
||||
<input type="checkbox" name="all_day" for="all_day"> All day
|
||||
</label>
|
||||
<% end %>
|
||||
<label class="checkbox inline">
|
||||
@@ -25,29 +25,29 @@
|
||||
<input class="span5" type="text" value="<%= @placeholder %>" name="start_date" placeholder="<%= @placeholder %>">
|
||||
<select name="start_time" class="span4">
|
||||
<option value="1.00">1:00</option>
|
||||
<option value="1.30">1:30</option>
|
||||
<option value="1.50">1:30</option>
|
||||
<option value="2.00">2:00</option>
|
||||
<option value="2.30">2:30</option>
|
||||
<option value="2.50">2:30</option>
|
||||
<option value="3.00">3:00</option>
|
||||
<option value="3.30">3:30</option>
|
||||
<option value="3.50">3:30</option>
|
||||
<option value="4.00">4:00</option>
|
||||
<option value="4.30">4:30</option>
|
||||
<option value="4.50">4:30</option>
|
||||
<option value="5.00">5:00</option>
|
||||
<option value="5.30">5:30</option>
|
||||
<option value="5.50">5:30</option>
|
||||
<option value="6.00">6:00</option>
|
||||
<option value="6.30">6:30</option>
|
||||
<option value="6.50">6:30</option>
|
||||
<option value="7.00">7:00</option>
|
||||
<option value="7.30">7:30</option>
|
||||
<option value="7.50">7:30</option>
|
||||
<option value="8.00">8:00</option>
|
||||
<option value="8.30">8:30</option>
|
||||
<option value="8.50">8:30</option>
|
||||
<option value="9.00">9:00</option>
|
||||
<option value="9.30">9:30</option>
|
||||
<option value="9.50">9:30</option>
|
||||
<option value="10.00">10:00</option>
|
||||
<option value="10.30">10:30</option>
|
||||
<option value="10.50">10:30</option>
|
||||
<option value="11.00">11:00</option>
|
||||
<option value="11.30">11:30</option>
|
||||
<option value="11.50">11:30</option>
|
||||
<option value="12.00">12:00</option>
|
||||
<option value="12.30">12:30</option>
|
||||
<option value="12.50">12:30</option>
|
||||
</select>
|
||||
<select name="start_am_pm" class="span3">
|
||||
<option value="AM">AM</option>
|
||||
@@ -61,29 +61,29 @@
|
||||
<input class="span5" type="text" name="end_date" value="<%= @placeholder %>" placeholder="<%= @placeholder %>">
|
||||
<select name="end_time" class="span4">
|
||||
<option value="1.00">1:00</option>
|
||||
<option value="1.30">1:30</option>
|
||||
<option value="1.50">1:30</option>
|
||||
<option value="2.00">2:00</option>
|
||||
<option value="2.30">2:30</option>
|
||||
<option value="2.50">2:30</option>
|
||||
<option value="3.00">3:00</option>
|
||||
<option value="3.30">3:30</option>
|
||||
<option value="3.50">3:30</option>
|
||||
<option value="4.00">4:00</option>
|
||||
<option value="4.30">4:30</option>
|
||||
<option value="4.50">4:30</option>
|
||||
<option value="5.00">5:00</option>
|
||||
<option value="5.30">5:30</option>
|
||||
<option value="5.50">5:30</option>
|
||||
<option value="6.00">6:00</option>
|
||||
<option value="6.30">6:30</option>
|
||||
<option value="6.50">6:30</option>
|
||||
<option value="7.00">7:00</option>
|
||||
<option value="7.30">7:30</option>
|
||||
<option value="7.50">7:30</option>
|
||||
<option value="8.00">8:00</option>
|
||||
<option value="8.30">8:30</option>
|
||||
<option value="8.50">8:30</option>
|
||||
<option value="9.00">9:00</option>
|
||||
<option value="9.30">9:30</option>
|
||||
<option value="9.50">9:30</option>
|
||||
<option value="10.00">10:00</option>
|
||||
<option value="10.30">10:30</option>
|
||||
<option value="10.50">10:30</option>
|
||||
<option value="11.00">11:00</option>
|
||||
<option value="11.30">11:30</option>
|
||||
<option value="11.50">11:30</option>
|
||||
<option value="12.00">12:00</option>
|
||||
<option value="12.30">12:30</option>
|
||||
<option value="12.50">12:30</option>
|
||||
</select>
|
||||
<select name="end_am_pm" class="span3">
|
||||
<option value="AM">AM</option>
|
||||
|
||||
+1
-1
@@ -13,6 +13,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn">Delete</a>
|
||||
<%= link_to "Delete", panel_calendar_back_end_event_path(@event),:class => "btn", :method => :delete, :remote => true %>
|
||||
<a href="#" class="btn btn-primary">Edit</a>
|
||||
</div>
|
||||
+3
-1
@@ -6,4 +6,6 @@ en:
|
||||
save: Save
|
||||
delete: Delete
|
||||
select_calendar: "Select Calendar"
|
||||
create: Create
|
||||
create: Create
|
||||
sure?: "Are you sure?"
|
||||
edit: Edit
|
||||
@@ -1,4 +1,11 @@
|
||||
zh_tw:
|
||||
calendar:
|
||||
calendars: Calendars
|
||||
create: Create
|
||||
calendars: Calendars
|
||||
color: Color
|
||||
name: Name
|
||||
save: Save
|
||||
delete: Delete
|
||||
select_calendar: "Select Calendar"
|
||||
create: Create
|
||||
sure?: "Are you sure?"
|
||||
edit: Edit
|
||||
@@ -9,6 +9,7 @@ Rails.application.routes.draw do
|
||||
match 'cals/week_view' => 'cals#week_view', :via => :get
|
||||
match 'cals/getMonthEvents' => 'cals#get_month_events', :via => :get
|
||||
match 'cals/getWeekEvents' => 'cals#get_week_events', :via => :get
|
||||
match 'cals/getDayEvents' => 'cals#get_day_events', :via => :get
|
||||
|
||||
resources :cals
|
||||
resources :events
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -55,7 +55,7 @@ var galleryAPI = function(){
|
||||
}
|
||||
this.makeNewAlbum = function(path){
|
||||
$.get(path,function(html){
|
||||
rcom.modalWindow({loadHtml:html,width:400,height:320,"closeBtn":false},function(dom){
|
||||
rcom.modalWindow({loadHtml:html,width:320,height:320,"closeBtn":false},function(dom){
|
||||
$("form#new_gallery_album").submit(function(){
|
||||
var validated = true;
|
||||
$(this).find(".error").removeClass("error");
|
||||
|
||||
@@ -270,8 +270,8 @@
|
||||
.slidelist a {
|
||||
border: solid 2px #fff;
|
||||
display: block;
|
||||
width: 120px;
|
||||
height: 90px;
|
||||
width: 150px;
|
||||
height: 120px;
|
||||
position: relative;
|
||||
|
||||
box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
||||
|
||||
+4
-4
@@ -4,10 +4,10 @@
|
||||
</div>
|
||||
<%= form_for @album, :url => {:action => "create"}, :remote => true do |f| %>
|
||||
<div class="modal-body add-album">
|
||||
<div> <%= f.select(:gallery_category_id, GalleryCategory.all.collect {|p| [ p.name, p.id ] },{:prompt => t("gallery.select_category")},:class => "validate") %> </div>
|
||||
<div> <%= f.select(:gallery_category_id, GalleryCategory.all.collect {|p| [ p.name, p.id ] },{:prompt => t("gallery.select_category")},:class => "validate input-xlarge") %> </div>
|
||||
<ul class="nav nav-tabs">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? " class='active'" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<li class=<%= ( i == 0 ) ? "active" : "" %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div class="tab_content form-horizontal">
|
||||
@@ -20,7 +20,7 @@
|
||||
<% end %>
|
||||
<p class="control-group">
|
||||
<%= label_tag(locale, t("gallery.album_name")) %>
|
||||
<%= name.text_field locale, :class => "validate" %>
|
||||
<%= name.text_field locale, :class => "validate input-xlarge" %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -34,7 +34,7 @@
|
||||
<% end %>
|
||||
<p class="control-group">
|
||||
<%= label_tag(locale, t("gallery.album_desc")) %>
|
||||
<%= desc.text_field locale %>
|
||||
<%= desc.text_field locale, :class => "input-xlarge" %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Vendored
+1
-3
@@ -1,8 +1,7 @@
|
||||
<div id="tags" class="clear">
|
||||
<%= render :partial => 'category', :collection => @categorylist %>
|
||||
</div>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<div style="margin:0;padding:0;display:inline">
|
||||
<div class="form-actions form-fixed form-inline pagination-right">
|
||||
<%= form_for @new_category, :url => {:action => "create"}, :remote => true do |f| %>
|
||||
<%= f.fields_for :name_translations do |name| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
@@ -12,7 +11,6 @@
|
||||
<% end %>
|
||||
<%= f.submit t("gallery.save"), :class=> "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var deleteCategory = function(a){
|
||||
|
||||
@@ -30,3 +30,5 @@ zh_tw:
|
||||
search_tags: 搜尋標籤
|
||||
cover: 封面
|
||||
set_cover: 設為封面
|
||||
sure?: "你確定嗎?"
|
||||
no_description: 沒有描述
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
<!-- <form class="form-horizontal"> -->
|
||||
<%= form_for @newlocation, :url=>{:action => "create"}, :remote => true, :class=>"form-horizontal" do |f| %>
|
||||
<div class="control-group">
|
||||
|
||||
vendor/built_in_modules/page_content/app/helpers/panel/page_content/back_end/page_contexts_helper.rb
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
module Panel::PageContent::BackEnd::PageContextsHelper
|
||||
include ActionView::Helpers::UrlHelper
|
||||
|
||||
|
||||
def show_page_context_edit_auth_link(page_context)
|
||||
type = 'Edit'
|
||||
# debugger
|
||||
# a=1
|
||||
oa = page_context.get_object_auth_by_title(type)
|
||||
if oa.nil?
|
||||
page_context.object_auths.new(title: type ).save rescue
|
||||
oa = page_context.get_object_auth_by_title(type)
|
||||
end
|
||||
# link_to t(:category_auth), edit_admin_object_auth_path(oa)
|
||||
link_to t(:category_auth),admin_object_auth_ob_auth_path(oa)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user