summaryrefslogtreecommitdiffstats
path: root/app/views/common
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-08-27 06:40:59 +0000
committerGo MAEDA <maeda@farend.jp>2023-08-27 06:40:59 +0000
commit4e0bb4990ca4422c0d54b4cf1707a4025989b64f (patch)
treecbef1701962cdbb60dded88ff1bc80eb69646dc8 /app/views/common
parent6653f60d7454aa927840eced55b20bde77adbc16 (diff)
downloadredmine-4e0bb4990ca4422c0d54b4cf1707a4025989b64f.tar.gz
redmine-4e0bb4990ca4422c0d54b4cf1707a4025989b64f.zip
Display calendar in vertical list layout on mobile screens (#33682).
Patch by Takashi Kato. git-svn-id: https://svn.redmine.org/redmine/trunk@22283 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/common')
-rw-r--r--app/views/common/_calendar.html.erb73
1 files changed, 31 insertions, 42 deletions
diff --git a/app/views/common/_calendar.html.erb b/app/views/common/_calendar.html.erb
index 63cb43c97..533ed2c4d 100644
--- a/app/views/common/_calendar.html.erb
+++ b/app/views/common/_calendar.html.erb
@@ -1,48 +1,37 @@
<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%>
<%= hidden_field_tag 'back_url', url_for(:params => request.query_parameters), :id => nil %>
-<table class="cal">
-<thead>
- <tr>
- <th scope="col" title="<%= l(:label_week) %>" class="week-number"></th>
- <% 7.times do |i| %>
- <th scope="col"><%= day_name((calendar.first_wday + i) % 7) %></th>
- <% end %>
- </tr>
-</thead>
-<tbody>
-<tr>
-<% day = calendar.startdt %>
-<% while day <= calendar.enddt %>
- <% if day.cwday == calendar.first_wday %>
- <td class='week-number' title='<%= l(:label_week) %>'>
- <%= (day + (11 - day.cwday) % 7).cweek %>
- </td>
+<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 %>
-<td class="<%= calendar_day_css_classes(calendar, day) %>">
-<p class="day-num"><%= day.day %></p>
-<% calendar.events_on(day).each do |i| %>
- <% if i.is_a? Issue %>
- <div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip hascontextmenu">
- <%= "#{i.project} -" unless @project && @project == i.project %>
- <%= link_to_issue i, :truncate => 30 %>
- <span class="tip"><%= render_issue_tooltip i %></span>
- <%= check_box_tag 'ids[]', i.id, false, :style => 'display:none;', :id => nil %>
- </div>
- <% else %>
- <span class="icon icon-package">
- <%= "#{i.project} -" unless @project && @project == i.project %>
- <%= link_to_version i %>
- </span>
+ <% 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"><%= day.day %>
+ <span class="abbr-day">(<%= abbr_day_name(day.cwday) %>)</span>
+ </p>
+ <% calendar.events_on(day).each do |i| %>
+ <% if i.is_a? Issue %>
+ <%= tag.div class: [ i.css_classes, 'tooltip hascontextmenu', starting: day == i.start_date, ending: day == i.due_date] do %>
+ <%= "#{i.project} -" unless @project && @project == i.project %>
+ <%= link_to_issue i, :truncate => 30 %>
+ <span class="tip"><%= render_issue_tooltip i %></span>
+ <%= check_box_tag 'ids[]', i.id, false, :style => 'display:none;', :id => nil %>
+ <% end %>
+ <% else %>
+ <span class="icon icon-package">
+ <%= "#{i.project} -" unless @project && @project == i.project %>
+ <%= link_to_version i %>
+ </span>
+ <% end %>
+ <% end %>
+ </li>
+ <% end %>
<% end %>
-<% end %>
-</td>
-<% if day.cwday==calendar.last_wday and day!=calendar.enddt %>
- </tr><tr>
-<% end %>
-<% day = day + 1 %>
-<% end %>
-</tr>
-</tbody>
-</table>
+</ul>
<% end %>
<%= context_menu %>