Permalink
Browse files

Tags on homepage, plus readme.

  • Loading branch information...
1 parent 3bd5d0a commit 6fafbfcb8c92f417567d5c0abd08b95bb9bfe61f @kushal committed Jan 10, 2011
Showing with 39 additions and 3 deletions.
  1. +18 −0 README
  2. +7 −2 main.py
  3. +14 −1 templates/index.html
View
18 README
@@ -0,0 +1,18 @@
+Folks who worked at Google may miss snippets at their current
+employers. Help is at hand.
+
+Every week, the system emails out a reminder email. Users can reply to
+it with what they did that week. Users can follow other users via the
+web, as well as following tags, and assigning tags to themselves. All
+content matching the tags they follow will be mailed to them in a
+digest every Monday afternoon. In addition, archives for each user and
+the most recent data for each tag are visible on the web.
+
+It was hard to make this totally portable. You'll probably want to
+fork and change the application name and hardcoded email addresses,
+creating your own application on app engine with authentication
+restricted to your custom domain. I would love patches to core
+functionality, though.
+
+Little attention has been paid to making his particularly scaleable,
+but it should work for any small or medium company.
View
9 main.py
@@ -165,10 +165,15 @@ def get(self):
raw_users = User.all().order('email').fetch(500)
following = compute_following(user, raw_users)
all_users = [(u, u.email in following) for u in raw_users]
-
+ all_tags = set()
+ for u in raw_users:
+ all_tags.update(u.tags)
+ all_tags = [(t, t in user.tags_following) for t in all_tags]
+
template_values = {
'current_user' : user,
- 'all_users': all_users
+ 'all_users': all_users,
+ 'all_tags': all_tags
}
self.render('index', template_values)
View
15 templates/index.html
@@ -12,7 +12,9 @@
<br/><br/>
my tags <form action="/" method="get"><input name="tags" type="text" value="{{ current_user.tags|join:"," }}"/></form>
-
+ <br/><br/>
+ send your snippets to snippets@fssnippets.appspotmail.com by monday afternoon!
+ <br/><br/>
<h3>Users</h3>
{% for user in all_users %}
<a href="/user/{{ user.0.email }}">{{ user.0.email }}</a>
@@ -23,6 +25,17 @@
{% endif %}
<br/>
{% endfor %}
+ <br/><br/>
+ <h3>Tags</h3>
+ {% for tag in all_tags %}
+ <a href="/tag/{{ tag.0 }}">{{ tag.0 }}</a>
+ {% if tag.1 %}
+ <a class="light" href="/unfollow?tag={{ tag.0 }}&continue=/">unfollow</a>
+ {% else %}
+ <a class="light" href="/follow?tag={{ tag.0 }}&continue=/">follow</a>
+ {% endif %}
+ <br/>
+ {% endfor %}
{% endblock %}

0 comments on commit 6fafbfc

Please sign in to comment.