diff --git a/src/olympia/addons/tests/test_views.py b/src/olympia/addons/tests/test_views.py index e6894d5c0d..32d28df1d2 100644 --- a/src/olympia/addons/tests/test_views.py +++ b/src/olympia/addons/tests/test_views.py @@ -3234,7 +3234,7 @@ class TestStaticCategoryView(TestCase): assert response.status_code == 200 data = json.loads(response.content) - assert len(data) == 98 + assert len(data) == 113 # some basic checks to verify integrity entry = data[0] @@ -3259,7 +3259,7 @@ class TestStaticCategoryView(TestCase): assert response.status_code == 200 data = json.loads(response.content) - assert len(data) == 98 + assert len(data) == 113 # some basic checks to verify integrity entry = data[0] diff --git a/src/olympia/browse/urls.py b/src/olympia/browse/urls.py index 4a7a7d08b4..8149cc1f73 100644 --- a/src/olympia/browse/urls.py +++ b/src/olympia/browse/urls.py @@ -51,6 +51,10 @@ urlpatterns = [ url('^complete-themes/(?:(?P[^/]+)/)?format:rss$', ThemeCategoriesRss(), name='browse.themes.rss'), + # This won't let you browse any themes but detail page needs the url. + url('^static-themes/(?P[^/]+)?$', views.extensions, + name='browse.static-themes'), + url('^extensions/(?:(?P[^/]+)/)?$', views.extensions, name='browse.extensions'), diff --git a/src/olympia/constants/applications.py b/src/olympia/constants/applications.py index a2b8b9ecff..7bfa515680 100644 --- a/src/olympia/constants/applications.py +++ b/src/olympia/constants/applications.py @@ -19,7 +19,7 @@ class FIREFOX(App): pretty = _(u'Firefox') browser = True types = [ADDON_EXTENSION, ADDON_THEME, ADDON_DICT, ADDON_SEARCH, - ADDON_LPAPP, ADDON_PLUGIN, ADDON_PERSONA] + ADDON_LPAPP, ADDON_PLUGIN, ADDON_PERSONA, ADDON_STATICTHEME] guid = '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' min_display_version = 3.0 # These versions were relabeled and should not be displayed. diff --git a/src/olympia/constants/base.py b/src/olympia/constants/base.py index 33ac4b77c6..c3d55f77a8 100644 --- a/src/olympia/constants/base.py +++ b/src/olympia/constants/base.py @@ -120,11 +120,12 @@ ADDON_LPADDON = 6 ADDON_PLUGIN = 7 ADDON_API = 8 # not actually a type but used to identify extensions + themes ADDON_PERSONA = 9 +ADDON_STATICTHEME = 10 # Addon type groupings. GROUP_TYPE_ADDON = [ADDON_EXTENSION, ADDON_DICT, ADDON_SEARCH, ADDON_LPAPP, ADDON_LPADDON, ADDON_PLUGIN, ADDON_API] -GROUP_TYPE_THEME = [ADDON_THEME, ADDON_PERSONA] +GROUP_TYPE_THEME = [ADDON_THEME, ADDON_PERSONA, ADDON_STATICTHEME] # Singular ADDON_TYPE = { @@ -136,6 +137,7 @@ ADDON_TYPE = { ADDON_LPADDON: _(u'Language Pack (Add-on)'), ADDON_PLUGIN: _(u'Plugin'), ADDON_PERSONA: _(u'Theme'), + ADDON_STATICTHEME: _(u'Theme (Static)'), } # Plural @@ -148,6 +150,7 @@ ADDON_TYPES = { ADDON_LPADDON: _(u'Language Packs (Add-on)'), ADDON_PLUGIN: _(u'Plugins'), ADDON_PERSONA: _(u'Themes'), + ADDON_STATICTHEME: _(u'Themes (Static)'), } # Searchable Add-on Types @@ -159,12 +162,14 @@ ADDON_SEARCH_TYPES = [ ADDON_SEARCH, ADDON_LPAPP, ADDON_PERSONA, + ADDON_STATICTHEME, ] # Icons ADDON_ICONS = { ADDON_ANY: 'default-addon.png', ADDON_THEME: 'default-theme.png', + ADDON_STATICTHEME: 'default-theme.png', } # We use these slugs in browse page urls. @@ -175,6 +180,7 @@ ADDON_SLUGS = { ADDON_LPAPP: 'language-tools', ADDON_PERSONA: 'personas', ADDON_SEARCH: 'search-tools', + ADDON_STATICTHEME: 'static-themes', } # These are used in the update API. @@ -187,6 +193,7 @@ ADDON_SLUGS_UPDATE = { ADDON_LPADDON: 'extension', ADDON_PERSONA: 'background-theme', ADDON_PLUGIN: 'plugin', + ADDON_STATICTHEME: 'static-theme', } # A slug to ID map for the search API. Included are all ADDON_TYPES that are @@ -199,6 +206,7 @@ ADDON_SEARCH_SLUGS = { 'search': ADDON_SEARCH, 'language': ADDON_LPAPP, 'persona': ADDON_PERSONA, + 'statictheme': ADDON_STATICTHEME, } ADDON_TYPE_CHOICES_API = { @@ -208,6 +216,7 @@ ADDON_TYPE_CHOICES_API = { ADDON_SEARCH: 'search', ADDON_LPAPP: 'language', ADDON_PERSONA: 'persona', + ADDON_STATICTHEME: 'statictheme', } # Edit addon information @@ -401,6 +410,9 @@ DEFAULT_WEBEXT_MIN_VERSION_ANDROID = '48.0' # The default version of Firefox that supports WebExtensions without an id DEFAULT_WEBEXT_MIN_VERSION_NO_ID = '48.0' +# The version of Firefox that first supported static themes. Not Android yet. +DEFAULT_STATIC_THEME_MIN_VERSION_FIREFOX = '53.0' + E10S_UNKNOWN = 0 E10S_COMPATIBLE = 1 E10S_COMPATIBLE_WEBEXTENSION = 2 diff --git a/src/olympia/constants/categories.py b/src/olympia/constants/categories.py index 7d673d0150..4ffef023b4 100644 --- a/src/olympia/constants/categories.py +++ b/src/olympia/constants/categories.py @@ -5,7 +5,7 @@ from olympia.constants.applications import ( ANDROID, FIREFOX, SEAMONKEY, THUNDERBIRD) from olympia.constants.base import ( ADDON_DICT, ADDON_EXTENSION, ADDON_LPAPP, ADDON_PERSONA, ADDON_SEARCH, - ADDON_SLUGS, ADDON_THEME) + ADDON_SLUGS, ADDON_THEME, ADDON_STATICTHEME) class StaticCategory(object): @@ -90,6 +90,23 @@ CATEGORIES = { 'retro': StaticCategory(id=31, name=_(u'Retro')), 'sports': StaticCategory(id=26, name=_(u'Sports')) }, + ADDON_STATICTHEME: { + 'abstract': StaticCategory(id=300, name=_(u'Abstract')), + 'causes': StaticCategory(id=320, name=_(u'Causes')), + 'fashion': StaticCategory(id=324, name=_(u'Fashion')), + 'film-and-tv': StaticCategory(id=326, name=_(u'Film and TV')), + 'firefox': StaticCategory(id=308, name=_(u'Firefox')), + 'foxkeh': StaticCategory(id=310, name=_(u'Foxkeh')), + 'holiday': StaticCategory(id=328, name=_(u'Holiday')), + 'music': StaticCategory(id=322, name=_(u'Music')), + 'nature': StaticCategory(id=302, name=_(u'Nature')), + 'other': StaticCategory(id=314, name=_(u'Other'), weight=333), + 'scenery': StaticCategory(id=306, name=_(u'Scenery')), + 'seasonal': StaticCategory(id=312, name=_(u'Seasonal')), + 'solid': StaticCategory(id=318, name=_(u'Solid')), + 'sports': StaticCategory(id=304, name=_(u'Sports')), + 'websites': StaticCategory(id=316, name=_(u'Websites')) + }, ADDON_DICT: { 'general': StaticCategory(id=95, name=_(u'General')) }, diff --git a/src/olympia/devhub/templates/devhub/addons/submit/describe.html b/src/olympia/devhub/templates/devhub/addons/submit/describe.html index d0dd609801..14858c448a 100644 --- a/src/olympia/devhub/templates/devhub/addons/submit/describe.html +++ b/src/olympia/devhub/templates/devhub/addons/submit/describe.html @@ -37,6 +37,7 @@ data-maxlength="{{ form.summary.field.max_length }}"> + {% if addon.type != amo.ADDON_STATICTHEME %}
+ {% endif %}
{{ cat_form.non_form_errors() }} @@ -107,8 +109,9 @@
{% endif %} - {% set values = form.data if form.is_bound else form.initial %} -
+ {% if addon.type != amo.ADDON_STATICTHEME %} + {% set values = form.data if form.is_bound else form.initial %} +
{{ form.has_priv }} {{ form.has_priv.label_tag() }} @@ -123,15 +126,16 @@ {{ form.privacy_policy }}
-
-
- -

{{ _('Is there anything our reviewers should bear in mind when reviewing this add-on?') }}

- {{ reviewer_form.approvalnotes }} -

{{ _('These notes will only be visible to you and our reviewers.') }}

-
+ +
+ +

{{ _('Is there anything our reviewers should bear in mind when reviewing this add-on?') }}

+ {{ reviewer_form.approvalnotes }} +

{{ _('These notes will only be visible to you and our reviewers.') }}

+
+ {% endif %}