Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add close/cancel button to all modals #519

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{% extends "includes/crud/table_list.html" %}

{% load i18n %}
{% load gravatar %}
{% load humanize %}
{% load privacy_tags %}
{% load invitations %}
{% load trans blocktrans from i18n %}
{% load gravatar_url from gravatar %}
{% load can_revoke_invitation from invitations %}

{% comment %}
For now, this include is used for secondary listings on maintainer and
Expand All @@ -19,7 +17,7 @@
{% endblock top_menu %}

{% block create_button %}
{% endblock %}
{% endblock create_button %}

{# Don't use placeholder content to avoid competing with the primary model listing view #}
{% block list_placeholder %}
Expand Down Expand Up @@ -52,9 +50,13 @@
{% endblock list_item_remove_modal_content %}
</div>
<div class="actions">
<form method="post" action="{% url "invitations_revoke" invitation_pk=object.pk %}">
<form method="post"
action="{% url "invitations_revoke" invitation_pk=object.pk %}">
{% csrf_token %}
<input class="ui negative button" type="submit" value="{% trans "Revoke invitation" %}">
<div class="ui cancel button">{% trans "Cancel" %}</div>
<input class="ui negative button"
type="submit"
value="{% trans "Revoke invitation" %}">
</form>
</div>
</div>
Expand All @@ -64,9 +66,13 @@

{% block list_item_image %}
{% if object.to_user %}
<img class="ui rounded square image" src="{% gravatar_url object.to_user.email 64 %}">
<img class="ui rounded square image"
alt="{% trans "User avatar" %}"
src="{% gravatar_url object.to_user.email 64 %}">
{% else %}
<img class="ui rounded square image" src="{% gravatar_url object.to_email 64 %}">
<img class="ui rounded square image"
alt="{% trans "User avatar" %}"
src="{% gravatar_url object.to_email 64 %}">
{% endif %}
{% endblock list_item_image %}

Expand All @@ -84,9 +90,7 @@
{% endif %}

<div class="sub header">
{% if object.to_user %}
{{ object.to_user.username }}
{% endif %}
{% if object.to_user %}{{ object.to_user.username }}{% endif %}
</div>
{% endblock list_item_header %}

Expand All @@ -100,4 +104,4 @@
{% endblock list_item_meta_items %}

{% block list_item_extra %}
{% endblock %}
{% endblock list_item_extra %}
3 changes: 2 additions & 1 deletion readthedocsext/theme/templates/mfa/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
data-bind="click: $root.show_modal('mfa-deactivate')">
{% trans "Deactivate" %}
</a>
<div class="ui small modal" data-modal-id="mfa-deactivate">
<div class="ui mini modal" data-modal-id="mfa-deactivate">
<div class="header">{% trans "Deactivate two-factor authentication?" %}</div>
<div class="content">
{% blocktrans trimmed %}
Expand All @@ -56,6 +56,7 @@

<form method="post" action="{% url 'mfa_deactivate_totp' %}">
{% csrf_token %}
<div class="ui cancel button">{% trans "Cancel" %}</div>
<input class="ui negative button"
type="submit"
value="{% trans "Deactivate" %}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h3 class="ui small header">{% trans "Generate new codes" %}</h3>
<div class="actions">
<form method="post" action="{% url "mfa_generate_recovery_codes" %}">
{% csrf_token %}
<div class="ui cancel button">{% trans "Cancel" %}</div>
<input class="ui negative button"
type="submit"
value="{% trans "Generate new codes" %}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{% extends "organizations/settings/base.html" %}

{% load i18n %}
{% load crispy_forms_tags %}
{% load trans blocktrans i18n %}
{% load crispy from crispy_forms_tags %}

{% block title %}{{ organization.name }} - {% trans "Details" %}{% endblock %}
{% block title %}
{{ organization.name }} - {% trans "Details" %}
{% endblock title %}

{% block organization_details_active %}active{% endblock %}
{% block organization_edit_content_header %}{% trans "Details" %}{% endblock %}
{% block organization_details_active %}
active
{% endblock organization_details_active %}
{% block organization_edit_content_header %}
{% trans "Details" %}
{% endblock organization_edit_content_header %}

{% block organization_edit_content %}
<form class="ui form" method="post" action=".">
Expand All @@ -15,14 +21,10 @@
<input class="ui primary button" type="submit" value="{% trans "Save" %}" />
</form>

<div class="ui horizontal divider">
{% trans "More" %}
</div>
<div class="ui horizontal divider">{% trans "More" %}</div>

<div class="ui red segment">
<h3 class="ui small header">
{% trans "Delete organization" %}
</h3>
<h3 class="ui small header">{% trans "Delete organization" %}</h3>

<p>
{% blocktrans trimmed %}
Expand All @@ -32,26 +34,29 @@ <h3 class="ui small header">
{% endblocktrans %}
</p>

<a class="ui button" data-bind="click: $root.show_modal('organization-delete')">
<a class="ui button"
data-bind="click: $root.show_modal('organization-delete')">
<i class="fa-duotone fa-trash icon"></i>
{% trans "Delete organization" %}
</a>
<div class="ui mini modal" data-modal-id="organization-delete">
<div class="header">
{% trans "Delete organization" %}
</div>
<div class="header">{% trans "Delete organization" %}</div>
<div class="content">
{% blocktrans trimmed with organization=organization.name %}
Are you sure you want to delete the organization {{organization}}?
Are you sure you want to delete the organization {{ organization }}?
This action cannot be undone.
{% endblocktrans %}
</div>
<div class="actions">
<form method="post" action="{% url "organization_delete" organization.slug %}">
<form method="post"
action="{% url "organization_delete" organization.slug %}">
{% csrf_token %}
<input class="ui negative button" type="submit" value="{% trans "Delete organization" %}">
<div class="ui cancel button">{% trans "Cancel" %}</div>
<input class="ui negative button"
type="submit"
value="{% trans "Delete organization" %}">
</form>
</div>
</div>
</div>
{% endblock %}
{% endblock organization_edit_content %}
38 changes: 19 additions & 19 deletions readthedocsext/theme/templates/organizations/team_form.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{% extends "organizations/teams/base.html" %}

{% load i18n %}
{% load crispy_forms_tags %}
{% load organizations %}
{% load privacy_tags %}
{% load trans blocktrans from i18n %}
{% load crispy from crispy_forms_tags %}
{% load is_admin from privacy_tags %}

{% block subtitle %}
{% if team %}
{% trans "Settings" %}
{% else %}
{% trans "Add team" %}
{% endif %}
{% endblock %}
{% endblock subtitle %}
{% block subview_content_header %}
{% if team %}
{% trans "Settings" %}
{% else %}
{% trans "Add team" %}
{% endif %}
{% endblock subview_content_header %}
{% block team_sidebar_settings %}active{% endblock %}
{% block team_sidebar_settings %}
active
{% endblock team_sidebar_settings %}

{% block subview_content_subheader_breadcrumbs %}
{% if team %}
Expand All @@ -41,15 +42,11 @@
{% endblock subview_content_form %}

{% if team and request.user|is_admin:organization %}
<div class="ui horizontal divider">
{% trans "More" %}
</div>
<div class="ui horizontal divider">{% trans "More" %}</div>

{% block team_delete %}
<div class="ui red segment">
<h3 class="ui small header">
{% trans "Delete team" %}
</h3>
<h3 class="ui small header">{% trans "Delete team" %}</h3>

<p>
{% blocktrans trimmed %}
Expand All @@ -58,24 +55,27 @@ <h3 class="ui small header">
{% endblocktrans %}
</p>

<a class="ui basic button" data-bind="click: $root.show_modal('team-delete')">
<a class="ui basic button"
data-bind="click: $root.show_modal('team-delete')">
<i class="fa-duotone fa-trash icon"></i>
{% trans "Delete team" %}
</a>
<div class="ui mini modal" data-modal-id="team-delete">
<div class="header">
{% trans "Delete team" %}
</div>
<div class="header">{% trans "Delete team" %}</div>
<div class="content">
{% blocktrans trimmed with team=team.name %}
Are you sure you want to delete the team {{team}}? This action
Are you sure you want to delete the team {{ team }}? This action
cannot be undone.
{% endblocktrans %}
</div>
<div class="actions">
<form method="post" action="{% url "organization_team_delete" organization.slug team.slug %}">
<form method="post"
action="{% url "organization_team_delete" organization.slug team.slug %}">
{% csrf_token %}
<input class="ui negative button" type="submit" value="{% trans "Delete team" %}">
<div class="ui cancel button">{% trans "Cancel" %}</div>
<input class="ui negative button"
type="submit"
value="{% trans "Delete team" %}">
</form>
</div>
</div>
Expand Down