예제 #1
0
def submit_visual_get_(request):
    if not define.is_vouched_for(request.userid):
        raise WeasylError("vouchRequired")

    form = request.web_input(title='',
                             tags=[],
                             description='',
                             imageURL='',
                             baseURL='')
    if form.baseURL:
        form.imageURL = urljoin(form.baseURL, form.imageURL)

    return Response(
        define.webpage(
            request.userid,
            "submit/visual.html",
            [
                # Folders
                folder.select_flat(request.userid),
                # Subtypes
                [i for i in macro.MACRO_SUBCAT_LIST if 1000 <= i[0] < 2000],
                profile.get_user_ratings(request.userid),
                form,
            ],
            title="Visual Artwork"))
예제 #2
0
def edit_submission_get_(request):
    form = request.web_input(submitid="", anyway="")
    form.submitid = define.get_int(form.submitid)

    detail = submission.select_view(request.userid,
                                    form.submitid,
                                    ratings.EXPLICIT.code,
                                    False,
                                    anyway=form.anyway)

    if request.userid != detail['userid'] and request.userid not in staff.MODS:
        raise WeasylError('InsufficientPermissions')

    submission_category = detail['subtype'] // 1000 * 1000

    return Response(
        define.webpage(
            request.userid,
            "edit/submission.html",
            [
                # Submission detail
                detail,
                # Folders
                folder.select_flat(detail['userid']),
                # Subtypes
                [
                    i for i in macro.MACRO_SUBCAT_LIST
                    if submission_category <= i[0] < submission_category + 1000
                ],
                profile.get_user_ratings(detail['userid']),
            ],
            title="Edit Submission"))
예제 #3
0
def manage_folders_(request):
    return Response(
        define.webpage(
            request.userid,
            "manage/folders.html",
            [
                # Folders dropdown
                folder.select_flat(request.userid),
            ],
            title="Submission Folders"))
예제 #4
0
def submit_literary_get_(request):
    if not define.is_vouched_for(request.userid):
        raise WeasylError("vouchRequired")

    return Response(define.webpage(request.userid, "submit/literary.html", [
        # Folders
        folder.select_flat(request.userid),
        # Subtypes
        [i for i in macro.MACRO_SUBCAT_LIST if 2000 <= i[0] < 3000],
        profile.get_user_ratings(request.userid),
    ], title="Literary Artwork"))