Skip to content

Commit 9086f12

Browse files
committed
Enable auto-linkin in events#latest notes
1 parent caa53ea commit 9086f12

File tree

3 files changed

+93
-68
lines changed

3 files changed

+93
-68
lines changed

app/views/dojos/show.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
text-align: center;
4747
}
4848
</style>
49+
4950
<div style="margin-top: 20px;" align="center">
5051
<% if @event_histories.any? %>
5152
<table border="1">

app/views/events/latest.html.erb

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<% provide(:title, '道場情報 - 直近の開催日まとめ') %>
2+
<% provide(:desc, '道場別の直近開催日をまとめたページです。') %>
3+
<% provide(:url, @url) %>
4+
<% provide(:meta_image, '/img/ogp-events.jpeg') %>
5+
6+
<section class="cover">
7+
<%= lazy_image_tag('/events_cover.jpg', alt: 'Cover Photo on Upcoming Events', min: true) %>
8+
</section>
9+
10+
<section id="events" class="text-center" style="margin-bottom: 100px;">
11+
<br />
12+
<h1>☯️ 道場別の直近の開催日まとめ</h1>
13+
<br />
14+
<p style="margin: 0 0px 40px 10px; line-height: 1.5em;">
15+
主にデータ分析や
16+
<a href="/signup#terms-of-use">Active/Inactive</a>
17+
の判断などの用途で使われています。<br /><br />
18+
19+
<small>
20+
21+
<%= link_to '近日開催', events_path %>
22+
のデータは含まず、
23+
<%= link_to '過去開催', stats_path %>
24+
のデータを使っています。<br />
25+
26+
<code>2000-01-23</code>
27+
は個別にイベント管理している Dojo となります。<br />
28+
29+
<code>📝 ノート</code>
30+
は確認時のメモです。on-mouse で全文が見れます。
31+
</small>
32+
</p>
33+
34+
<style type="text/css">
35+
/* URL 用のセルにクラスを付けておく想定 */
36+
table { table-layout: auto; }
37+
td {
38+
padding: 1px 10px 1px 10px;
39+
text-align: right;
40+
}
41+
td.url-cell {
42+
white-space: normal; /* 改行を許可 */
43+
word-wrap: break-word; /* 古めのブラウザ向け */
44+
overflow-wrap: break-word; /* 新しめのブラウザ向け */
45+
word-break: break-all; /* 英数字が続く場合の保険 (必要に応じて) */
46+
text-align: left;
47+
}
48+
th {
49+
padding: 10px;
50+
text-align: center;
51+
}
52+
</style>
53+
54+
<div style="margin-top: 20px;" align="center">
55+
<table border="1">
56+
<tr>
57+
<th>
58+
<small>☯️ 道場名</small>
59+
</th>
60+
<th>
61+
<small>🗓 直近の開催日</small>
62+
</th>
63+
<th>
64+
<small>📝 ノート</small>
65+
</th>
66+
</tr>
67+
<% @latest_event_by_dojos.each do |dojo| %>
68+
<tr>
69+
<td>
70+
<small>
71+
<a href="<%= dojo[:url] %>"><%= dojo[:name] %></a>
72+
</small>
73+
</td>
74+
<td>
75+
<small>
76+
<% if dojo[:event_url].nil? %>
77+
<%= dojo[:event_at] %>
78+
<% else %>
79+
<a href="<%= dojo[:event_url] %>"><%= dojo[:event_at] %></a>
80+
<% end %>
81+
</small>
82+
</td>
83+
<td class="url-cell">
84+
<small>
85+
<span title="<%= dojo[:note] %>"><%= raw Rinku.auto_link(dojo[:note]) %></span>
86+
</small>
87+
</td>
88+
</tr>
89+
<% end %>
90+
</table>
91+
</div>
92+
</section>

app/views/events/latest.html.haml

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)