diff options
author | Filipp Lepalaan <filipp@mac.com> | 2015-11-11 15:43:55 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2015-11-11 15:43:55 +0200 |
commit | 19444b3b1c3d80b860d9d749942b7d2558950bcb (patch) | |
tree | 0942f5e005b7f607ee64d73978a6cf7912945adc /servo/templates/devices | |
parent | f51bc293756243e6880a1419a82fb51ea1733a30 (diff) | |
download | Servo-19444b3b1c3d80b860d9d749942b7d2558950bcb.tar.gz Servo-19444b3b1c3d80b860d9d749942b7d2558950bcb.tar.bz2 Servo-19444b3b1c3d80b860d9d749942b7d2558950bcb.zip |
Refactored searches into separate module
Diffstat (limited to 'servo/templates/devices')
-rwxr-xr-x | servo/templates/devices/search_gsx.html | 51 | ||||
-rwxr-xr-x | servo/templates/devices/search_gsx_parts.html | 46 | ||||
-rwxr-xr-x | servo/templates/devices/search_gsx_results.html | 8 | ||||
-rwxr-xr-x | servo/templates/devices/view.html | 2 |
4 files changed, 53 insertions, 54 deletions
diff --git a/servo/templates/devices/search_gsx.html b/servo/templates/devices/search_gsx.html index 4f06b81..007befe 100755 --- a/servo/templates/devices/search_gsx.html +++ b/servo/templates/devices/search_gsx.html @@ -3,39 +3,38 @@ {% block second_column %} {% block tabs %} - <ul class="nav nav-tabs" id="gsx-tabs"> - {% if param == 'serialNumber' or param == 'alternateDeviceId' %} - <li><a href="{% url 'devices-search_gsx' 'warranty' param query %}">{% trans "Device" %}</a></li> - {% else %} - <li class="disabled"><a href="#">{% trans "Device" %}</a></li> - {% endif %} - {% if param == 'serialNumber' or param == 'alternateDeviceId' %} - <li><a href="{% url 'devices-search_gsx' 'orders' param query %}">{% trans "Orders" %}</a></li> - {% else %} - <li class="disabled"><a href="#">{% trans "Orders" %}</a></li> - {% endif %} - {% if param == 'serialNumber' or param == 'partNumber' %} - <li><a href="{% url 'devices-search_gsx' 'parts' param query %}">{% trans "Parts" %}</a></li> - {% else %} - <li class="disabled"><a href="#">{% trans "Parts" %}</a></li> - {% endif %} - {% if param == 'serialNumber' or param == 'dispatchId' %} - <li><a href="{% url 'devices-search_gsx' 'repairs' param query %}">{% trans "Repairs" %}</a></li> - {% else %} - <li class="disabled"><a href="#">{% trans "Repairs" %}</a></li> - {% endif %} - </ul> +<ul class="nav nav-tabs" id="gsx-tabs"> +{% if param == 'serialNumber' or param == 'alternateDeviceId' %} + <li><a href="{% url 'search-search_gsx' 'warranty' param query %}">{% trans "Device" %}</a></li> +{% else %} + <li class="disabled"><a href="#">{% trans "Device" %}</a></li> +{% endif %} +{% if param == 'serialNumber' or param == 'alternateDeviceId' %} + <li><a href="{% url 'search-search_gsx' 'orders' param query %}">{% trans "Orders" %}</a></li> + {% else %} + <li class="disabled"><a href="#">{% trans "Orders" %}</a></li> + {% endif %} + {% if param == 'serialNumber' or param == 'partNumber' %} + <li><a href="{% url 'search-search_gsx' 'parts' param query %}">{% trans "Parts" %}</a></li> + {% else %} + <li class="disabled"><a href="#">{% trans "Parts" %}</a></li> + {% endif %} + {% if param == 'serialNumber' or param == 'dispatchId' %} + <li><a href="{% url 'search-search_gsx' 'repairs' param query %}">{% trans "Repairs" %}</a></li> + {% else %} + <li class="disabled"><a href="#">{% trans "Repairs" %}</a></li> + {% endif %} +</ul> {% endblock tabs %} {% block results %} - {% include "devices/search_gsx_results.html" %} + {% include "devices/search_gsx_results.html" %} {% endblock results %} - {% endblock second_column %} {% block media %} <script type="text/javascript"> - var loc = location.pathname + location.search; - $('#gsx-tabs>li>a[href="'+loc+'"]').parent().addClass('active'); + var loc = location.pathname + location.search; + $('#gsx-tabs>li>a[href="'+loc+'"]').parent().addClass('active'); </script> {% endblock media %} diff --git a/servo/templates/devices/search_gsx_parts.html b/servo/templates/devices/search_gsx_parts.html index 63bfdb9..48ba7a7 100755 --- a/servo/templates/devices/search_gsx_parts.html +++ b/servo/templates/devices/search_gsx_parts.html @@ -3,28 +3,28 @@ {% autoescape on %} {% for p in results %} - <tr> - <td><a href="{% url 'products-view_product' code=p.code %}">{{ p.code }}</a></td> - <td>{{ p.title }}<br/><span class="muted small" title="{{ p.eee_code }}">{{ p.eee_code|truncatechars:40 }}</td> - <td>{{ p.price_sales_exchange|currency }}</td> - <td>{{ p.price_sales_stock|currency }}</td> - <td>0</td> - <td> - <div class="btn-group pull-right"> - <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> - <i class="icon-cog"></i> <span class="caret"></span> - </a> - <ul class="dropdown-menu"> - <li{% if not perms.servo.add_product %} class="disabled"{% endif %}> - {% if device %} - <a href="{% url 'products-create' group=device.get_product_category code=p.code %}">{% trans "Create Product" %}</a> - {% else %} - <a href="{% url 'products-create' code=p.code %}">{% trans "Create Product" %}</a> - {% endif %} - </li> - </ul> - </div> - </td> - </tr> +<tr> + <td><a href="{% url 'products-view_product' code=p.code %}">{{ p.code }}</a></td> + <td>{{ p.title }}<br/><span class="muted small" title="{{ p.eee_code }}">{{ p.eee_code|truncatechars:40 }}</td> + <td>{{ p.price_sales_exchange|currency }}</td> + <td>{{ p.price_sales_stock|currency }}</td> + <td>0</td> + <td> + <div class="btn-group pull-right"> + <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> + <i class="icon-cog"></i> <span class="caret"></span> + </a> + <ul class="dropdown-menu"> + <li{% if not perms.servo.add_product %} class="disabled"{% endif %}> + {% if device %} + <a href="{% url 'products-create' group=device.get_product_category code=p.code %}">{% trans "Create Product" %}</a> + {% else %} + <a href="{% url 'products-create' code=p.code %}">{% trans "Create Product" %}</a> + {% endif %} + </li> + </ul> + </div> + </td> +</tr> {% endfor %} {% endautoescape %} diff --git a/servo/templates/devices/search_gsx_results.html b/servo/templates/devices/search_gsx_results.html index b7a0926..df92660 100755 --- a/servo/templates/devices/search_gsx_results.html +++ b/servo/templates/devices/search_gsx_results.html @@ -1,5 +1,5 @@ -<div id="gsx-container" data-source="{% url 'devices-get_gsx_search_results' what param query %}"> - <div class="progress active"> - <div class="bar" style="width:1%;" data-progress="0"></div> - </div> +<div id="gsx-container" data-source="{% url 'search-get_gsx_search_results' what param query %}"> + <div class="progress active"> + <div class="bar" style="width:1%;" data-progress="0"></div> + </div> </div> diff --git a/servo/templates/devices/view.html b/servo/templates/devices/view.html index fd6d3a9..51a30c1 100755 --- a/servo/templates/devices/view.html +++ b/servo/templates/devices/view.html @@ -66,7 +66,7 @@ </div> {% if device.is_apple_device %} <div class="tab-pane" id="tab3"> - <div id="gsx-container" data-source="{% url 'devices-search_gsx' what='repairs' param='serialNumber' query=device.sn %}"> + <div id="gsx-container" data-source="{% url 'search-search_gsx' what='repairs' param='serialNumber' query=device.sn %}"> <div class="progress active"> <div class="bar" style="width:100%;" data-progress="0"></div> </div> |