mirror of
https://github.com/rickbarrette/redmine_qbo_calendar.git
synced 2026-10-03 20:40:43 -04:00
114 lines
3.4 KiB
ERB
114 lines
3.4 KiB
ERB
<div class="contextual">
|
|
<%= link_to l(:label_appointment_new, default: 'New Appointment'),
|
|
new_customer_appointment_path,
|
|
class: 'icon icon-add' %>
|
|
</div>
|
|
|
|
<%= form_tag({}, data: { cm_url: issues_context_menu_path }) do %>
|
|
<%= hidden_field_tag 'back_url', url_for(params: request.query_parameters), id: nil %>
|
|
|
|
<ul class="cal">
|
|
<li scope="col" title="<%= l(:label_week) %>" class="calhead week-number"></li>
|
|
|
|
<% 7.times do |i| %>
|
|
<li scope="col" class="calhead">
|
|
<%= day_name((calendar.first_wday + i) % 7) %>
|
|
</li>
|
|
<% end %>
|
|
|
|
<% calendar.format_month.each_slice(7) do |week| %>
|
|
|
|
<li class="week-number">
|
|
<span class="label-week"><%= l(:label_week) %></span>
|
|
<%= calendar.week_number(week.first) %>
|
|
</li>
|
|
|
|
<% week.each do |day| %>
|
|
|
|
<li class="<%= calendar.day_css_classes(day) %> calbody">
|
|
|
|
<p class="day-num">
|
|
<span class="day-value"><%= day.day %></span>
|
|
<span class="abbr-day">(<%= abbr_day_name(day.cwday) %>)</span>
|
|
|
|
<%= link_to sprite_icon('add'),
|
|
new_customer_appointment_path(start_date: day),
|
|
class: 'icon-only icon-add',
|
|
title: l(:label_appointment_new, default: 'New Appointment') %>
|
|
</p>
|
|
|
|
<% calendar.events_on(day).each do |event| %>
|
|
|
|
<% if event.is_a?(Issue) %>
|
|
|
|
<% starting = (day == event.start_date) %>
|
|
<% ending = (day == event.due_date) %>
|
|
|
|
<%= tag.div class: [
|
|
event.css_classes,
|
|
'tooltip',
|
|
'hascontextmenu',
|
|
('starting' if starting),
|
|
('ending' if ending)
|
|
].compact do %>
|
|
|
|
<%= "#{event.project} -" unless @project && @project == event.project %>
|
|
|
|
<%= sprite_icon('bullet-go', rtl: true) if starting && !ending %>
|
|
<%= sprite_icon('bullet-end', rtl: true) if ending && !starting %>
|
|
<%= sprite_icon('bullet-go-end') if starting && ending %>
|
|
|
|
<%= link_to_issue(event, truncate: 30) %>
|
|
|
|
<span class="tip">
|
|
<%= render_issue_tooltip(event) %>
|
|
</span>
|
|
|
|
<%= check_box_tag 'ids[]',
|
|
event.id,
|
|
false,
|
|
style: 'display:none;',
|
|
id: nil %>
|
|
|
|
<% end %>
|
|
|
|
<% elsif event.is_a?(Version) %>
|
|
|
|
<span class="icon icon-package">
|
|
|
|
<%= sprite_icon 'package' %>
|
|
|
|
<%= "#{event.project} -" unless @project && @project == event.project %>
|
|
|
|
<%= link_to_version(event) %>
|
|
|
|
</span>
|
|
|
|
<% elsif event.is_a?(CustomerAppointment) %>
|
|
|
|
<%= render partial: 'customer_appointments/calendar_event',
|
|
locals: {
|
|
appointment: event,
|
|
day: day,
|
|
project: @project
|
|
} %>
|
|
|
|
<% else %>
|
|
|
|
<% Rails.logger.warn("Unknown calendar event: #{event.class}") %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|
|
|
|
<%= context_menu %> |