Kevin Veroneau avatar Kevin Veroneau committed d6af807

Updated a few more components to Bootstrap 3, mainly the templatetags and the modals.

Comments (0)

Files changed (3)

bootstrap_theme/static/css/form-compat.css

   cursor: not-allowed;
   background-color: #eeeeee;
 }
+
+.alert-error {
+  color: #b94a48;
+  background-color: #f2dede;
+  border-color: #eed3d7;
+}
+
+.alert-error hr {
+  border-top-color: #e6c1c7;
+}
+
+.alert-error .alert-link {
+  color: #953b39;
+}

bootstrap_theme/templates/bootstrap_theme/fragments/modal.html

 <div id="{{modal_id}}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="{{modal_id}}Label" aria-hidden="true">
-  <div class="modal-header">
-    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
-    <h3 id="{{modal_id}}Label">{{title}}</h3>
+  <div class="modal-dialog">
+    <div class="modal-content">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+        <h4 class="modal-title" id="{{modal_id}}Label">{{title}}</h4>
+      </div>
+      {% if form_action %}<form action="{{form_action}}" method="post"><input type='hidden' name='csrfmiddlewaretoken' value='{{csrf_token}}' />{% endif %}
+      <div class="modal-body">
+        {{body}}
+      </div>
+      <div class="modal-footer">
+        <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
+        {% if form_action %}<input class="btn btn-primary" type="submit" value="Save changes">{% endif %}
+      </div>
+      {% if form_action %}</form>{% endif %}
+    </div>
   </div>
-  {% if form_action %}<form action="{{form_action}}" method="post"><input type='hidden' name='csrfmiddlewaretoken' value='{{csrf_token}}' />{% endif %}
-  <div class="modal-body">
-    {{body}}
-  </div>
-  <div class="modal-footer">
-    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
-    {% if form_action %}<input class="btn btn-primary" type="submit" value="Save changes">{% endif %}
-  </div>
-  {% if form_action %}</form>{% endif %}
 </div>

bootstrap_theme/templatetags/bootstrap.py

 
 @register.simple_tag
 def buttonlink(url, icn):
-    return '<a class="btn" href="%s"><i class="icon-%s"></i></a>' % (url, icn)
+    return '<a class="btn btn-default" href="%s"><i class="glyphicon glyphicon-%s"></i></a>' % (url, icn)
 
 @register.filter
 def emphasis(value, arg=""):
 @register.filter
 def yesnoicon(value):
     icon = "ok" if value else "remove"
-    return mark_safe('<i class="icon-%s"></i>' % icon)
+    return mark_safe('<i class="glyphicon glyphicon-%s"></i>' % icon)
 
 @register.filter
 def ratingicon(value):
-    return mark_safe('<i class="icon-star"></i>' * value)
+    return mark_safe('<i class="glyphicon glyphicon-star"></i>' * value)
 
 class NavbarNode(template.Node):
     def __init__(self, nodelist, site_title):
 
 @register.filter
 def link(value, icon=None):
-    icon_html = '<i class="icon-%s"></i>' % icon if icon else ''
+    icon_html = '<i class="glyphicon glyphicon-%s"></i>' % icon if icon else ''
     try:
         return mark_safe('<a href="%s">%s%s</a>' % (value.get_absolute_url(), icon_html, value))
     except:
 
 @register.simple_tag
 def icon(slug):
-    return mark_safe('<i class="icon-%s"></i>' % slug)
+    return mark_safe('<i class="glyphicon glyphicon-%s"></i>' % slug)
 
 @register.simple_tag
 def modal_button(title, modal=None, icon=None):
-    icon = '<i class="icon-%s"></i>' % icon if icon else ''
+    icon = '<i class="glyphicon glyphicon-%s"></i>' % icon if icon else ''
     if not modal:
         modal = 'myModal'
     return mark_safe('<a class="btn" role="button" href="#%s" data-toggle="modal">%s%s</a>' % (modal, icon, title))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.