* planet/__init__.py, gezegen/index.html.tmpl, gezegen/gezegen.py,

www/common.js, www/jquery-1.2.6.min.js: reverted most of the changes that i've
done for #2..
* gezegen/config.ini: pushed the new config to the code base..
This commit is contained in:
Alper Kanat 2008-11-14 21:55:57 +00:00
parent f005d17030
commit 6adfdfb340
6 changed files with 17 additions and 108 deletions

View File

@ -14,7 +14,6 @@ days_per_page = 0
feed_timeout = 15
encoding = utf-8
locale = tr_TR.UTF-8
limit_per_entry = 1500
date_format = %d %b %Y @ %I:%M %p
#date_format = %B %d, %Y %I:%M %p
@ -66,12 +65,18 @@ face = alierdinckoroglu.png
#email = isingor@gmail.com
#jabber = aisingor@jabber.uludag.org.tr
[http://feeds.feedburner.com/raptiye/acikkaynak/]
[http://feeds.feedburner.com/raptiyeorg]
name = Alper Kanat
face = alperkanat.png
#email = tunix@raptiye.org
#jabber = tunix@jabber.org
[http://blog.oguz.biz/category/gezegen/rss]
name = Alper Oğuz
face =
#email = Alper Oguz <alper@fisek.net>
#jabber =
[http://www.murekkep.org/wp-feed.php?category_name=bilisim&author_name=admin&feed=rss2]
name = Alper Orus
#email = alperor@linux-sevenler.org
@ -187,7 +192,7 @@ name = Gökdeniz Karadağ
#email = gokdeniz@ceng.metu.edu.tr
[http://cekirdek.pardus.org.tr/~gokmen/zangetsu/blog/feed/rss/Gezegen/]
[http://blog.ratonred.com/tag/gezegen-linux/feed]
name = Gökmen Göksel
face = gokmengoksel.png
#email = gokmen@pardus.org.tr
@ -371,7 +376,7 @@ name= Talat Uyarer
#email = talat@uyarer.com
#jabber= uyarertalat@gmail.com
[http://taybuga.blogspot.com/feeds/posts/default/-/açık standartlar]
[http://feeds.feedburner.com/tayfurtaybua]
name= Tayfur Taybuğa
face = tayfurtaybuga.png
#email = taybuga@gmail.com
@ -529,3 +534,6 @@ name = LKD.org.tr
name = FTP ekibi
#email = ftp@linux.org.tr
[http://murattikil.blogspot.com/feeds/posts/default]
name = Murat TİKİL
#email = murattikil@gmail.com

View File

@ -1,25 +0,0 @@
#-*- encoding: utf8 -*-
"""
The purpose of this file is to store some common Python functions
that we can use everywhere inside the code..
Author: Alper KANAT <alperkanat@raptiye.org>
"""
def summarize(text, limit=0):
"""
Removes all HTML tags and cuts the text by limit
text (string): blog entry that needs to be summarized
limit (int): number of characters that the summary can include
"""
import re
regex = re.compile("<[^<>]*?>")
if limit > 0 and text.__len__() >= limit:
return regex.sub("", text)[:limit] + " [...]"
return regex.sub("", text)

View File

@ -9,8 +9,6 @@
<link rel="stylesheet" href="bloggers.css" type="text/css" />
<link rel="icon" type="image/png" href="images/planet.png" />
<link rel="alternate" type="application/rss+xml" title="<TMPL_VAR name>" href="rss20.xml" />
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="common.js"></script>
</head>
<body>
<div id="hdr">
@ -65,22 +63,7 @@
</div>
<br />
<div class="post-contents">
<TMPL_IF read_the_rest>
<div id="summary_<TMPL_VAR id_hash>">
<TMPL_VAR summary>
</div>
<div id="content_<TMPL_VAR id_hash>" style="display: none">
<TMPL_VAR content>
</div>
<br>
<a href="#" id="toggle_content_<TMPL_VAR id_hash>" onclick="toggleEntry(this.id.split('_')[2]); return false;">
Bu yazının devamını okumak için tıklayın.
</a>
<TMPL_ELSE>
<div id="content_<TMPL_VAR id_hash>">
<TMPL_VAR content>
</div>
</TMPL_IF>
<br />
<br />
<div id="post-links" style="text-align: center;">
@ -157,10 +140,10 @@
<div class="section">
<h3>Takip edin</h3>
<ul>
<li><a href="<TMPL_VAR link>/rss20.xml">RSS 2.0</a></li>
<li><a href="<TMPL_VAR link>/rss10.xml">RSS 1.0</a></li>
<li><a href="<TMPL_VAR link>/foafroll.xml">FOAF</a></li>
<li><a href="<TMPL_VAR link>/opml.xml">OPML</a></li>
<li><a href="rss20.xml">RSS 2.0</a></li>
<li><a href="rss10.xml">RSS 1.0</a></li>
<li><a href="foafroll.xml">FOAF</a></li>
<li><a href="opml.xml">OPML</a></li>
</ul>
</div>

View File

@ -279,18 +279,6 @@ class Planet:
# Gather item information
# Use summary to summarize the entry to N characters and
# put a JS link inside to expand and show the content..
from gezegen import gezegen
# getting the limit from the config.ini file
limit_per_entry = int(self.tmpl_config_get("Planet", "limit_per_entry", 1500))
for item in items_list:
if item["content"].__len__() >= limit_per_entry:
item["summary"] = gezegen.summarize(item["content"], limit_per_entry)
item["read_the_rest"] = True
# Process the template
tp = htmltmpl.TemplateProcessor(html_escape=0)
tp.set("Items", items_list)

View File

@ -1,13 +0,0 @@
var entries = []
function toggleEntry(id) {
if ($("#summary_" + id).css("display") == "none") {
// change the link text
$("#toggle_content_" + id).text("Bu yazının devamını okumak için tıklayın.")
} else {
// change the link text
$("#toggle_content_" + id).text("Bu yazının devamını kapatmak için tıklayın.")
}
$("#content_" + id).slideToggle()
$("#summary_" + id).slideToggle()
}

File diff suppressed because one or more lines are too long