Skip to content

Commit

Permalink
Dynamic description in head.
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Jan 4, 2012
1 parent 7ddaca7 commit f81c6b9
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 7 deletions.
5 changes: 5 additions & 0 deletions topic.py
Expand Up @@ -411,6 +411,11 @@ def get(self, topic_num):
can_edit = False
can_move = False
if topic:
if topic.content:
template_values['page_description'] = topic.content[:60] + ' - ' + topic.member.username
else:
template_values['page_description'] = topic.title[:60] + ' - ' + topic.member.username
template_values['page_description'] = template_values['page_description'].replace("\r\n", " ")
if member:
if member.level == 0:
can_edit = True
Expand Down
2 changes: 1 addition & 1 deletion tpl/desktop/advertise.html
Expand Up @@ -69,7 +69,7 @@ <h1 style="padding-top: 0px;">在 V2EX 投放广告</h1>
<div class="cell">
<div class="sep20"></div>
<div align="center">
<span class="fade bigger">广告以按天买断方式进行销售,上线测试期间优惠价格 100 RMB or 15 USD 一天</span>
<span class="fade bigger">广告以按天买断方式进行销售,上线测试期间优惠价格 150 RMB or 25 USD 一天</span>
<div class="sep20"></div>
<a href="mailto:hello@v2ex.com?subject=广告投放咨询" class="super normal button">我要投放</a>
</div>
Expand Down
8 changes: 7 additions & 1 deletion tpl/desktop/advertisers.html
Expand Up @@ -19,10 +19,16 @@
<h1 style="padding-top: 0px;">Advertisers</h1>
<span class="bigger fade">感谢你们对这里的支持,帮助了 V2EX 能够持续存在并发展。</span>
</div>
<div class="cell">
<strong>Promoted by <a href="http://www.3cpeijian.com/" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', '3cpeijian.com');">3C 配件网</a></strong>
<div clas="sep5"></div>
<strong class="fade">Reserved</strong>
<div class="sep5"></div>
</div>
<div class="cell">
<strong>Promoted by <a href="http://www.appletuan.com/?utm_source=v2ex&utm_medium=banner&utm_campaign=V2EX" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'appletuan.com');">苹果团</a></strong>
<div clas="sep5"></div>
<strong class="green">Reserved from 12/1 to 12/31, 2011</strong>
<strong class="fade">Reserved from 12/1 to 12/31, 2011</strong>
<div class="sep5"></div>
苹果团是一个走精品路线的苹果购机社区,目标是为大家打造一个真正值得信任的购机平台。
<div class="sep20"></div>
Expand Down
2 changes: 1 addition & 1 deletion tpl/desktop/common/bottom.html
@@ -1,7 +1,7 @@
<div id="Bottom">
<div id="BottomMain"><div class="fr" align="right"><a href="http://www.linode.com/?r=af313ea8a6bb6f99aff800c67349cabbfee2682f" target="_blank"><img src="/static/img/linode.png" border="0" alt="Linode" /></a><div class="sep10"></div><strong><a href="http://www.linode.com/?r=af313ea8a6bb6f99aff800c67349cabbfee2682f" target="_blank">Linode - 互联网上最好的云主机</a></strong>
</div>
<strong><a href="/about" class="dark">关于</a></strong> &nbsp; | &nbsp; <strong><a href="/faq" class="dark">FAQ</a></strong> &nbsp; | &nbsp; <strong><a href="/mission" class="dark">我们的愿景</a></strong> &nbsp; | &nbsp; <strong><a href="http://picky.olivida.com/" class="dark" target="_blank">博客</a></strong> &nbsp; | &nbsp; <strong><a href="/advertise" class="dark">广告投放</a></strong> &nbsp; | &nbsp; <strong><a href="https://workspace.v2ex.com/" class="dark" target="_blank">{{ l10n.workspace }}</a></strong> &nbsp; | &nbsp; <strong><a href="http://www.v2ex.com/start" class="dark" target="_blank">上网首页</a></strong>
<strong><a href="/about" class="dark">关于</a></strong> &nbsp; | &nbsp; <strong><a href="/faq" class="dark">FAQ</a></strong> &nbsp; | &nbsp; <strong><a href="/mission" class="dark">我们的愿景</a></strong> &nbsp; | &nbsp; <strong><a href="/advertise" class="dark">广告投放</a></strong> &nbsp; | &nbsp; <strong><a href="https://workspace.v2ex.com/" class="dark" target="_blank">{{ l10n.workspace }}</a></strong> &nbsp; | &nbsp; <strong><a href="http://www.v2ex.com/start" class="dark" target="_blank">上网首页</a></strong>
<div class="sep10"></div>
<div class="sep5"></div>
<span class="fade">{{ site.description }}</span>
Expand Down
5 changes: 5 additions & 0 deletions tpl/desktop/common/head.html
Expand Up @@ -26,4 +26,9 @@
</script>
{% endif %}
{{ site.meta }}
{% if page_description %}
<meta name="description" content="{{ page_description|escape }}" />
{% else %}
<meta name="description" content="{{ site.title }} - {{ site.description }}" />
{% endif %}
</head>
2 changes: 1 addition & 1 deletion tpl/desktop/rightbar/ads.html
@@ -1 +1 @@
{% include 'rightbar/ads_appletuan.html' %}
{% include 'rightbar/adsense.html' %}
36 changes: 34 additions & 2 deletions tpl/desktop/signup.html
Expand Up @@ -39,11 +39,13 @@
</script>
<table cellpadding="5" cellspacing="0" border="0">
<tr>
<td width="80" align="right">
<td width="80" align="right" valign="top">
<div class="sep5"></div>
{{ l10n.username }}
</td>
<td width="200" align="left">
<input type="text" class="sl" name="username" value="{{ member_username|escape }}" />
<div class="sep5"></div><span class="fade">请使用半角的 a-z 或数字 0-9</span>
</td>
</tr>
<tr>
Expand All @@ -55,11 +57,13 @@
</td>
</tr>
<tr>
<td width="80" align="right">
<td width="80" align="right" valign="top">
<div class="sep5"></div>
{{ l10n.email }}
</td>
<td width="200" align="left">
<input type="text" class="sl" name="email" value="{{ member_email|escape }}" />
<div class="sep5"></div><span class="fade">请使用真实邮箱注册</span>
</td>
</tr>
<tr>
Expand All @@ -80,6 +84,34 @@
</form>
</div>
</div>
<div class="sep20"></div>
<div class="box">
<div class="cell"><span class="fade">关于注册 V2EX</span></div>
<div class="cell" style="font-size: 13px; line-height: 150%;">
V2EX 是一个创意工作者社区,注册并登录后,你将可以在这里和大家<a href="/go/share" target="_blank">分享你的最新发现</a>,讨论解决各种技术问题,<a href="/go/jobs" target="_blank">寻找合作伙伴</a><a href="/go/create" target="_blank">展示你的作品</a>,任意的<a href="/go/random" target="_blank">奇思妙想</a>,及更多<a href="/planes" target="_blank">等待你去发现的惊喜</a>。以下是在注册及将来的使用过程中你需要知道的几点:<br /><br />

<strong>请用真实邮箱注册</strong><br /><br />

这样如果将来你忘记了密码,那么找回密码的链接将可以被发送到你的注册邮箱。因此使用真实邮箱注册非常重要。<br /><br />

<strong>V2EX 没有灌水</strong><br /><br />

我们反对中文互联网中的常见无信息量行为,如「沙发」,「顶」,「路过」,「不懂」等。我们希望这里的信息是能够持续帮助到别人的,而不是无意义的宣泄。<br /><br />

当你在回复别人的问题时,如果你不知道确切答案,那么请不要添加无意义的回复,比如「去搜索一下」,「我也不知道」,「学习了」之类。<br /><br />

<strong>V2EX 严格禁止讨论如何获得盗版</strong><br /><br />

请不要在 V2EX 讨论如何获得盗版软件、音乐、电影或游戏。所有此类话题会在第一时间被删除。<br /><br />

<strong>V2EX Workspace</strong><br /><br />

你的 V2EX 帐号同时可以在 <a href="https://workspace.v2ex.com/" target="_blank">V2EX Workspace</a> 登录,这是一个用于小团队的信息分享和整理工具。
</div>
<div class="inner" style="text-align: center; font-family: 'Big Caslon'; font-size: 20px; color: #393; padding: 20px 10px 20px 10px;">
Code is serendipity.
</div>
</div>
</div>
<div class="c"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion v2ex/templatetags/filters.py
Expand Up @@ -108,7 +108,7 @@ def youtube(value):
if (len(videos) > 0):
for video in videos:
video_id = re.findall('http://www.youtube.com/watch\?v=([a-zA-Z0-9\-\_]+)', video)
value = value.replace('http://www.youtube.com/watch?v=' + video_id[0], '<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/' + video_id[0] + '?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + video_id[0] + '?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>')
value = value.replace('http://www.youtube.com/watch?v=' + video_id[0], '<object width="620" height="500"><param name="movie" value="http://www.youtube.com/v/' + video_id[0] + '?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + video_id[0] + '?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="620" height="500"></embed></object>')
return value
else:
return value
Expand Down

0 comments on commit f81c6b9

Please sign in to comment.