Skip to content

Commit

Permalink
Addons: allow users to opt-in into the beta addons (#213)
Browse files Browse the repository at this point in the history
* 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

* Add beta label on the menu item

* Upate the notification and ask for feedback
  • Loading branch information
humitos authored Sep 18, 2023
1 parent c5e18b5 commit 0904780
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
30 changes: 30 additions & 0 deletions readthedocsext/theme/templates/projects/addons_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% extends "projects/project_edit_base.html" %}

{% load i18n %}
{% load crispy_forms_tags %}

{% block title %}{{ project.name }} - {% trans "Addons" %}{% endblock %}

{% block project_addons_active %}active{% endblock %}
{% block project_edit_content_header %}{% trans "Addons" %}{% endblock %}

{% block project_edit_sidebar_help_topics %}
{% 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" %}
{% endblock project_edit_sidebar_help_topics %}

{% block project_edit_content %}
<div class="ui info message">
{% blocktrans trimmed %}
We are in beta! Give it a try now and share your feedback with us by <a href="https://github.com/readthedocs/addons" target="_blank">opening an issue</a>.
{% endblocktrans %}
</div>

<form class="ui form"
method="post"
action="{% url 'projects_addons' project_slug=project.slug %}">
{% csrf_token %}
{{ form|crispy }}

<input class="ui primary button" type="submit" value="{% trans "Save" %}">
</form>
{% endblock %}
6 changes: 6 additions & 0 deletions readthedocsext/theme/templates/projects/edit_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
<a class="item {% block project_advanced_active %}{% endblock %}" href="{% url "projects_advanced" project.slug %}">
{% trans "Advanced settings" %}
</a>
<a class="item {% block project_addons_active %}{% endblock %}" href="{% url "projects_addons" project.slug %}">
{% trans "Addons" %}
<div class="ui basic primary label">
{% trans "Beta" %}
</div>
</a>
<a class="item {% block project_domains_active %}{% endblock %}" href="{% url "projects_domains" project.slug %}">
{% trans "Domains" %}
</a>
Expand Down

0 comments on commit 0904780

Please sign in to comment.