|
37 | 37 | </div>
|
38 | 38 | <% end %>
|
39 | 39 |
|
40 |
| - <%= form_with(url: dojos_path, method: :get, local: true, style: 'margin-top: 15px;') do |f| %> |
41 |
| - <div style="display: flex; align-items: center; justify-content: center; gap: 10px;"> |
42 |
| - <%= label_tag :year, '対象期間:', style: 'font-weight: bold;' %> |
43 |
| - <%= select_tag :year, |
44 |
| - options_for_select( |
45 |
| - (2012..Date.current.year).to_a.reverse.map { |y| [y.to_s + '年', y] }, |
46 |
| - params[:year] |
47 |
| - ), |
48 |
| - include_blank: '全期間', |
49 |
| - style: 'padding: 5px; border: 1px solid #ced4da; border-radius: 4px;' %> |
50 |
| - |
51 |
| - <%= button_tag type: 'submit', style: 'padding: 5px 15px; background: #17a2b8; color: white; border: none; border-radius: 4px; cursor: pointer;' do %> |
52 |
| - 表示 |
53 |
| - <% end %> |
54 |
| - |
55 |
| - <%= link_to 'CSV', dojos_path(format: :csv, year: params[:year]), |
56 |
| - style: 'padding: 5px 15px; background: #28a745; color: white; text-decoration: none; border-radius: 4px;' %> |
57 |
| - |
58 |
| - <%= link_to 'JSON', dojos_path(format: :json, year: params[:year]), |
59 |
| - style: 'padding: 5px 15px; background: #6c757d; color: white; text-decoration: none; border-radius: 4px;' %> |
60 |
| - </div> |
61 |
| - <% end %> |
| 40 | + <div style="display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 15px;"> |
| 41 | + <%= label_tag :year, '対象期間:', style: 'font-weight: bold;' %> |
| 42 | + <%= select_tag :year, |
| 43 | + options_for_select( |
| 44 | + (2012..Date.current.year).to_a.reverse.map { |y| [y.to_s + '年', y] }, |
| 45 | + params[:year] |
| 46 | + ), |
| 47 | + include_blank: '全期間', |
| 48 | + onchange: "window.location.href = '#{dojos_path}?year=' + this.value", |
| 49 | + style: 'padding: 5px; border: 1px solid #ced4da; border-radius: 4px; cursor: pointer;' %> |
| 50 | + |
| 51 | + <%= link_to 'CSV', dojos_path(format: :csv, year: params[:year]), |
| 52 | + style: 'padding: 5px 15px; background: #28a745; color: white; text-decoration: none; border-radius: 4px;' %> |
| 53 | + |
| 54 | + <%= link_to 'JSON', dojos_path(format: :json, year: params[:year]), |
| 55 | + style: 'padding: 5px 15px; background: #6c757d; color: white; text-decoration: none; border-radius: 4px;' %> |
| 56 | + </div> |
62 | 57 |
|
63 | 58 | <p style="font-size: smaller; color: #6c757d; margin-top: 15px;">
|
64 | 59 | 対象期間を選択すると、その時点のアクティブな道場の一覧を表示・ダウンロードできます。
|
|
0 commit comments