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
4 changes: 2 additions & 2 deletions src/olympia/devhub/templates/devhub/addons/edit/describe.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% from "devhub/includes/macros.html" import tip, empty_unless, flags, select_cats, supported_syntax_tip, trans_readonly %}
{% from "devhub/includes/macros.html" import tip, empty_unless, flags, select_cats, supported_syntax_link, trans_readonly %}

<form method="post" action="{{ url('devhub.addons.section', valid_slug, 'describe', 'edit') }}"
id="addon-edit-describe"
Expand Down Expand Up @@ -141,7 +141,7 @@ <h3>
<div class="char-count"
data-for-startswith="{{ main_form.description.auto_id }}_"
data-minlength="{{ main_form.description.field.min_length }}"></div>
{{ supported_syntax_tip(allowed_markdown) }}
{{ supported_syntax_link(settings) }}
{% else %}
{% call empty_unless(addon.description) %}
<div id="addon-description" class="prose">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% from "devhub/includes/macros.html" import tip, supported_syntax_tip, empty_unless, flags %}
{% from "devhub/includes/macros.html" import tip, supported_syntax_link, empty_unless, flags %}

<form method="post"
action="{{ url('devhub.addons.section', addon.slug, 'technical', 'edit') }}">
Expand Down Expand Up @@ -32,7 +32,7 @@ <h3>
{% if editable %}
{{ main_form.developer_comments }}
{{ main_form.developer_comments.errors }}
{{ supported_syntax_tip(allowed_markdown) }}
{{ supported_syntax_link(settings) }}
{% else %}
{% call empty_unless(addon.developer_comments) %}
<div id="developer_comments">{{ addon|all_locales('developer_comments', nl2br=True) }}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% from "devhub/includes/macros.html" import supported_syntax_tip, select_cats %}
{% from "devhub/includes/macros.html" import supported_syntax_link, select_cats %}
{% from "includes/forms.html" import tip %}
{% extends "devhub/addons/submit/base.html" %}

Expand Down Expand Up @@ -113,7 +113,7 @@ <h3>{{ _('Describe Add-on') }}</h3>
data-for-startswith="{{ describe_form.description.auto_id }}_"
data-minlength="{{ describe_form.description.field.min_length }}"></div>
</div>
{{ supported_syntax_tip(allowed_markdown) }}
{{ supported_syntax_link(settings) }}
</div>
{% endif %}
{% if addon.type != amo.ADDON_STATICTHEME %}
Expand Down Expand Up @@ -180,7 +180,7 @@ <h3>{{ _('Describe Add-on') }}</h3>
{{ license_form.text.errors }}
{{ license_form.text.label_tag() }}
{{ license_form.text }}
{{ supported_syntax_tip(allowed_markdown) }}
{{ supported_syntax_link(settings) }}
</div>
</div>
{% endif %}
Expand Down
7 changes: 2 additions & 5 deletions src/olympia/devhub/templates/devhub/includes/macros.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{% extends "includes/forms.html" %}

{% macro supported_syntax_tip(allowed_markdown, title=None) %}
{% macro supported_syntax_link(settings) %}
<p class="syntax-support">
{# L10n: %s is a list of markdown syntax. #}
<span class="tooltip" title="{% if title %}{{ title }}{% else %}{{
_('Allowed Markdown: %(allowed_markdown)s', allowed_markdown=allowed_markdown)
}}{% endif %}">{{ _('Some Markdown supported.') }}</span>
<a href="{{ settings.EXTENSION_WORKSHOP_URL }}/documentation/develop/create-an-appealing-listing/#make-use-of-markdown" target="_blank" rel="noopener noreferrer">{{ _('Some Markdown supported.') }}</a>
</p>
{% endmacro %}

Expand Down
6 changes: 3 additions & 3 deletions src/olympia/devhub/templates/devhub/includes/policy_form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% from "devhub/includes/macros.html" import tip, supported_syntax_tip %}
{% from "devhub/includes/macros.html" import tip, supported_syntax_link %}
<tr>
<th>{{ tip(_('End-User License Agreement'),
_('Please note that a EULA is not '
Expand All @@ -13,7 +13,7 @@
{{ policy_form.eula.label }}
</label>
{{ policy_form.eula }}
{{ supported_syntax_tip(allowed_markdown) }}
{{ supported_syntax_link(settings) }}
</div>
</td>
</tr>
Expand All @@ -31,7 +31,7 @@
{{ policy_form.privacy_policy.label }}
</label>
{{ policy_form.privacy_policy }}
{{ supported_syntax_tip(allowed_markdown) }}
{{ supported_syntax_link(settings) }}
</div>
</td>
</tr>
4 changes: 2 additions & 2 deletions src/olympia/devhub/templates/devhub/versions/edit.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "devhub/base.html" %}

{% from "devhub/includes/macros.html" import tip, supported_syntax_tip, empty_unless, compat %}
{% from "devhub/includes/macros.html" import tip, supported_syntax_link, empty_unless, compat %}

{% set title = _('Manage Version {0}')|format_html(version.version) %}

Expand Down Expand Up @@ -73,7 +73,7 @@ <h3>{{ title }}</h3>
<td>
{{ field.errors }}
{{ field }}
{{ supported_syntax_tip(allowed_markdown) }}
{{ supported_syntax_link(settings) }}
</td>
{% endwith %}
</tr>
Expand Down
4 changes: 0 additions & 4 deletions src/olympia/devhub/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
from olympia.reviewers.forms import PublicWhiteboardForm
from olympia.reviewers.models import Whiteboard
from olympia.reviewers.utils import ReviewHelper
from olympia.translations.models import PurifiedTranslation
from olympia.users.models import (
DeveloperAgreementRestriction,
SuppressedEmailVerification,
Expand Down Expand Up @@ -962,7 +961,6 @@ def addons_section(request, addon_id, addon, section, editable=False):
'whiteboard_form': whiteboard_form,
'valid_slug': valid_slug,
'supported_image_types': amo.SUPPORTED_IMAGE_TYPES,
'allowed_markdown': PurifiedTranslation.get_allowed_tags(),
Comment thread
chrstinalin marked this conversation as resolved.
}

return TemplateResponse(
Expand Down Expand Up @@ -1176,7 +1174,6 @@ def version_edit(request, addon_id, addon, version_id):
'is_admin': is_admin,
'choices': File.STATUS_CHOICES,
'files': (version.file,),
'allowed_markdown': PurifiedTranslation.get_allowed_tags(),
}
)

Expand Down Expand Up @@ -1813,7 +1810,6 @@ def _submit_details(request, addon, version):
'version': version,
'sources_provided': latest_version.sources_provided,
'submit_page': 'version' if version else 'addon',
'allowed_markdown': PurifiedTranslation.get_allowed_tags(),
}

post_data = request.POST if request.method == 'POST' else None
Expand Down
4 changes: 0 additions & 4 deletions src/olympia/translations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ def clean_localized_string(self):

return cleaner.clean(str(self.localized_string))

@classmethod
def get_allowed_tags(cls):
return ', '.join(cls.allowed_tags)


class PurifiedMarkdownTranslation(PurifiedTranslation):
class Meta:
Expand Down