Ejemplo n.º 1
0
    def GET(self, domain):
        if not qv_domains.is_admin(domain):
            return web.notacceptable()
        qs = qv_questions.find({'domain': domain}).sort([('inserted_at', -1)])

        data = {
            'existing_questions': [],
            'new_uuid': uuid4(),
            'domain': domain,
            'active_question': qv_domains.get_active_question(domain),
            'submit_url': glob.urls['question_post']['url_pattern']
            % (domain),
            'get_url': glob.urls['question_get']['url_pattern'] % (domain, ''),
            'get_results_url': glob.urls['results_get']['url_pattern']
            % (domain, ''),
            'delete_url': glob.urls['answers_post']['url_pattern'] % (domain, ''),
            'results_url': glob.urls['view']['url_pattern'] % (domain),
            'history_url': glob.urls['history']['url_pattern'] % (domain),
        }

        qsd = [q for q in qs]

        data['existing_questions'] = qsd

        return renderer.admin(config.base_url,data,logman.LoggedIn())
Ejemplo n.º 2
0
    def GET(self, domain):
        if not qv_domains.is_admin(domain):
            return web.notacceptable()
        qs = qv_questions.find({'domain': domain}).sort([('inserted_at', -1)])

        data = {
            'existing_questions': [],
            'new_uuid':
            uuid4(),
            'domain':
            domain,
            'active_question':
            qv_domains.get_active_question(domain),
            'submit_url':
            glob.urls['question_post']['url_pattern'] % (domain),
            'get_url':
            glob.urls['question_get']['url_pattern'] % (domain, ''),
            'get_results_url':
            glob.urls['results_get']['url_pattern'] % (domain, ''),
            'delete_url':
            glob.urls['answers_post']['url_pattern'] % (domain, ''),
            'results_url':
            glob.urls['view']['url_pattern'] % (domain),
            'history_url':
            glob.urls['history']['url_pattern'] % (domain),
        }

        qsd = [q for q in qs]

        data['existing_questions'] = qsd

        return renderer.admin(config.base_url, data, logman.LoggedIn())
Ejemplo n.º 3
0
    def GET(self, domain):
        # verify the cookie is not set to the current session.
        # in that case it would be a resubmission
        if not qv_domains.is_admin(domain):
            return web.notacceptable()

        uuid = qv_domains.get_active_question(domain)
        data = {
            'uuid': uuid,
            'domain': domain,
            'vote_url': config.base_url+domain+'/',
            'get_url': glob.urls['results_get']['url_pattern'] % (domain, uuid)
        }

        return renderer.small(config.base_url,data,logman.LoggedIn())
Ejemplo n.º 4
0
    def GET(self, domain):
        # verify the cookie is not set to the current session.
        # in that case it would be a resubmission
        if not qv_domains.is_admin(domain):
            return web.notacceptable()

        uuid = qv_domains.get_active_question(domain)
        data = {
            'uuid': uuid,
            'domain': domain,
            'vote_url': config.base_url + domain + '/',
            'get_url': glob.urls['results_get']['url_pattern'] % (domain, uuid)
        }

        return renderer.small(config.base_url, data, logman.LoggedIn())