2022-07-13 04:05:33 +00:00
|
|
|
<script>
|
2022-07-13 07:00:21 +00:00
|
|
|
if(window.calendar_variable == undefined){
|
|
|
|
window.calendar_variable = {};
|
|
|
|
window.calendar_variable.from = "<%=t('calendar.from')%>";
|
|
|
|
window.calendar_variable.to = "<%=t('calendar.to')%>";
|
2022-07-26 04:19:11 +00:00
|
|
|
<% if @calendar_setting && (@calendar_setting.enable rescue false) %>
|
2022-07-13 07:00:21 +00:00
|
|
|
window.calendar_variable.sunday_first = <%=@calendar_setting.sunday_first%>;
|
|
|
|
window.calendar_variable.week_title = <%=@calendar_setting.week_title.to_s.html_safe%>;
|
|
|
|
window.calendar_variable.date_type = <%=@calendar_setting.date_type%>;
|
2022-07-20 14:38:59 +00:00
|
|
|
window.calendar_variable.time_type = <%=@calendar_setting.time_type%>;
|
2022-07-13 07:00:21 +00:00
|
|
|
window.calendar_variable.dayNames = <%=@calendar_setting.days.to_s.html_safe%>;
|
|
|
|
<% if I18n.locale == :zh_tw %>
|
|
|
|
window.calendar_variable.dayNamesShort = <%=@calendar_setting.days.map{|d| d[-1]}.to_s.html_safe%>;
|
|
|
|
<% else %>
|
|
|
|
window.calendar_variable.dayNamesShort = <%=@calendar_setting.days.map{|d| d[0...3]}.to_s.html_safe%>;
|
|
|
|
<% end %>
|
2022-07-13 04:05:33 +00:00
|
|
|
<% end %>
|
2022-07-13 07:00:21 +00:00
|
|
|
}
|
2022-07-26 04:19:11 +00:00
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
<% @calendar_types.each do |c| %>
|
|
|
|
.widget-calendar-1 .w-calendar-table .w-calendar-event[data-calendar-id="<%=c.id%>"]:not(:hover){
|
|
|
|
background: <%= c.color %>;
|
|
|
|
}
|
|
|
|
.widget-calendar-2.w-calendar .w-calendar-table td.w-calendar-event[data-calendar-id="<%=c.id%>"] div{
|
|
|
|
border-color: <%= c.color %>;
|
|
|
|
}
|
|
|
|
.has_event[data-calendar-id="<%=c.id%>"]{
|
|
|
|
background: <%= c.color %>;
|
|
|
|
}
|
|
|
|
.event[data-calendar-id="<%=c.id%>"], .event[data-calendar-id="<%=c.id%>"] a{
|
|
|
|
color: <%= c.color %>;
|
|
|
|
}
|
2022-08-02 13:48:08 +00:00
|
|
|
<% darken_color = CalendarsHelper.lighten_color(c.color, -45) %>
|
|
|
|
.widget-calendar-1 .w-calendar-table .w-calendar-event[data-calendar-id="<%=c.id%>"]:hover, .widget-calendar-1 .w-calendar-table .w-calendar-event[data-calendar-id="<%=c.id%>"].w-calendar-toggle
|
|
|
|
{
|
|
|
|
background: <%= darken_color %>;
|
|
|
|
}
|
|
|
|
.widget-calendar-2.w-calendar table.w-calendar-table td.w-calendar-toggle[data-calendar-id="<%=c.id%>"] div{
|
|
|
|
border-color: <%= darken_color %>;
|
|
|
|
background: <%= darken_color %>;
|
|
|
|
}
|
2022-07-26 04:19:11 +00:00
|
|
|
<% end if @calendar_types %>
|
|
|
|
</style>
|