def ReviewProposalListView(request): ''' Show the list of class bids, review results, and give a way to update the reviews ''' reviewer = validate_perms(request, ('Class Coordinator',)) if request.GET and request.GET.get('conf_slug'): conference = Conference.by_slug(request.GET['conf_slug']) else: conference = Conference.current_conf() header = ClassProposal().bid_review_header classes = ClassProposal.objects.filter( conference=conference).order_by('type', 'title') rows = [] for aclass in classes: bid_row = {} bid_row['bidder_active'] = True bid_row['bid'] = aclass.bid_review_summary bid_row['id'] = aclass.id bid_row['review_url'] = reverse('proposal_publish', urlconf='gbe.urls', args=[aclass.id]) rows.append(bid_row) conference_slugs = Conference.all_slugs() return render(request, 'gbe/bid_review_list.tmpl', {'header': header, 'rows': rows, 'conference': conference, 'conference_slugs': conference_slugs})
def FashionFaireView(request): ''' The Vintage Fashion Faire. Glorified vendor list ''' current_conference = Conference.current_conf() if request.GET: conference = Conference.by_slug(request.GET.get('conference', None)) else: conference = current_conference user_message = UserMessage.objects.get_or_create( view="FashionFaireView", code="INTRODUCTION", defaults={ 'summary': "Top of Fashion Fair Page", 'description': fashion_fair_intro }) vendors = list( Vendor.objects.filter(accepted=3, b_conference=conference).exclude( level="Featured").order_by('b_title')) featured_vendors = list( Vendor.objects.filter(accepted=3, b_conference=conference, level="Featured").order_by('b_title')) template = 'gbe/fashionfair.tmpl' context = { 'vendors': vendors, 'featured_vendors': featured_vendors, 'user_message': user_message[0] } return render(request, template, context)
def groundwork(self, request): self.reviewer = validate_perms(request, self.reviewer_permissions) if request.GET.get('conf_slug'): self.conference = Conference.by_slug(request.GET['conf_slug']) else: self.conference = Conference.current_conf() self.conference_slugs = Conference.all_slugs()
def get_gbe_schedulable_items(confitem_type, filter_type=None, conference=None): ''' Queries the database for the conferece items relevant for each type and returns a queryset. ''' if confitem_type in ['Panel', 'Movement', 'Lecture', 'Workshop']: filter_type, confitem_type = confitem_type, 'Class' elif confitem_type in [ 'Special Event', 'Volunteer Opportunity', 'Master Class', 'Drop-In Class' ]: filter_type, confitem_type = confitem_type, 'GenericEvent' if not conference: conference = Conference.current_conf() confitem_class = eval(confitem_type) confitems_list = confitem_class.objects.filter(e_conference=conference) if filter_type is not None: confitems_list = [ confitem for confitem in confitems_list if confitem.type == filter_type ] return confitems_list
def get_gbe_schedulable_items(confitem_type, filter_type=None, conference=None): ''' Queries the database for the conferece items relevant for each type and returns a queryset. ''' if confitem_type in ['Panel', 'Movement', 'Lecture', 'Workshop']: filter_type, confitem_type = confitem_type, 'Class' elif confitem_type in ['Special Event', 'Volunteer Opportunity', 'Master Class', 'Drop-In Class']: filter_type, confitem_type = confitem_type, 'GenericEvent' if not conference: conference = Conference.current_conf() confitem_class = eval(confitem_type) confitems_list = confitem_class.objects.filter(e_conference=conference) if filter_type is not None: confitems_list = [ confitem for confitem in confitems_list if confitem.type == filter_type] return confitems_list
def review_staff_area_view(request): ''' Shows listing of staff area stuff for drill down ''' viewer_profile = validate_perms(request, 'any', require=True) if request.GET and request.GET.get('conf_slug'): conference = Conference.by_slug(request.GET['conf_slug']) else: conference = Conference.current_conf() header = ['Area', 'Leaders', 'Check Staffing'] return render( request, 'gbe/report/staff_areas.tmpl', { 'header': header, 'areas': StaffArea.objects.filter(conference=conference), 'conference_slugs': conference_slugs(), 'conference': conference })
def get(self, request, *args, **kwargs): self.reviewer = validate_perms(request, self.reviewer_permissions) self.user = request.user if request.GET.get('conf_slug'): self.conference = Conference.by_slug(request.GET['conf_slug']) else: self.conference = Conference.current_conf() if request.GET.get('changed_id'): self.changed_id = int(request.GET['changed_id']) else: self.changed_id = -1 try: self.get_bid_list() except IndexError: return HttpResponseRedirect(reverse('home', urlconf='gbe.urls')) self.conference_slugs = Conference.all_slugs() return render(request, self.template, self.get_context_dict())
def review_staff_area_view(request): ''' Shows listing of staff area stuff for drill down ''' viewer_profile = validate_perms(request, 'any', require=True) if request.GET and request.GET.get('conf_slug'): conference = Conference.by_slug(request.GET['conf_slug']) else: conference = Conference.current_conf() header = ['Area', 'Leaders', 'Check Staffing'] return render( request, 'gbe/report/staff_areas.tmpl', {'header': header, 'areas': StaffArea.objects.filter(conference=conference), 'shows': Show.objects.filter(e_conference=conference), 'volunteer_types': AvailableInterest.objects.filter(visible=True), 'conference_slugs': conference_slugs(), 'conference': conference})
def FashionFaireView(request): ''' The Vintage Fashion Faire. Glorified vendor list ''' current_conference = Conference.current_conf() if request.GET: conference = Conference.by_slug(request.GET.get('conference', None)) else: conference = current_conference user_message = UserMessage.objects.get_or_create( view="FashionFaireView", code="INTRODUCTION", defaults={ 'summary': "Top of Fashion Fair Page", 'description': fashion_fair_intro}) vendors = list(Vendor.objects.filter( accepted=3, b_conference=conference)) template = 'gbe/fashionfair.tmpl' context = {'vendors': vendors, 'user_message': user_message[0]} return render(request, template, context)
def conference_slugs(): return Conference.all_slugs()
def get_conference_by_slug(slug): return Conference.by_slug(slug)
def get_current_conference_slug(): conf = Conference.current_conf() if conf: return conf.conference_slug
def get_current_conference(): return Conference.current_conf()
def volunteer_schedule(self, conference=None): conference = conference or Conference.current_conf() return self.workeritem.get_bookings(role="Volunteer", conference=conference).order_by( 'starttime')