Example #1
0
def load(request, is_raw):
    hash = request.matchdict['hash_id']
    urls, counts, title, description, form_dict = mtgquery.controllers.synergy.load_synergy(hash)
    alt_view = '/s/{}' if is_raw else '/s/{}/basic'  # Opposite view of the one we're loading
    notifications = request.session.pop_flash()
    return merge_dicts(form_dict, {'urls': urls, 'counts': counts,
                                   'title': title, 'description': description,
                                   'link_alt_href': alt_view.format(hash),
                                   'notifications': notifications,
                                   'copy_from_href': '/submit/from/{}'.format(hash)})
Example #2
0
def synergy_view(request):
    return merge_dicts({'navbar_index': 'View', 'view_mode': 'regular'}, load(request, False))
Example #3
0
def synergy_view_basic(request):
    return merge_dicts({'view_mode': 'basic'}, load(request, True))
Example #4
0
def synergy_submit_copy(request):
    if request.POST:
        return create(request)
    return merge_dicts({'navbar_index': 'Submit'}, load(request, False))