djangosnippets.org: Latest snippets tagged with 'style'http://djangosnippets.org/tags/style/2009-09-14T04:20:49.036480-05:00Active class for navigation link
2009-09-14T04:20:49.036480-05:00cschandhttp://djangosnippets.org/snippets/1726/<p>Active class for navigation link</p>
<p>{% navclass default current url %}</p>
<pre><code> First argument is the default class and second is the current class
Third argument is the url name(s) of the page
example: <a class="{% navclass leftnav curentnav name1,name2 %}" href="/about/">
</code></pre>
Freely redistributableChanging the look of newforms as_table with a custom BaseForm
2007-06-04T07:28:22.346921-05:00bikeshedderhttp://djangosnippets.org/snippets/262/<p>I wanted to mark rows with an erroneous input with 'class="error"' and move the errorlist below the input tag so I wrote a NormalRowFormatter which behaves like a format string by overwriting __mod__.</p>
<p>Examples:</p>
<pre><code>class MyForm(PrettyBaseForm, forms.Form):
# add your fields here
SomethingForm = form_for_model(Something, form=PrettyBaseForm)
</code></pre>
Freely redistributable