This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a sidebar placeholder and load content with javascript.
When a reddit page is loaded the side bar contains placeholders for recent comments and posts. If javascript is off then a link may be followed and if javascript is on then the content of the side box will be replaced with the response from an ajax request. This prevents google indexing rapidly changing sidebar content.
- Loading branch information
Darius Powell
committed
Apr 14, 2009
1 parent
f4749e0
commit 4a3ae0a
Showing
6 changed files
with
102 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
<%namespace file="utils.html" import="plain_link"/> | ||
<div id="side-posts" class="sidebox"> | ||
<h2> | ||
${plain_link(_('Recent Posts'), '/recentposts')}: | ||
</h2> | ||
<% | ||
t = thing.things | ||
article_generator = t.item_iter(t.get_items()) | ||
%> | ||
%for a in article_generator: | ||
<div class="reddit-link"> | ||
${a.render()} | ||
</div> | ||
%endfor: | ||
</div> | ||
<h2> | ||
${plain_link(_('Recent Posts'), '/recentposts')}: | ||
</h2> | ||
<% | ||
t = thing.things | ||
article_generator = t.item_iter(t.get_items()) | ||
%> | ||
%for a in article_generator: | ||
<div class="reddit-link"> | ||
${a.render()} | ||
</div> | ||
%endfor: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
<%namespace file="utils.html" import="plain_link"/> | ||
<div id="side-comments" class="sidebox"> | ||
<h2> | ||
${plain_link(_('Recent Comments'), '/comments')}: | ||
</h2> | ||
<% | ||
t = thing.things | ||
comment_generator = t.item_iter(t.get_items()) | ||
%> | ||
%for a in comment_generator: | ||
<div class="inline-comment"> | ||
${a.render()} | ||
</div> | ||
%endfor: | ||
</div> | ||
<h2> | ||
${plain_link(_('Recent Comments'), '/comments')}: | ||
</h2> | ||
<% | ||
t = thing.things | ||
comment_generator = t.item_iter(t.get_items()) | ||
%> | ||
%for a in comment_generator: | ||
<div class="inline-comment"> | ||
${a.render()} | ||
</div> | ||
%endfor: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## The contents of this file are subject to the Common Public Attribution | ||
## License Version 1.0. (the "License"); you may not use this file except in | ||
## compliance with the License. You may obtain a copy of the License at | ||
## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public | ||
## License Version 1.1, but Sections 14 and 15 have been added to cover use of | ||
## software over a computer network and provide for limited attribution for the | ||
## Original Developer. In addition, Exhibit A has been modified to be consistent | ||
## with Exhibit B. | ||
## | ||
## Software distributed under the License is distributed on an "AS IS" basis, | ||
## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for | ||
## the specific language governing rights and limitations under the License. | ||
## | ||
## The Original Code is Reddit. | ||
## | ||
## The Original Developer is the Initial Developer. The Initial Developer of | ||
## the Original Code is CondeNet, Inc. | ||
## | ||
## All portions of the code written by CondeNet are Copyright (c) 2006-2008 | ||
## CondeNet, Inc. All Rights Reserved. | ||
################################################################################ | ||
|
||
<%namespace file="utils.html" import="plain_link"/> | ||
<div id="${thing.node_id}" class="sidebox"> | ||
<h2> | ||
${plain_link(thing.link_text, thing.link_path)} | ||
</h2> | ||
</div> |