├── tests
├── __init__.py
├── _site
│ ├── __init__.py
│ └── apps
│ │ ├── __init__.py
│ │ └── dashboard
│ │ ├── __init__.py
│ │ └── apps.py
├── factories
│ ├── __init__.py
│ ├── catalogue.py
│ └── oscar_promotions.py
├── functional
│ ├── __init__.py
│ ├── test_promotions.py
│ └── test_dashboard.py
├── integration
│ ├── __init__.py
│ ├── test_dashboard_forms.py
│ └── test_models.py
├── conftest.py
├── urls.py
└── settings.py
├── oscar_promotions
├── migrations
│ ├── __init__.py
│ └── 0001_initial.py
├── templatetags
│ ├── __init__.py
│ └── promotion_tags.py
├── __init__.py
├── dashboard
│ ├── __init__.py
│ ├── formsets.py
│ ├── forms.py
│ ├── apps.py
│ └── views.py
├── templates
│ └── oscar_promotions
│ │ ├── automaticproductlist.html
│ │ ├── handpickedproductlist.html
│ │ ├── rawhtml.html
│ │ ├── default.html
│ │ ├── image.html
│ │ ├── home.html
│ │ ├── dashboard
│ │ ├── handpickedproductlist_form.html
│ │ ├── delete_pagepromotion.html
│ │ ├── delete.html
│ │ ├── pagepromotion_list.html
│ │ ├── promotion_list.html
│ │ ├── page_detail.html
│ │ └── form.html
│ │ ├── baseproductlist.html
│ │ ├── singleproduct.html
│ │ └── multiimage.html
├── app_settings.py
├── layout.py
├── conf.py
├── views.py
├── static
│ └── styles.css
├── apps.py
├── admin.py
├── context_processors.py
└── models.py
├── .coveragerc
├── MANIFEST.in
├── .gitignore
├── Makefile
├── sandbox
├── wsgi.py
├── templates
│ └── oscar
│ │ ├── layout.html
│ │ ├── layout_2_col.html
│ │ └── layout_3_col.html
├── manage.py
├── urls.py
├── fixtures
│ └── promotions.json
└── settings.py
├── requirements.txt
├── setup.cfg
├── .github
├── dependabot.yml
└── workflows
│ └── test.yml
├── tox.ini
├── setup.py
└── README.rst
/tests/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/_site/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/_site/apps/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/factories/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/functional/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/integration/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oscar_promotions/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oscar_promotions/templatetags/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.coveragerc:
--------------------------------------------------------------------------------
1 | [run]
2 | source = oscar_promotions
3 | omit = *migrations*
4 |
--------------------------------------------------------------------------------
/tests/_site/apps/dashboard/__init__.py:
--------------------------------------------------------------------------------
1 | default_app_config = "tests._site.apps.dashboard.apps.DashboardConfig"
2 |
--------------------------------------------------------------------------------
/oscar_promotions/__init__.py:
--------------------------------------------------------------------------------
1 | default_app_config = 'oscar_promotions.apps.PromotionsConfig'
2 | VERSION = '1.0.0b1'
3 |
--------------------------------------------------------------------------------
/oscar_promotions/dashboard/__init__.py:
--------------------------------------------------------------------------------
1 | default_app_config = 'oscar_promotions.dashboard.apps.PromotionsDashboardConfig'
2 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include *.rst
2 | recursive-include oscar_promotions/templates *.html
3 | recursive-include oscar_promotions/static *.css
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | db.sqlite3
3 |
4 | media/
5 |
6 | # PyCharm files
7 | .idea/
8 |
9 | .pytest_cache/
10 | build/
11 | dist/
12 | *.egg-info
13 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | test: lint run-tests
2 |
3 | isort:
4 | isort -q -c --recursive --diff oscar_promotions tests setup.py
5 | flake8
6 |
7 | run-tests:
8 | pytest
9 |
--------------------------------------------------------------------------------
/oscar_promotions/templates/oscar_promotions/automaticproductlist.html:
--------------------------------------------------------------------------------
1 | {% extends 'oscar_promotions/baseproductlist.html' %}
2 |
3 | {# just exists to allow overriding #}
4 |
--------------------------------------------------------------------------------
/oscar_promotions/templates/oscar_promotions/handpickedproductlist.html:
--------------------------------------------------------------------------------
1 | {% extends 'oscar_promotions/baseproductlist.html' %}
2 |
3 | {# just exists to allow overriding #}
4 |
--------------------------------------------------------------------------------
/tests/_site/apps/dashboard/apps.py:
--------------------------------------------------------------------------------
1 | from oscar.apps.dashboard.apps import DashboardConfig as OscarDashboardConfig
2 |
3 |
4 | class DashboardConfig(OscarDashboardConfig):
5 | pass
6 |
--------------------------------------------------------------------------------
/tests/conftest.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | import django
4 |
5 |
6 | def pytest_configure(config):
7 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
8 | django.setup()
9 |
--------------------------------------------------------------------------------
/sandbox/wsgi.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from django.core.wsgi import get_wsgi_application
4 |
5 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
6 |
7 | application = get_wsgi_application()
8 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | django-oscar>=2.0,<2.3
2 | coverage
3 | django-webtest==1.9.10
4 | pytest-django>=3.7,<4.5
5 | tox>=2.9,<3.26
6 | sorl-thumbnail>=12.4.1,<12.10
7 |
8 | # Development
9 | flake8
10 | isort
--------------------------------------------------------------------------------
/oscar_promotions/templates/oscar_promotions/rawhtml.html:
--------------------------------------------------------------------------------
1 | {{ promotion.name }}
4 |
| {% trans "URL" %} | 44 |{% trans "Number of content blocks" %} | 45 |{% trans "Actions" %} | 46 ||
|---|---|---|---|
| {{ page.page_url }} | 52 |{{ page.freq }} | 53 |54 | {% trans "Edit" %} 55 | | 56 |57 | |
| {% trans "No content blocks found." %} |
| {% trans "Name" %} | 42 |{% trans "Type" %} | 43 |{% trans "Number of times used" %} | 44 |{% trans "Date created" %} | 45 |{% trans "Actions" %} | 46 |
|---|---|---|---|---|
| {{ promotion.name }} | 52 |{{ promotion.type }} | 53 |{{ promotion.num_times_used }} | 54 |{{ promotion.date_created }} | 55 |56 | 68 | | 69 |
| {% trans "No content blocks found." %} |
| {% trans "Promotion Name" %} | 35 |{% trans "Type" %} | 36 |{% trans "Actions" %} | 37 |
|---|---|---|
| {{ promotion.content_object.name }} | 43 |{{ promotion.content_object.type }} | 44 |45 | 58 | | 59 |
| {% trans "No promotions in this position." %} |
| {% trans "Page URL" %} | 50 |{% trans "Position on page" %} | 51 |{% trans "Actions" %} | 52 |
|---|---|---|
| {{ link.page_url }} | 58 |{{ link.position }} | 59 |60 | 67 | | 68 |
| {% trans "This promotion is not displayed anywhere at the moment." %} |