diff --git a/website/registries/views.py b/website/registries/views.py index 6dd57551b02..2dfc45b8c41 100644 --- a/website/registries/views.py +++ b/website/registries/views.py @@ -1,44 +1,7 @@ # -*- coding: utf-8 -*- -from flask import request -from framework.auth import Auth, decorators +from framework.auth import decorators from framework.utils import iso8601format -from osf.utils.permissions import ADMIN from website.registries import utils -from website import util - -def _view_registries_landing_page(campaign=None, **kwargs): - """Landing page for the various registrations""" - auth = kwargs['auth'] = Auth.from_kwargs(request.args.to_dict(), kwargs) - is_logged_in = kwargs['auth'].logged_in - if is_logged_in: - # Using contributor_to instead of contributor_to_or_group_member. - # You need to be an admin contributor to register a node - registerable_nodes = [ - node for node - in auth.user.contributor_to - if node.has_permission(user=auth.user, permission=ADMIN) - ] - has_projects = bool(registerable_nodes) - else: - has_projects = False - - if campaign == 'osf-registered-reports': - campaign_url_param = 'osf-registered-reports' - else: - campaign_url_param = '' - - return { - 'is_logged_in': is_logged_in, - 'has_draft_registrations': bool(utils.drafts_for_user(auth.user, campaign)), - 'has_projects': has_projects, - 'campaign_long': utils.REG_CAMPAIGNS.get(campaign), - 'campaign_short': campaign, - 'sign_up_url': util.web_url_for('auth_register', _absolute=True, campaign=campaign_url_param, next=request.url), - } - - -def registered_reports_landing(**kwargs): - return _view_registries_landing_page('osf-registered-reports', **kwargs) @decorators.must_be_logged_in diff --git a/website/routes.py b/website/routes.py index bdcde15d77f..ce1a9c90503 100644 --- a/website/routes.py +++ b/website/routes.py @@ -499,13 +499,15 @@ def make_url_map(app): Rule( [ + # Legacy routes '/rr/', '/registeredreports/', '/registeredreport/', + '/prereg/', ], 'get', - registries_views.registered_reports_landing, - OsfWebRenderer('registered_reports_landing.mako', trust=False) + website_views.redirect_to_registration_workflow, + notemplate ), Rule( @@ -514,14 +516,6 @@ def make_url_map(app): closed_challenges_views.erpc_landing_page, OsfWebRenderer('erpc_landing_page.mako', trust=False) ), - - Rule( - '/prereg/', - 'get', - website_views.redirect_to_registration_workflow, - notemplate - ), - Rule( '/preprints/', 'get', diff --git a/website/templates/registered_reports_landing.mako b/website/templates/registered_reports_landing.mako deleted file mode 100644 index 99f52ee580a..00000000000 --- a/website/templates/registered_reports_landing.mako +++ /dev/null @@ -1,156 +0,0 @@ -<%inherit file="base.mako"/> - - -<%def name="title()">Registered Reports%def> - -<%def name="stylesheets()"> - ${ parent.stylesheets() } - -%def> - -<%def name="javascript_bottom()"> - ${ parent.javascript_bottom() } - -%def> - -<%def name="newReg(size='')"> -
-%def> - -<%def name="existingDraft(size='')"> - -%def> - -<%def name="existingProject(size='')"> - -%def> - -<%def name="content()"> -Registered Reports benefit science by improving rigor and reducing publication bias.
-When to use this form:
-Use this form after you have received “in principle acceptance” (IPA) by a journal following Stage 1 Peer Review, and before you have begun the study.
- -