• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

news4 - RSS aggrigation system


Commit MetaInfo

Révisioncbfaa6f56aceda7d0c1aa1c79ada4c1fb6f6c49a (tree)
l'heure2012-10-27 04:59:50
Auteurhylom <hylom@hylo...>
Commiterhylom

Message de Log

add thumnail to each stories

Change Summary

Modification

--- a/css/gnews.css
+++ b/css/gnews.css
@@ -10,6 +10,14 @@ a {
1010 margin-bottom: 1em;
1111 }
1212
13+.entry-header .thumbnail {
14+ width: 100px;
15+ float: right;
16+ margin-left: 10px;
17+ margin-bottom: 10px;
18+ pagging: 1px;
19+}
20+
1321 .entry-continue {
1422 margin-bottom: 1em;
1523 }
--- /dev/null
+++ b/filters/remove_tracker.py
@@ -0,0 +1,15 @@
1+# remove images for tracking
2+# -*- coding: utf-8 -*-
3+
4+import re
5+
6+re_rssad_url = re.compile(r'^http://rss.rssad.jp/')
7+
8+def entry_filter(entry):
9+ if "images" in entry:
10+ for i in range(len(entry["images"])):
11+ if re_rssad_url.search(entry["images"][i]):
12+ entry["images"].pop(i)
13+
14+ return entry
15+
--- a/templates/index.tmpl.html
+++ b/templates/index.tmpl.html
@@ -46,6 +46,9 @@
4646 <div class="entry">
4747 <!-- ヘッダ -->
4848 <div class="entry-header">
49+ % if 'images' in entry and len(entry.images) > 0:
50+ <img class="thumbnail" src="${entry.images[0]}">
51+ % endif
4952 <h3>
5053 <a href='${entry.link}' target="_blank_">${entry.title}</a>
5154 </h3>
@@ -53,7 +56,9 @@
5356
5457
5558 <!-- 本文テキスト -->
56- <div class="entry-body">${entry.body}</div>
59+ <div class="entry-body">
60+ ${entry.body}
61+ </div>
5762
5863 <!-- フッタ -->
5964 <div class="entry-footer">
@@ -67,12 +72,6 @@
6772 % for tag in entry.tags:
6873 <span>${tag} </span>
6974 % endfor
70- % if 'images' in entry:
71- <span>画像:</span>
72- % for imgurl in entry.images:
73- <span><a href="${imgurl}">*</a></span>
74- % endfor
75- % endif
7675 </div>
7776 </div>
7877 </div>