Skip to content

Commit d56f6ef

Browse files
committed
Addons: allow users to opt-in into the beta addons
Show a small form to the user where they can enable/disable the new beta addons on their project. * Closes #212 * Requires readthedocs/readthedocs.org#10733
1 parent c5e18b5 commit d56f6ef

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{% extends "projects/project_edit_base.html" %}
2+
3+
{% load i18n %}
4+
{% load crispy_forms_tags %}
5+
6+
{% block title %}{{ project.name }} - {% trans "Addons" %}{% endblock %}
7+
8+
{% block project_addons_active %}active{% endblock %}
9+
{% block project_edit_content_header %}{% trans "Addons" %}{% endblock %}
10+
11+
{% block project_edit_sidebar_help_topics %}
12+
{% include "includes/elements/link.html" with url="https://blog.readthedocs.com/addons-flyout-menu-beta/" text="Blog post: Addons flyout menu beta" is_external=True class="item" %}
13+
{% endblock project_edit_sidebar_help_topics %}
14+
15+
{% block project_edit_content %}
16+
<div class="ui info message">
17+
{% blocktrans trimmed %}
18+
Read the Docs addons are in beta. Give it a try now!
19+
{% endblocktrans %}
20+
</div>
21+
22+
<form class="ui form"
23+
method="post"
24+
action="{% url 'projects_addons' project_slug=project.slug %}">
25+
{% csrf_token %}
26+
{{ form|crispy }}
27+
28+
<input class="ui primary button" type="submit" value="{% trans "Save" %}">
29+
</form>
30+
{% endblock %}

readthedocsext/theme/templates/projects/edit_base.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<a class="item {% block project_advanced_active %}{% endblock %}" href="{% url "projects_advanced" project.slug %}">
1818
{% trans "Advanced settings" %}
1919
</a>
20+
<a class="item {% block project_addons_active %}{% endblock %}" href="{% url "projects_addons" project.slug %}">
21+
{% trans "Addons" %} <i class="ui small grey fa-duotone fa-rocket"></i>
22+
</a>
2023
<a class="item {% block project_domains_active %}{% endblock %}" href="{% url "projects_domains" project.slug %}">
2124
{% trans "Domains" %}
2225
</a>

0 commit comments

Comments
 (0)