Exemplo n.º 1
0
def manage_clone_award(request):
    """克隆奖项页面"""
    router = get_url_list(['manage', 'manage_awards'])
    data = {'router': router}
    return render_mako_context(request,
                               '/home_application/manage_edit_award.html',
                               data)
Exemplo n.º 2
0
def home(request):
    """首页"""
    viewable_awards = Award.objects.all_by_username(
        username=request.user.username, is_active=True)
    outdated_awards = Application.objects.awarded(
        username=request.user.username)
    router = get_url_list(['home'])
    data = {
        'viewable_awards': viewable_awards,
        'outdated_awards': outdated_awards,
        'router': router
    }
    return render_mako_context(request, '/home_application/home.html', data)
Exemplo n.º 3
0
def manage_organizations(request):
    """组织管理页面"""
    router = get_url_list(['manage', 'manage_organizations'])
    api_organizations_ = reverse('api_organizations')
    api_delete_organizations_ = reverse('api_delete_organizations')
    data = {
        'router': router,
        'api_delete_organizations': api_delete_organizations_,
        'api_organizations': api_organizations_,
    }
    return render_mako_context(request,
                               '/home_application/manage_organizations.html',
                               data)
Exemplo n.º 4
0
def personal_apply(request):
    """我的申报页面"""
    router = get_url_list(['personal', 'personal_apply'])
    api_my_apply_ = reverse('api_my_apply')
    personal_change_apply_ = reverse('personal_change_apply')
    personal_show_apply_ = reverse('personal_show_apply')
    personal_reapply_ = reverse('personal_reapply')
    data = {
        'router': router,
        'api_my_apply': api_my_apply_,
        'personal_change_apply': personal_change_apply_,
        'personal_show_apply': personal_show_apply_,
        'personal_reapply': personal_reapply_,
    }
    return render_mako_context(request,
                               '/home_application/personal_apply.html', data)
Exemplo n.º 5
0
def personal_review(request):
    """我的审核页面"""
    router = get_url_list(['personal', 'personal_review'])
    api_my_review_ = reverse('api_my_review')
    pass_award_ = reverse('pass_award')
    reject_award_ = reverse('reject_award')
    give_award_ = reverse('give_award')
    data = {
        'router': router,
        'api_my_review': api_my_review_,
        'pass_award': pass_award_,
        'reject_award': reject_award_,
        'give_award': give_award_,
    }
    return render_mako_context(request,
                               '/home_application/personal_review.html', data)
Exemplo n.º 6
0
def manage_add_award(request):
    """添加奖项页面"""

    levels = Level.objects.all_list()
    organizations_ = Organization.objects.all_name_key()
    router = get_url_list(['manage', 'manage_awards', 'manage_add_award'])
    api = reverse('api_add_award')
    data = {
        'levels': levels,
        'organizations': organizations_,
        'api': api,
        'router': router
    }
    print data

    return render_mako_context(request,
                               '/home_application/manage_edit_award.html',
                               data)
Exemplo n.º 7
0
def manage_awards(request):
    """奖项管理页面"""
    router = get_url_list(['manage', 'manage_awards'])
    manage_show_award_ = reverse('manage_show_award')
    manage_clone_award_ = reverse('manage_clone_award')
    manage_change_award_ = reverse('manage_change_award')
    api_delete_award_ = reverse('api_delete_award')
    api_awards_ = reverse('api_awards')
    data = {
        'router': router,
        'manage_show_award': manage_show_award_,
        'manage_clone_award': manage_clone_award_,
        'manage_change_award': manage_change_award_,
        'api_delete_award': api_delete_award_,
        'api_awards': api_awards_,
    }
    return render_mako_context(request, '/home_application/manage_award.html',
                               data)
Exemplo n.º 8
0
        return render_mako_context(request, '/404.html')
        # return HttpResponse('缺少参数award__key', status=404)
    levels = Level.objects.all_list()
    organizations_ = Organization.objects.all_name_key()
    try:
        award = Award.objects.get_values(key=award__key)
    except ObjectDoesNotExist, err:
        print err
        return render_mako_context(request, '/404.html')
    except IndexError, err:
        print err
        return render_mako_context(request, '/404.html')
    router = get_url_list([
        'manage', 'manage_awards', {
            'url_name': 'manage_change_award',
            'kwargs': {
                'award__key': award__key
            }
        }
    ])
    api = reverse('api_change_award')
    data = {
        'award': award,
        'levels': levels,
        'organizations': organizations_,
        'api': api,
        'router': router
    }
    return render_mako_context(request,
                               '/home_application/manage_edit_award.html',
                               data)