pinax / pinax-theme-bootstrap Goto Github PK
View Code? Open in Web Editor NEWA theme for Pinax based on Twitter's Bootstrap
License: Other
A theme for Pinax based on Twitter's Bootstrap
License: Other
@yulka had originally sent me these notes per a change she made in her fork and wanted to share publicly so we could discuss in the open. Thanks, Yulka!
block page
and leaving block footer
outside of it, we can add a couple of styles in css and have a have the footer stickaside
, section
instead of div
main-content
, not main_content
sidebar_base.html
instead of subnav_base.html
, because there can be other content in the sidebar, not just navigationheader
and footer
since these html tags can be used in other places (header.header
, footer.footer
)h2
for page titles instead of a mix of h1
, h2
and legend
)hr
, borders can be added in css (see base.html, footer)here https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/templates/account/email.html#L4 error: {% load bootstrap_form_filters %} need to be replaced with {% load bootstrap_tags %}
when using btn-group class, it does not group buttons as it should according to this: http://twitter.github.com/bootstrap/components.html#buttonGroups
The repo does not have tags for recent pypi releases, which makes hard to track development. for example, I want to fork from 2.0.2.post3 to introduce some changes, and there's no information about which commit that version is.
Trying to crib from this repo (namely DUA doesn't say what some of these templates are or what context variables they get, etc), but its out of date and making it difficult.
as_bootstrap
templatefilter wraps fields in control-group
and controls
divs. This currently makes it impossible to apply form-inline
class.
topbar requires bootstrap-dropdown.js and it's should be included from bootstrap's js-examples branch.
without this js file menus doesn't drops down.
Shouldn't the Changing E-mail setting require confirmation, just like when the user signs up? Implementing this may make this package a bit more turnkey for implementors.
While the translation tags are added in the template/account/settings.html
, the necessary {% load i18n %}
is not added into the template, as the official doc of django points out:
https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#internationalization-in-template-code
To give your template access to these tags, put {% load i18n %} toward the top of your template. As with all template tags, this tag needs to be loaded in all templates which use translations, even those templates that extend from other templates which have already loaded the i18n tag.
As a result, when users enters the site setting.html
, django will give out an error
Invalid block tag: 'trans', expected 'endblock'
I suppose we should insert a line of {% load i18n %}
at the head of the settings.html
?
Right now, there's no good way to enable scrollspy with the included base.html. Changing the body tag to look like:
<body class="{% block body_class %}{% endblock %}" id="{% block body_id %}{% endblock %}"{% block body_extra_attributes %}{% endblock %}>
would be helpful
A general form error message, like is a username/password combo are incorrect, doesn't apply the proper styling. This is with latest Pinax and theme. Screenshot: http://dl.dropbox.com/u/363845/Screenshots/j_0d.png
I had to add .alert-error to work with the messages framework, don't know where you want to put this, i added this to my custom less:
.alert-error {
.alert-danger;
}
At the moment, the theme contains an _account_bar appropriate to and assuming django-user-accounts is used. This is then zeroed out in starter projects that don't use django-user-accounts. The _account_bar seems to be then duplicated in the account project (we need to check if it's in fact exactly the same).
So Option 1 would be just make the _account_bar in PTB blank to remove the duplication.
Option 2 would be to rename the _account_bar in PTB to something else and a project that wants to use it includes that newly named template in their _account_bar
But then Patrick suggested Option 3 which I like more than Option 2: rather than have the extra level of indirection, just have the various starter projects either include PTB's _account_bar or not in their own site_base.html
This file is not part of the source tree or package.
With the bootstrap theme that were included by Pinax==0.9a2 (pinax-theme-boostrap==0.1.2), when doing the following sequence:
Since the footer has been moved into base.html {% block body_base %} and subnav_base overrides this whole block without including the footer, well, footer's gone in all my subnav_base extensions :( Not a big fat issue, but I guess it wasn't the first intention.
I'm not finding this idios css file anywere:
<link rel="stylesheet" href="{{ STATIC_URL }}pinax/css/idios.css" />
I see there are various translation files on transifex, should these be pulled into github?
The main reason I'm asking this question is because I'm wondering how I should go about translating pinax-theme-bootstrap. What's your recommendation?
I have just started a new django project and decided to give pinax-theme-bootstrap a try. I am currently not using any other django apps from Pinax project.
According to documentation, I only needed to install and add to settings.INSTALLED_APPS 2 modules: 'pinax_theme_bootstrap' and 'django_forms_bootstrap'. Unfortunately after creating some basic templates I encountered an error: 'account_tags' is not a valid tag library: Template library account_tags not found
{% load account_tags %} comes from _account_bar.html template which seems to be included by theme_bootstrap/base.html template which I am supposed to use as a basis for my site_base.html according to documentation.
If I understand correctly, I actually need to install an extra package, django-user-accounts, to get rid of this error (and I need to properly follow instructions to include it properly in settings.py and urls.py).
So, my conclusion is either documentation should be updated to include django-user-accounts as a requirement or the templates should be fixed to not cause exceptions if this package is not installed
I would love to see us break out including jQuery
, bootstrap
, and font-awesome
, directly into versioned releases of the theme and instead use npm
and webpack
.
bootstrap-webpack seems promising but am having a difficult time of seeing how to bridge the gap of being able to ship a Django app as a theme that is (mostly) plug and play.
Granted, right now, it's far from plug and play given the Makefile
and static
setup.
package.json
, webpack.config.js
, bootstrap.config.less
and bootstrap.config.js
as part of the theme documentationMakefile
But I was wondering if we could do better. Is there some way that the installation of the theme couldn't be something like:
pinax_theme_bootstrap
to INSTALLED_APPS
./manage.py init_theme
to generate the 4 files needed./manage.py init_theme
(e.g. npm install pinax-theme-bootstrap
)?I'm trying to use pinax-theme-bootstrap for a site that doesn't use Pinax. The theming of the homepage and other subpages seems to work, but when I go to the login, logout or any of the /account pages, it doesn't seem to load the templates in pinax_theme_bootstrap/templates/account. Is there something else I need to do in order to get these pages to load?
It should not offer Sign Up as an option if ACCOUNT_OPEN_SIGNUP = False
The original bootstrap-modal.js allows the common jquery pattern of calling functions on every element in a selector: $("a").modal()
would essentially create a Modal instance using each a element in the document. Using pinax-bootstrap-theme breaks this pattern. Even more problematical, it does so by assigning the same modal dialogue to every element in the selector. In cases where data is being edited or deleted via modal dialogues, this leads to silent data corruption or loss. Currently, this can be worked around by using .each() to call .modal() on each element: $("a").each(function() { $(this).modal(); });
However, this is not documented anywhere, or immediately obvious to someone familiar with bootstrap's original implementation.
In pinax-project-account the overall link is Settings and the first part is headed "Account"
need to update media to bootstrap 2.0.3 and review changelog for any syntax changes
This is for the *less branch.
I think that the original bootstrap .less
files should be provided as is and any modifications should go to a separate style sheet as overrides of the original rules.
This will improve maintainability and help avoid merging errors when updating bootstrap assets.
For example right now there is a modified version of sprites.less
that has a background-image url path adjusted to Django project layout. This modification could easily be moved to a separate style sheet that will override the original value. The pinax-theme.less
then could look like:
@import "bootstrap.less";
i {
background-image: url(../img/glyphicons-halflings-sprite.png);
}
// any other Pinax specific styles
Additionally I think it would be useful to put bootstrap files in a less/bootstrap
or even better less/pinax/bootstrap
namespace directory to avoid conflicts with other static assets. And similarly for js and img files as well.
There are non translatable strings in templates for example in delete_account.html: https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/templates/account/delete.html
It would be great if all strings were translatable.
Of course, the problem is that running makemessages in django-user-accounts won't help since the templates are in pinax-theme-bootstrap. So I'm also wondering what's your take on this.
Need to make sure we're using new url tag for Django 1.5 compatibility.
base.html
has:
{% block body_base %}
<section id="content_body">
<div class="container">
...
</div>
</section>
{% endblock %}
whereas subnav_base.html
has:
{% block body_base %}
<div class="container">
....
</div>
{% endblock %}
The subnav_base.html
template should have the section element too.
After you log into the site, the account dropdown menu will become unaccessible because it is hidden behind the main content on mobile.
Unfortunately there's no CDN serving that asset so I guess the best option is to copy it to local static files.
Btw. how about replacing it with modernizr.js like in https://github.com/h5bp/html5-boilerplate or adding a template block for overriding?
For reference see http://zoompf.com/blog/2012/05/html5shiv-and-serving-content-from-code-repositories.
pinax-theme-bootstrap seems to depend on pinax, as far as I can tell. I tried to install it following the directions, but it did not load, due to a missing ifsetting_tag template tag. With a little research, I found that this tag was provided by pinax. So it seems as though pinax should be listed as a dependency. Maybe this is implied since this is a pinax app, but if so, that wasn't clear to me, because my understanding was that the external apps more or less stand alone, save for explicit dependencies.
sign up should say "already have an account? log in"
log in should say "don't have an account? sign up"
When looking at
https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/templates/account/settings.html it seems that you might have a few commits/PR that all add {% load i18n %}
.
If you're using the pinax-bootstrap theme then you cannot create static modal dialogues ala the example in the twitter bootstrap docs.
The following does not work for example:
<a class="m btn" href="#modal1">Modal 1</a>
<div class="modal" id="modal1">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>Modal 1 header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<a href="#" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
</div>
After upgrading to 5.7.3 my project broke. Turns out 12833c6 fixes it. Can you put out a new release with this fix because 5.7.3 is unusable as is.
I see Bootstrap has been updated to v2.3.2 in master. Any chance of getting a release so we can pick this up? It looks like it'll fix a problem for some of our users. (PyCon/pycon2019#206)
There are a few hardcoded URLs to OpenID actions in the account templates, which, according to the docs could be replaced with named URLs of the form "openid-".
I'm happy to submit a pull request if there are no additional complicating factors preventing the use of url tags.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.