Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Truncate calendar entries after a certain length.
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Dec 17, 2012
1 parent d6cb96a commit 26f13a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,5 +1,6 @@
*~
.*.swp
.sw[op]
.*.sw[op]
build
*.db
dist
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -71,7 +71,7 @@ def main():
"SQLAlchemy>=0.6.6",
"sqlalchemy-migrate>=0.6.1",
"SimpleJSON>=1.7",
"parsedatetime==0.8.6",
"parsedatetime>=0.8.6",
"ipaddr",
],

Expand Down
11 changes: 6 additions & 5 deletions synoptic/__init__.py
Expand Up @@ -855,14 +855,10 @@ def http_reorder_item(self, request):
# {{{ calendar

def http_calendar(self, request):
versions = self.get_itemversions_for_request(request)

from html import calendar_page
return request.respond(calendar_page({}))

def http_mobile_calendar(self, request):
versions = self.get_itemversions_for_request(request)

from html import mobile_calendar_page
return request.respond(mobile_calendar_page({}))

Expand Down Expand Up @@ -913,10 +909,15 @@ def http_calendar_data(self, request):
start = item_ver.start_date
end = item_ver.end_date

contents = item_ver.contents

if len(contents) > 40:
contents = contents[:40] + "..."

from urllib import quote
data.append(dict(
id=item_ver.id,
title=item_ver.contents,
title=contents,
start=start,
end=end,
allDay=item_ver.all_day,
Expand Down

0 comments on commit 26f13a6

Please sign in to comment.