macros.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!-- Draw glyphicon icon from bootstrap-theme -->
  2. {% macro icon(action) -%}
  3. <span class="glyphicon glyphicon-{{ action }}"></span>
  4. {%- endmacro %}
  5. <!-- Draw favicon -->
  6. <!-- TODO: using url_for methode -->
  7. {% macro draw_favicon(favicon) -%}
  8. <img width="32" height="32" class="favicon" src="static/themes/oscar/img/icons/{{ favicon }}.png" alt="{{ favicon }}" />
  9. {%- endmacro %}
  10. <!-- Draw result header -->
  11. {% macro result_header(result, favicons) -%}
  12. <h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
  13. {%- endmacro %}
  14. <!-- Draw result sub header -->
  15. {% macro result_sub_header(result) -%}
  16. {% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
  17. <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
  18. {% if result.magnetlink %}<small> &bull; <a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} {{ _('magnet link') }}</a></small>{% endif %}
  19. {% if result.torrentfile %}<small> &bull; <a href="{{ result.torrentfile }}" class="torrentfile">{{ icon('download-alt') }} {{ _('torrent file') }}</a></small>{% endif %}
  20. {%- endmacro %}
  21. <!-- Draw result footer -->
  22. {% macro result_footer(result) -%}
  23. <div class="clearfix"></div>
  24. <span class="label label-default pull-right">{{ result.engine }}</span>
  25. <p class="text-muted">{{ result.pretty_url }}</p>
  26. {%- endmacro %}
  27. <!-- Draw result footer -->
  28. {% macro result_footer_rtl(result) -%}
  29. <div class="clearfix"></div>
  30. <span class="label label-default pull-left">{{ result.engine }}</span>
  31. <p class="text-muted">{{ result.pretty_url }}&lrm;</p>
  32. {%- endmacro %}
  33. {% macro preferences_item_header(info, label, rtl) -%}
  34. {% if rtl %}
  35. <div class="row form-group">
  36. <label class="col-sm-3 col-md-2 pull-right">{{ label }}</label>
  37. <span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>
  38. <div class="col-sm-4 col-md-4">
  39. {% else %}
  40. <div class="row form-group">
  41. <label class="col-sm-3 col-md-2">{{ label }}</label>
  42. <div class="col-sm-4 col-md-4">
  43. {% endif %}
  44. {%- endmacro %}
  45. {% macro preferences_item_footer(info, label, rtl) -%}
  46. {% if rtl %}
  47. </div>
  48. </div>
  49. {% else %}
  50. </div>
  51. <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
  52. </div>
  53. {% endif %}
  54. {%- endmacro %}