)]}'
{"horizon/forms/fields.py":[{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"dd57094b53aa1dbef1d7b3537f3b0f8bcc2c430e","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                        kwargs[\u0027attrs\u0027][\u0027id\u0027]))"},{"line_number":178,"context_line":"        content \u003d u\"\u003cdiv class\u003d\u0027dynamic-select\u0027\u003e{0}{1}\u003c/div\u003e\".format(select,"},{"line_number":179,"context_line":"                                                                     button)"},{"line_number":180,"context_line":"        return html.mark_safe(content)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def get_add_item_url(self):"},{"line_number":183,"context_line":"        if callable(self.add_item_link):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_8305ee7b","line":180,"updated":"2014-08-27 17:06:30.000000000","message":"I\u0027m not a big fan of inlining HTML. Perhaps we can use a template here instead (or better yet in an existing template)? Also, we should not be using a + sign. There is a bootstrap glyph-icon for this.","commit_id":"ceea7880794f74ebdebc9eeb4c701db700b2f903"},{"author":{"_account_id":9647,"name":"Justin Pomeroy","email":"jpomero@linux.vnet.ibm.com","username":"jpomero"},"change_message_id":"5094cad18b6d93e25218dbe288a09acadb8d294b","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                        kwargs[\u0027attrs\u0027][\u0027id\u0027]))"},{"line_number":178,"context_line":"        content \u003d u\"\u003cdiv class\u003d\u0027dynamic-select\u0027\u003e{0}{1}\u003c/div\u003e\".format(select,"},{"line_number":179,"context_line":"                                                                     button)"},{"line_number":180,"context_line":"        return html.mark_safe(content)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def get_add_item_url(self):"},{"line_number":183,"context_line":"        if callable(self.add_item_link):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_493135ec","line":180,"in_reply_to":"1abeadc6_8305ee7b","updated":"2014-08-27 17:50:50.000000000","message":"I\u0027ll look at putting this into a template.  Good point on the icon.","commit_id":"ceea7880794f74ebdebc9eeb4c701db700b2f903"}],"horizon/static/horizon/js/horizon.forms.js":[{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"2679e33ebd48f3ab90765693aa9fbfb987034318","unresolved":false,"context_lines":[{"line_number":115,"context_line":"  }"},{"line_number":116,"context_line":"};"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"horizon.forms.bind_add_item_handlers \u003d function (el) {"},{"line_number":119,"context_line":"  var $selects \u003d $(el).find(\u0027select[data-add-item-url]\u0027);"},{"line_number":120,"context_line":"  $selects.each(function () {"},{"line_number":121,"context_line":"    var $this \u003d $(this);"}],"source_content_type":"text/javascript","patch_set":2,"id":"1abeadc6_17c04bdf","line":118,"updated":"2014-08-27 10:25:31.000000000","message":"I wonder why this hyperlink button is added in JavaScript and not in django template? There is nothing inherently dynamic in this button, such as updating options list of a select widget (https://github.com/openstack/horizon/blob/2014.2.b2/horizon/static/horizon/js/horizon.modals.js#L226).\n\nI\u0027ve tried modifying https://github.com/openstack/horizon/blob/2014.2.b2/horizon/forms/fields.py#L174 \nwith the following code (just a concept, maybe a bit clumsy for the final version):\n        select_widget \u003d super(DynamicSelectWidget, self).render(*args, **kwargs)\n        button \u003d \"\u003ca href\u003d\u0027{0}\u0027 data-add-to-field\u003d\u0027{1}\u0027 class\u003d\u0027btn ajax-add \" \\\n                 \"ajax-modal btn-default\u0027\u003e+\u003c/a\u003e\".format(add_item_url,\n                                                        kwargs[\u0027attrs\u0027][\u0027id\u0027])\n        text \u003d \"\u003cdiv class\u003d\u0027dynamic-select\u0027\u003e{0}{1}\u003c/div\u003e\".format(\n            select_widget, button)\n        return html.mark_safe(text)\n\nAfter that bind_add_item_handlers function can be dropped from client-side code.\n\nI doubt that moving such little piece of code from client-side to server-side can improve performance considerably, so you may regard this as a matter of taste.","commit_id":"85ca96c5954ec0fe55e4b7be484c56dc1d590081"},{"author":{"_account_id":9647,"name":"Justin Pomeroy","email":"jpomero@linux.vnet.ibm.com","username":"jpomero"},"change_message_id":"b02c48d961142a18d10b2d8efde548700e7ecc28","unresolved":false,"context_lines":[{"line_number":115,"context_line":"  }"},{"line_number":116,"context_line":"};"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"horizon.forms.bind_add_item_handlers \u003d function (el) {"},{"line_number":119,"context_line":"  var $selects \u003d $(el).find(\u0027select[data-add-item-url]\u0027);"},{"line_number":120,"context_line":"  $selects.each(function () {"},{"line_number":121,"context_line":"    var $this \u003d $(this);"}],"source_content_type":"text/javascript","patch_set":2,"id":"1abeadc6_730345b8","line":118,"in_reply_to":"1abeadc6_17c04bdf","updated":"2014-08-27 15:17:12.000000000","message":"It took me a long time to find this function here because I assumed this was done on the server like the other fields.  I will look into moving this to the server as you suggest, at least just to be consistent.\n\nIf that doesn\u0027t work for whatever reason then I will address the javascript issues mentioned below.","commit_id":"85ca96c5954ec0fe55e4b7be484c56dc1d590081"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"ea294251615408585a10f5091f5eac0c66384928","unresolved":false,"context_lines":[{"line_number":119,"context_line":"  var $selects \u003d $(el).find(\u0027select[data-add-item-url]\u0027);"},{"line_number":120,"context_line":"  $selects.each(function () {"},{"line_number":121,"context_line":"    var $this \u003d $(this);"},{"line_number":122,"context_line":"    $wrapper \u003d $(\"\u003cdiv class\u003d\u0027dynamic-select\u0027\u003e\u003c/div\u003e\");"},{"line_number":123,"context_line":"    $this.after($wrapper);"},{"line_number":124,"context_line":"    $this.appendTo($wrapper);"},{"line_number":125,"context_line":"    $button \u003d $(\"\u003ca href\u003d\u0027\" + $this.attr(\"data-add-item-url\") + \"\u0027 \" +"}],"source_content_type":"text/javascript","patch_set":2,"id":"1abeadc6_077cb4b4","line":122,"updated":"2014-08-26 21:25:43.000000000","message":"Nitpick:\n\n var $wrapper \u003d $(\u0027\u003cdiv\u003e\u0027).addClass(\u0027dynamic-select\u0027) \n\nNeed the var because it is intended for local use. Use addClass instead, same reason as https://review.openstack.org/#/c/112499/1/horizon/static/horizon/js/horizon.forms.js","commit_id":"85ca96c5954ec0fe55e4b7be484c56dc1d590081"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"2679e33ebd48f3ab90765693aa9fbfb987034318","unresolved":false,"context_lines":[{"line_number":119,"context_line":"  var $selects \u003d $(el).find(\u0027select[data-add-item-url]\u0027);"},{"line_number":120,"context_line":"  $selects.each(function () {"},{"line_number":121,"context_line":"    var $this \u003d $(this);"},{"line_number":122,"context_line":"    $wrapper \u003d $(\"\u003cdiv class\u003d\u0027dynamic-select\u0027\u003e\u003c/div\u003e\");"},{"line_number":123,"context_line":"    $this.after($wrapper);"},{"line_number":124,"context_line":"    $this.appendTo($wrapper);"},{"line_number":125,"context_line":"    $button \u003d $(\"\u003ca href\u003d\u0027\" + $this.attr(\"data-add-item-url\") + \"\u0027 \" +"}],"source_content_type":"text/javascript","patch_set":2,"id":"1abeadc6_3c360c53","line":122,"in_reply_to":"1abeadc6_077cb4b4","updated":"2014-08-27 10:25:31.000000000","message":"Agree with Thai on \u0027var\u0027 usage.","commit_id":"85ca96c5954ec0fe55e4b7be484c56dc1d590081"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"2679e33ebd48f3ab90765693aa9fbfb987034318","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    $wrapper \u003d $(\"\u003cdiv class\u003d\u0027dynamic-select\u0027\u003e\u003c/div\u003e\");"},{"line_number":123,"context_line":"    $this.after($wrapper);"},{"line_number":124,"context_line":"    $this.appendTo($wrapper);"},{"line_number":125,"context_line":"    $button \u003d $(\"\u003ca href\u003d\u0027\" + $this.attr(\"data-add-item-url\") + \"\u0027 \" +"},{"line_number":126,"context_line":"      \"data-add-to-field\u003d\u0027\" + $this.attr(\"id\") + \"\u0027 \" +"},{"line_number":127,"context_line":"      \"class\u003d\u0027btn ajax-add ajax-modal btn-default\u0027\u003e+\u003c/a\u003e\");"},{"line_number":128,"context_line":"    $button.appendTo($wrapper);"}],"source_content_type":"text/javascript","patch_set":2,"id":"1abeadc6_9c3ac032","line":125,"updated":"2014-08-27 10:25:31.000000000","message":"Could you please also add \u0027var\u0027 here for the same reason as above?","commit_id":"85ca96c5954ec0fe55e4b7be484c56dc1d590081"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"ea294251615408585a10f5091f5eac0c66384928","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    $this.appendTo($wrapper);"},{"line_number":125,"context_line":"    $button \u003d $(\"\u003ca href\u003d\u0027\" + $this.attr(\"data-add-item-url\") + \"\u0027 \" +"},{"line_number":126,"context_line":"      \"data-add-to-field\u003d\u0027\" + $this.attr(\"id\") + \"\u0027 \" +"},{"line_number":127,"context_line":"      \"class\u003d\u0027btn ajax-add ajax-modal btn-default\u0027\u003e+\u003c/a\u003e\");"},{"line_number":128,"context_line":"    $button.appendTo($wrapper);"},{"line_number":129,"context_line":"  });"},{"line_number":130,"context_line":"};"}],"source_content_type":"text/javascript","patch_set":2,"id":"1abeadc6_827fd265","line":127,"updated":"2014-08-26 21:25:43.000000000","message":"Same thing here, $(\u0027\u003ca\u003e\u0027).addAttr(....).addClass(...)","commit_id":"85ca96c5954ec0fe55e4b7be484c56dc1d590081"}]}
