diff options
author | Magnus Hagander | 2014-04-23 17:11:01 +0000 |
---|---|---|
committer | Magnus Hagander | 2014-04-23 17:11:01 +0000 |
commit | 6cccaec723f6eff090dd854a7e8ed6b4ecd78df0 (patch) | |
tree | 5c4810b5c8dc1c66622444ad8da5705f04653d8c | |
parent | 02a7a0e05a16d619f4624f04ba08e19b78ff0d9b (diff) |
Better way of fixing the djselectable problem - use bootstrap buttons
-rw-r--r-- | pgcommitfest/commitfest/templates/base.html | 2 | ||||
-rw-r--r-- | pgcommitfest/commitfest/templates/base_form.html | 17 | ||||
-rw-r--r-- | pgcommitfest/commitfest/views.py | 1 |
3 files changed, 18 insertions, 2 deletions
diff --git a/pgcommitfest/commitfest/templates/base.html b/pgcommitfest/commitfest/templates/base.html index 55b6e84..940b2bf 100644 --- a/pgcommitfest/commitfest/templates/base.html +++ b/pgcommitfest/commitfest/templates/base.html @@ -41,7 +41,7 @@ <script src="/https/git.postgresql.org/static/commitfest/js/bootstrap-collapse.js"></script> <script src="/https/git.postgresql.org/static/commitfest/js/jquery-ui.js"></script> <script type="text/javascript" src="/https/git.postgresql.org/static/selectable/js/jquery.dj.selectable.js"></script> -{%if not block_bootstrap_button%}<script src="/https/git.postgresql.org/static/commitfest/js/bootstrap-button.js"></script>{%endif%} +<script src="/https/git.postgresql.org/static/commitfest/js/bootstrap-button.js"></script> <script src="/https/git.postgresql.org/static/commitfest/js/commitfest.js"></script> {%block morescript%}{%endblock%} </html> diff --git a/pgcommitfest/commitfest/templates/base_form.html b/pgcommitfest/commitfest/templates/base_form.html index d4c135a..4b079dc 100644 --- a/pgcommitfest/commitfest/templates/base_form.html +++ b/pgcommitfest/commitfest/templates/base_form.html @@ -66,6 +66,23 @@ div.controls ul.selectable-deck li.selectable-deck-item a.selectable-deck-remove {%if threadbrowse %} {%block morescript%} <script> +/* Set up djselectable to use bootstrap buttons */ +$.ui.djselectable.prototype._comboButtonTemplate = function (input) { + var icon = $("<i>").addClass("icon-chevron-down"); + // Remove current classes on the text input + $(input).attr("class", ""); + // Wrap with input-append + $(input).wrap('<div class="input-append" />'); + // Return button link with the chosen icon + return $("<a>").append(icon).addClass("btn btn-mini"); +}; +$.ui.djselectable.prototype._removeButtonTemplate = function (item) { + var icon = $("<i>").addClass("icon-remove-sign"); + // Return button link with the chosen icon + return $("<a>").append(icon).addClass("btn btn-mini"); +}; + +/* Build our button callbacks */ $(document).ready(function() { $('button.attachThreadButton').each(function (i,o) { var b = $(o); diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index ba0f911..6a72b93 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -168,7 +168,6 @@ def patchform(request, cfid, patchid): 'title': 'Edit patch', 'breadcrumbs': [{'title': cf.name, 'href': '/%s/' % cf.pk}, {'title': 'View patch', 'href': '/%s/%s/' % (cf.pk, patch.pk)}], - 'block_bootstrap_button': True, }, context_instance=RequestContext(request)) @login_required |