Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/functional/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def test_templates_for_empty_titles():
continue

for file_name in files:
if file_name == "macros.html":
continue
if file_name.endswith(".html"):
rel_dir = os.path.relpath(dir_, dir_name)
rel_file = os.path.join(rel_dir, file_name)
Expand Down
4 changes: 4 additions & 0 deletions warehouse/static/sass/base/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ select:active {
label {
vertical-align: middle;
}

.hidden {
display: none;
}
5 changes: 4 additions & 1 deletion warehouse/templates/accounts/login.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{% extends "base.html" %}

{% import "accounts/macros.html" as macros %}

{% block title %}Sign in{% endblock %}

{% block content %}
<form method="POST" action="{{ request.current_route_path() }}">
{{ macros.legacy_pypi_message("login_form") }}
<form method="POST" action="{{ request.current_route_path() }}" class="hidden">
<input name="csrf_token" type="hidden" value="{{ request.session.get_csrf_token() }}">

{% if redirect.data %}
Expand Down
18 changes: 18 additions & 0 deletions warehouse/templates/accounts/macros.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% macro legacy_pypi_message(action) -%}
{% set current_title = "Sign in" if action == "login_form" else "Register" %}
<section class="horizontal-section">
<div class="narrow-container">
<h2>{{ current_title }}</h2>
<p>
We're currently working on making the logged in pages on PyPI better.
If you'd like to see this happen sooner, please consider
<a href="https://warehouse.readthedocs.io/development/getting-started/">contributing to Warehouse</a>,
or <a href="https://donate.pypi.io/">making a donation</a> (or asking
your company to make a donation) towards the ongoing development of the Warehouse project.
</p>
<p>
<a class="button button--large button--dark" href="https://pypi.python.org/pypi?%3Aaction={{action}}">{{current_title}} at pypi.python.org</a>
</p>
</div>
</section>
{%- endmacro %}
5 changes: 4 additions & 1 deletion warehouse/templates/accounts/register.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{% extends "base.html" %}

{% import "accounts/macros.html" as macros %}

{% block title %}Register{% endblock %}

{%- from "warehouse:templates/includes/input-recaptcha.html" import recaptcha_html, recaptcha_src %}

{% block content %}
<form method="POST" action="{{ request.current_route_path() }}">
{{ macros.legacy_pypi_message("register_form") }}
<form method="POST" action="{{ request.current_route_path() }}" class="hidden">
<input name="csrf_token" type="hidden" value="{{ request.session.get_csrf_token() }}">

{% include "warehouse:templates/includes/input-credentials.html" %}
Expand Down