|
18 | 18 | <br> |
19 | 19 | <div class='form__terms list'> |
20 | 20 | <ul style='list-style-type: "\2713\0020"; font-size: smaller;'> |
21 | | - <li>「掲載日」は<%= link_to '統計情報 (道場別) ', dojos_path %> と同じロジックで表示しています。</li> |
22 | 21 | <li>「記録日」は<%= link_to '統計情報 (開催数)', stats_path %> や活動の確認/記録日を表示しています。</li> |
23 | 22 | <li>「記録日」は <a href='https://doorkeeper.jp/'>Doorkeeper</a> と <a href='http://connpass.com/'>connpass</a> の場合、自動で更新されます。</li> |
| 23 | + <li>「経過日」は記録日からの経過日数(<%= link_to '閾値', signup_path(anchor: 'terms') %>の確認用)を表示しています。</li> |
24 | 24 | </ul> |
25 | 25 | </div> |
26 | 26 | </p> |
|
38 | 38 | </th> |
39 | 39 | <th> |
40 | 40 | <small> |
41 | | - 🗾 |
| 41 | + 🗓 |
42 | 42 | <br class='ignore-pc'> |
43 | | - <%= link_to '掲載日', signup_path %> |
| 43 | + <a href='<%= events_path %>'>記録日</a> |
44 | 44 | </small> |
45 | 45 | </th> |
46 | 46 | <th> |
47 | 47 | <small> |
48 | | - 🗓 |
| 48 | + ⏱️ |
49 | 49 | <br class='ignore-pc'> |
50 | | - <a href='<%= events_path %>'>記録日</a> |
| 50 | + <%= link_to '経過日', signup_path(anchor: 'terms') %> |
51 | 51 | </small> |
52 | 52 | </th> |
53 | 53 | <th> |
|
82 | 82 | <% end %> |
83 | 83 | </small> |
84 | 84 | </td> |
85 | | - <td class="<%= 'inactive-item' unless dojo[:is_active] %>"> |
86 | | - <small><%= dojo[:created_at].strftime("%Y-%m-%d") %></small> |
87 | | - </td> |
88 | 85 | <td class="<%= 'inactive-item' unless dojo[:is_active] %>"> |
89 | 86 | <small> |
90 | 87 | <% if dojo[:note_date] && dojo[:latest_event_at] %> |
|
128 | 125 | <% end %> |
129 | 126 | </small> |
130 | 127 | </td> |
| 128 | + <td class="<%= 'inactive-item' unless dojo[:is_active] %>"> |
| 129 | + <small> |
| 130 | + <% |
| 131 | + # 記録日を決定(note_date と latest_event_at のより新しい方) |
| 132 | + record_date = nil |
| 133 | + if dojo[:note_date] && dojo[:latest_event_at] |
| 134 | + record_date = dojo[:note_date] > dojo[:latest_event_at] ? dojo[:note_date] : dojo[:latest_event_at] |
| 135 | + elsif dojo[:note_date] |
| 136 | + record_date = dojo[:note_date] |
| 137 | + elsif dojo[:latest_event_at] |
| 138 | + record_date = dojo[:latest_event_at] |
| 139 | + end |
| 140 | + |
| 141 | + if record_date |
| 142 | + # 経過日数を計算 |
| 143 | + days_passed = (Date.current - record_date.to_date).to_i |
| 144 | + expired = days_passed >= 365 && !dojo[:note]&.include?('Active') |
| 145 | + %> |
| 146 | + <span class="<%= 'expired' if expired %>"> |
| 147 | + <%= days_passed %> 日 |
| 148 | + </span> |
| 149 | + <% else %> |
| 150 | + <!-- 記録日がない場合 --> |
| 151 | + <span style="color: #999;">-</span> |
| 152 | + <% end %> |
| 153 | + </small> |
| 154 | + </td> |
131 | 155 | <td class="<%= 'inactive-item' unless dojo[:is_active] %>"> |
132 | 156 | <small><small> |
133 | 157 | <% search_query = URI.encode_www_form(q: "CoderDojo #{dojo[:name].split('@').first.strip}") %> |
|
0 commit comments