-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathblank.cards.html.erb
More file actions
139 lines (107 loc) · 3.08 KB
/
blank.cards.html.erb
File metadata and controls
139 lines (107 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='generator' content='<%= Pluto.generator %>'>
<title><%= site.title %></title>
<%= stylesheet_link_tag 'css/font-awesome' %>
<%= stylesheet_link_tag 'css/blank.cards' %>
<!-- fix: use script_tag rails-style ??? -->
<script src='js/jquery-2.0.3.min.js'></script>
<script src='js/blank.js'></script>
<%# = javascript_include_tag 'js/jquery-2.0.3.min.js' %>
<%# = javascript_include_tag 'js/blank.js' %>
</head>
<body>
<div id='opts'>
<div style='width: 100%; text-align: right;'>
<img src='i/view-headlines.png' id='show-headlines' title='Show Headlines Only' width='24' height='24'>
<img src='i/view-snippets.png' id='show-snippets' title='Show Snippets' width='24' height='24'>
<img src='i/view-standard.png' id='show-fulltext' title='Show Full Text' width='24' height='24'>
</div>
<div style='width: 100%; text-align: right;'>
Style |
<%= link_to 'Standard', "#{site.key}.html" %> •
<%= link_to 'Cards', "#{site.key}.cards.html" %>
</div>
</div>
<h1>
<%= site.title %>
<span class='small'>
Last Update:
<% if site.updated %>
<%= site.updated.strftime('%A, %d. %B %Y %H:%M') %>
<% end %>
</span>
</h1>
<!-- use a table w/ two colums -->
<table>
<colgroup>
<col width='50%'>
<col width='50%'>
</colgroup>
<tr>
<% site.items.latest.limit(24).to_a.in_columns(2).each do |items| %>
<td valign='top'>
<!-- start new column -->
<% items.each do |item| %>
<article class='item'>
<h4 class='feed-title'>
<span class='feed-title'>
<%= link_to item.feed.title, item.feed.url %>
</span>
<span class='item-published'>
-
<!-- fix/todo: show year if not current year
e.g. use "%b %d, '%y"
-->
<%= item.published.strftime("%b %d") %>
</span>
</h4>
<h3 class='item-title'>
<i class='icon-caret-down item-collapse item-close item-opened'></i>
<i class='icon-caret-right item-expand item-open item-closed'></i>
<span class='item-title'>
<%= link_to item.title, item.url %>
</span>
</h3>
<div class='item-body'>
<div class='item-snippet'>
<!-- use 'smarter' algorithm for cutoff snippet text
note: summary goes first; than try content -->
<% if item.summary %>
<%= textify( item.summary )[0..400] %>
<% elsif item.content %>
<%= textify( item.content )[0..400] %>
<% else %>
-/-
<% end %>
<span class='item-time-ago-in-words'>
<%= time_ago_in_words( item.published ) %>
</span>
</div>
<div class='item-content item-summary'>
<!-- todo: use sanitize or simplify or whitelist
- todo/fix: check why summary can be nil/null
note: content goes first; than try summary
-->
<% if item.content %>
<%= textify( item.content ) %>
<% elsif item.summary %>
<%= textify( item.summary ) %>
<% else %>
-/-
<% end %>
<span class='item-time-ago-in-words'>
<%= time_ago_in_words( item.published ) %>
</span>
</div>
</div> <!-- item-body -->
</article><!-- item -->
<% end %><!-- each item (inside column) -->
</td>
<% end %><!-- each column-->
</tr>
</table>
</body>
</html>