Coder Social home page Coder Social logo

diefenbach / lfs-theme Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 16.0 2.82 MB

The default theme for LFS

Home Page: http://www.getlfs.com

License: BSD 3-Clause "New" or "Revised" License

CSS 34.30% HTML 64.38% Python 1.32%
html django python lfs ecommerce

lfs-theme's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @diefenbach
  • ๐Ÿ‘€ Iโ€™m interested in Python and Django
  • ๐ŸŒฑ Iโ€™m currently learning more English
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on cool stuff
  • ๐Ÿ“ซ How to reach me: @diefenbach on Twitter

lfs-theme's People

Contributors

diefenbach avatar jgoodleaf avatar johngoodleaf avatar misaelnieto avatar mthornhill avatar naro avatar olimpiurob avatar pigletto avatar simahawk avatar wjarym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lfs-theme's Issues

templatetag throws AttributeError

Lines 30 and 38 of lfs-theme/templatetags/lfs_theme_tags.py will throw an AttributeError if another app passes a 'category', 'product' or 'page' to context that does not have an 'id' attribute.

In our case, django-photologue is passing an int object as 'page' via the url /photos/gallery/page/1/.

We have applied a workaround to test for the id attribute...

    if object is None or not hasattr(object, 'id'):
        object = lfs.core.utils.get_default_shop(request)

Fix - Form Fields Not Displaying

I had weird issue in that the address form fields did not appear at all. I finally managed to track the issue to the lfs/shop/lfs_form.html file. The variable for the form should be lfs_form and not form. Once that change was made then all the form fields appeared!

SlotsInformation, has_portlets and show="False"

Try a category with only the Filter portlet in one portlet. Then look at one or many products of this category. The bug (offset in slot) cames from the function 'has_portlets' in
lfs-theme / lfs_theme / templatetags / lfs_theme_tags.py. In this case 'has_portlet' is True because parent of the product = category has one portlet, but the rendered of this portlet is empty with show="False" in the product.
To fix it, I suggest to remove 'has_portlet' by a new function : has_portlets_rendered
def has_portlets_rendered(obj, slot,context):
portlets_list = []
rendered_list = ''
while obj:
portlets_list = portlets.utils.get_portlets(obj, slot)
for p in portlets_list:
rendered_list = (''.join(p.render(context)))
if len(rendered_list.strip()) > 0:
return True
if portlets.utils.is_blocked(obj, slot):
break
try:
obj = obj.get_parent_for_portlets()
except AttributeError:
break

return False    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.