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
# template tag | |
from mezzanine import template | |
from mezzanine.forms.forms import FormForForm | |
from mezzanine.pages.models import Page | |
register = template.Library() | |
@register.as_tag | |
def form_from_page(slug): |
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
$(function() | |
{ | |
var $dropdowns = $('li.dropdown'); // Specifying the element is faster for older browsers | |
/** | |
* Mouse events | |
* | |
* @description Mimic hoverIntent plugin by waiting for the mouse to 'settle' within the target before triggering | |
*/ | |
$dropdowns | |
.on('mouseover', function() // Mouseenter (used with .hover()) does not trigger when user enters from outside document window |
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
import os | |
from django.conf import settings | |
from django.http import HttpResponseRedirect | |
from filebrowser_safe.settings import DIRECTORY | |
class FilebrowserHostThemesDirectoryMiddleware(object): |
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
import os | |
from copy import deepcopy | |
from django.conf import settings | |
from django.core.files.storage import default_storage | |
from mezzanine.core.request import current_request | |
from filebrowser_safe import functions | |
from filebrowser_safe.settings import DIRECTORY |
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
import os | |
from mezzanine.pages.templatetags.pages_tags import page_menu | |
from mezzanine import template | |
from mezzanine.utils.sites import current_site_id | |
register = template.Library() | |
@register.render_tag |
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
def custom_order_setup(self, request): | |
""" | |
Set order fields that are stored in the session, item_total | |
and total based on the given cart, and copy the cart items | |
to the order. Called in the final step of the checkout process | |
prior to the payment handler being called. | |
Adds tax to the order total. | |
""" | |
self.key = request.session.session_key | |
self.user_id = request.user.id |
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
from django.contrib.localflavor.us.forms import USStateSelect | |
from cartridge.shop import checkout | |
from cartridge.shop.forms import OrderForm | |
from mezzanine.conf import settings | |
class OrderForm(OrderForm): | |
def __init__(self, request, step, *args,**kwrds): |
NewerOlder