Twitter Bootstrap 2

278 views
Skip to first unread message

orsomannaro

unread,
Feb 20, 2012, 10:34:06 AM2/20/12
to Pinax ML
How can I update at Twitter Bootstrap 2?

Thanks

Seyi Ogunyemi

unread,
Feb 20, 2012, 4:18:09 PM2/20/12
to pinax...@googlegroups.com
Looking at  https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/static/bootstrap/css/bootstrap.css, it seems the pinax bootstrap theme has already been updated to Bootstrap v2.01.

Try: pip install --upgrade pinax-theme-bootstrap

Regards

- Seyi

orsomannaro

unread,
Feb 21, 2012, 4:32:18 AM2/21/12
to pinax...@googlegroups.com
Il 20/02/2012 22:18, Seyi Ogunyemi ha scritto:

> it seems the pinax bootstrap theme has already been updated to Bootstrap

Yes, but using crispy-forms it seem that some new bootstrap style
(form-inline for example) doesn't work properly (but the cause may be
the way crispy-forms rendering formset)

orsomannaro

unread,
Feb 22, 2012, 12:30:32 PM2/22/12
to pinax...@googlegroups.com
On 20/02/2012 22:18, Seyi Ogunyemi wrote:
> it seems the pinax bootstrap theme has already been updated to Bootstrap


also modal form doesn't work:

http://twitter.github.com/bootstrap/javascript.html#modals

Brian Rosner

unread,
Feb 23, 2012, 3:01:27 AM2/23/12
to pinax...@googlegroups.com

Modals as documented by Twitter do not work in pinax-theme-bootstrap. I do hope this changes, but it isn't as trivial as it sounds. There is custom modal support in pinax-theme-bootstrap written before bootstrap bundled JS. It actually has more functionality than what bootstrap provides, but doesn't behave the same. The goal is to find a way to make our custom modals work in addition to bootstrap's modals.

In the meantime you can take a look at these files to get an idea of what is going on now (unfortunately subject to change in future versions):

https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/static/pinax/js/pinax.modal.js
https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/templates/idios/profile.html
https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_theme_bootstrap/templates/idios/profile_edit_ajax.html
https://github.com/eldarion/idios/blob/master/idios/views.py#L166

The idios view implements some behavior the Pinax modal expects.

I do hope we are able to maintain some form of compatibility with what we've done in getting native modals working. However, it may be entirely possible we punt on making additive and make the current behavior optional.

At any rate, I hope this helps a little.

Brian Rosner
http://twitter.com/brosner
https://github.com/brosner

orsomannaro

unread,
Feb 23, 2012, 5:08:34 PM2/23/12
to pinax...@googlegroups.com
Il 23/02/2012 09:01, Brian Rosner ha scritto:
> There is custom modal support in pinax-theme-bootstrap written before bootstrap bundled JS

Thank you for the answer.

I follow your suggest but I have a problem.
My code is something like this:

{% for object in objects %}
<a id="edit-obj" href="{% url edit_obj object.id %}" >Edit</a>
{% endfor %}

but only the first link of the link work...


Can you tell me why?

Brian Rosner

unread,
Feb 23, 2012, 6:55:15 PM2/23/12
to pinax...@googlegroups.com

On Feb 23, 2012, at 3:08 PM, orsomannaro wrote:

> Il 23/02/2012 09:01, Brian Rosner ha scritto:
>> There is custom modal support in pinax-theme-bootstrap written before bootstrap bundled JS
>
> Thank you for the answer.
>
> I follow your suggest but I have a problem.
> My code is something like this:
>
> {% for object in objects %}
> <a id="edit-obj" href="{% url edit_obj object.id %}" >Edit</a>
> {% endfor %}

The id attribute is meant to be unique in an HTML document. You need to modify the code to work with the class attribute instead of id.

Brian Rosner
https://twitter.com/brosner
https://github.com/brosner

orsomannaro

unread,
Feb 24, 2012, 2:12:00 AM2/24/12
to pinax...@googlegroups.com
On 24/02/2012 00:55, Brian Rosner wrote:

> The id attribute is meant to be unique in an HTML document

Ok, I need holidays :(

orsomannaro

unread,
Feb 24, 2012, 5:31:16 AM2/24/12
to pinax...@googlegroups.com
On 24/02/2012 00:55, Brian Rosner wrote:

> The id attribute is meant to be unique in an HTML document.

...


{% for object in objects %}

<a class="edit-obj" href="{% url edit_obj object.id %}">Edit</a>
{% endfor %}
...

{% block extra_body %}
<script>
$(function() {
$(".edit-obj").modal({
backdrop: true
});
});
</script>
{% endblock %}


Now it work but all the modal-forms open the first object.id link
(all {% url edit_obj object.id %} links show the details of the first
object.id)

Han Xiaogang

unread,
Feb 20, 2012, 10:02:34 PM2/20/12
to Pinax Users
And don't forget to follow the instructions here
https://github.com/pinax/pinax-theme-bootstrap on how to "Upgrading
from Bootstrap 1.x"

On Feb 21, 5:18 am, Seyi Ogunyemi <micr...@gmail.com> wrote:
> Looking at  https://github.com/pinax/pinax-theme-bootstrap/blob/master/pinax_them...,

orsomannaro

unread,
Feb 29, 2012, 11:47:41 AM2/29/12
to pinax...@googlegroups.com
On 24/02/2012 11:31, orsomannaro wrote:

> ...
> {% for object in objects %}
> <a class="edit-obj" href="{% url edit_obj object.id %}">Edit</a>
> {% endfor %}
> ...
>
> {% block extra_body %}
> <script>
> $(function() {
> $(".edit-obj").modal({
> backdrop: true
> });
> });
> </script>
> {% endblock %}

> all {% url edit_obj object.id %} links show the details of the first
> object.id


Somebody can help me?

I realy cannot understand why different url open the same instance...

orsomannaro

unread,
Mar 21, 2012, 11:46:24 AM3/21/12
to pinax...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages