Skip to content

Commit

Permalink
Require js.fullcalendar>=2.2.5. Use the lang_all_js resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
disko committed Jan 7, 2015
1 parent 7502334 commit 1eaf3f3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ History

- No changes yet.

0.8.2
-----

- Require ``js.fullcalendar>=2.2.5``.
- Use the ``lang_all_js`` resource.

0.8.1 - 2014-11-12
------------------

Expand Down
2 changes: 1 addition & 1 deletion kotti_calendar/templates/calendar-view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</div>

<script type="text/javascript">
$('#fullcalendar').fullCalendar($.extend(${fullcalendar_options}, localOptions));
$('#fullcalendar').fullCalendar(${fullcalendar_options});
</script>

</article>
Expand Down
18 changes: 6 additions & 12 deletions kotti_calendar/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import colander
import datetime
from js.fullcalendar import locales as fullcalendar_locales
from js.fullcalendar import lang_all_js
from kotti.resources import File
from kotti.security import has_permission
from kotti.views.edit import DocumentSchema
Expand Down Expand Up @@ -124,16 +124,6 @@ def __init__(self, context, request):
class CalendarViews(BaseView):
""" Views for calendars. """

def need(self):
""" Call ``need()`` on required Fanstatic resources. """

kotti_calendar_resources.need()
locale_name = get_locale_name(self.request)
if locale_name in fullcalendar_locales:
fullcalendar_locales[locale_name].need()
else: # pragma: no cover (safety belt only, should never happen)
fullcalendar_locales["en"].need()

def event_url(self, event):
""" Return the URL for an event in the calendar view.
Expand Down Expand Up @@ -226,6 +216,8 @@ def fullcalendar_options(self):
:rtype: dict
"""

lang = get_locale_name(self.request) or 'en'

return {
'header': {
'left': 'prev,next today',
Expand All @@ -235,6 +227,7 @@ def fullcalendar_options(self):
'eventSources': self.context.feeds,
'weekends': self.context.weekends,
'events': self.fullcalendar_events,
'lang': lang,
}

@view_config(name='view', renderer='templates/calendar-view.pt')
Expand All @@ -245,7 +238,8 @@ def view(self):
:rtype: dict
"""

self.need()
kotti_calendar_resources.need()
lang_all_js.need()

return {
'api': template_api(self.context, self.request),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
README = CHANGES = ''

install_requires = [
'js.fullcalendar',
'js.fullcalendar>=2.2.5',
'Kotti>=0.10b1',
]

Expand Down

0 comments on commit 1eaf3f3

Please sign in to comment.