-
Notifications
You must be signed in to change notification settings - Fork 299
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
Support for custom Product models #57
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2dbe303
First steps toward extensible Product model.
AlexHill 6ec055d
Look for a custom template for subclassed Products.
AlexHill 14d7866
Add missing blank line.
AlexHill 9e06c69
ProductAdmin automatically adds custom Product fields.
AlexHill 75004e2
pep8 and whitespace fixes.
AlexHill 4dc2df7
Add method and templatetag to get custom Product classes.
AlexHill ccc3ed7
Change stray "Page"s to "Product"s in comments.
AlexHill f62da50
pep8 fixes.
AlexHill 53d1b0a
Replace "Add Product" button with a select box of Product subclasses.
AlexHill 542689c
Merge remote-tracking branch 'upstream/master' into custom_products
AlexHill 2941f55
Added abstract base class for Product.
AlexHill 711806d
Added product_model field to Category.
AlexHill 4836b2b
Merge branch 'master' into custom_products
AlexHill e1bb0ef
Merge remote-tracking branch 'upstream/master' into custom_products
AlexHill 8a93943
Merge remote-tracking branch 'upstream/master' into custom_products
AlexHill 306eeec
Remove content_model from Category
AlexHill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
cartridge/shop/templates/admin/shop/product/change_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "admin/change_list.html" %} | ||
{% load shop_tags pages_tags i18n adminmedia %} | ||
|
||
{% block extrahead %} | ||
{{ block.super }} | ||
|
||
<script src="{{ STATIC_URL }}mezzanine/js/jquery-ui-1.8.14.custom.min.js"></script> | ||
<script src="{{ STATIC_URL }}mezzanine/js/admin/page_tree.js"></script> | ||
{% endblock %} | ||
|
||
{% block object-tools-items %} | ||
<li> | ||
<div id="addlist-primary"> | ||
<select class="addlist"> | ||
<option value="">{% trans "Add" %} ...</option> | ||
{% models_for_products as product_models %} | ||
{% for model in product_models %} | ||
{% set_model_permissions model %} | ||
{% if model.perms.add %} | ||
<option value="{{ model.add_url }}">{{ model.name }}</option> | ||
{% endif %} | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</li> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's where the redirection happens.