Example #1
0
 def __init__(self, context, request):
     self.context = context
     self.request = request
     self.workflow = get_workflow(ICommunityFile, 'security', context)
     self.filestore = get_filestore(context, request, 'add-file')
     self.show_sendalert = get_show_sendalert(self.context, self.request)
     self.check_upload_size = check_upload_size # for testing
Example #2
0
 def _call_fut(self, context, request):
     from karl.content.views.utils import get_show_sendalert
     return get_show_sendalert(context, request)
Example #3
0
 def __init__(self, context, request):
     self.context = context
     self.request = request
     self.filestore = get_filestore(context, request, 'comment')
     self.show_sendalert = get_show_sendalert(context, request)
Example #4
0
 def __init__(self, context, request):
     self.context = context
     self.request = request
     self.filestore = get_filestore(context, request, 'comment')
     self.show_sendalert = get_show_sendalert(context, request)
Example #5
0
 def _call_fut(self, context, request):
     from karl.content.views.utils import get_show_sendalert
     return get_show_sendalert(context, request)
Example #6
0
 def __init__(self, context, request):
     super(AddCalendarEventFormController, self).__init__(context, request)
     self.show_sendalert = get_show_sendalert(self.context, self.request)
Example #7
0
        fill_values = dict(
            startDate = startDate,
            endDate = endDate,
            tags = u'',
            security_state = security_state,
            )
        fill_values['contact_email'] = u''
        tags_field = dict(records=[])

    # Render the form and shove some default values in
    page_title = 'Add Calendar Event'
    api = TemplateAPI(context, request, page_title)

    # Get a little policy.  Should we suppress alerts?
    show_sendalert_field = get_show_sendalert(context, request)

    # Get a layout
    layout_provider = get_layout_provider(context, request)
    layout = layout_provider('community')

    calendar = find_interface(context, ICalendar)
    if calendar:
        default_category_name = ICalendarCategory.getTaggedValue('default_name')
        calendar_categories = [
            {'title':x.title, 'path':model_path(x), 'name':x.__name__} for x in
            _get_calendar_categories(calendar) ]
        # default name always first
        calendar_categories.sort(
            key=lambda x: x['name'] == default_category_name and True or
            x['title'])