recipes.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {% extends "basebuildpage.html" %}
  2. {% load projecttags %}
  3. {% block title %} Recipes - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
  4. {% block localbreadcrumb %}
  5. <li>Recipes</li>
  6. {% endblock %}
  7. {% block nav-recipes %}
  8. <li class="active"><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
  9. {% endblock %}
  10. {% block buildinfomain %}
  11. <div class="col-md-10">
  12. <div class="page-header">
  13. <h1>
  14. {% if request.GET.search and objects.paginator.count > 0 %}
  15. {{objects.paginator.count}} recipe{{objects.paginator.count|pluralize}} found
  16. {%elif request.GET.search and objects.paginator.count == 0%}
  17. No recipes found
  18. {%else%}
  19. Recipes
  20. {%endif%}
  21. </h1>
  22. </div>
  23. {% if objects.paginator.count == 0 %}
  24. <div class="alert">
  25. <form class="no-results input-append" id="searchform">
  26. <input id="search" name="search" class="input-xxlarge" type="text" value="{%if request.GET.search%}{{request.GET.search}}{%endif%}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="input-append-addon btn" tabindex="-1"><i class="glyphicon glyphicon-remove"></i></a>{% endif %}
  27. <button class="btn" type="submit" value="Search">Search</button>
  28. <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all recipes</button>
  29. </form>
  30. </div>
  31. {% else %}
  32. {% include "basetable_top.html" %}
  33. {% for recipe in objects %}
  34. <tr class="data">
  35. <td class="recipe__name">
  36. <a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.name}}</a>
  37. </td>
  38. <td class="recipe__version">
  39. <a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.version}}</a>
  40. </td>
  41. <!-- Depends -->
  42. <td class="depends_on">
  43. {% with deps=recipe_deps|get_dict_value:recipe.pk %}
  44. {% with count=deps|length %}
  45. {% if count %}
  46. <a class="btn"
  47. title="<a href='{% url "recipe" build.pk recipe.pk %}#dependencies'>{{recipe.name}}</a> dependencies"
  48. data-content="<ul class='list-unstyled'>
  49. {% for i in deps|dictsort:"depends_on.name"%}
  50. <li><a href='{% url "recipe" build.pk i.depends_on.pk %}'>{{i.depends_on.name}}</a></li>
  51. {% endfor %}
  52. </ul>">
  53. {{count}}
  54. </a>
  55. {% endif %}
  56. {% endwith %}
  57. {% endwith %}
  58. </td>
  59. <!-- Brought in by -->
  60. <td class="depends_by">
  61. {% with revs=recipe_revs|get_dict_value:recipe.pk %}
  62. {% with count=revs|length %}
  63. {% if count %}
  64. <a class="btn"
  65. title="<a href='{% url "recipe" build.pk recipe.pk %}#brought-in-by'>{{recipe.name}}</a> reverse dependencies"
  66. data-content="<ul class='list-unstyled'>
  67. {% for i in revs|dictsort:"recipe.name" %}
  68. <li><a href='{% url "recipe" build.pk i.recipe.pk %}'>{{i.recipe.name}}</a></li>
  69. {% endfor %}
  70. </ul>">
  71. {{count}}
  72. </a>
  73. {% endif %}
  74. {% endwith %}
  75. {% endwith %}
  76. </td>
  77. <!-- Recipe file -->
  78. <td class="recipe_file">{{recipe.file_path}} {% if recipe.pathflags %}<i>({{recipe.pathflags}})</i>{% endif %}</td>
  79. <!-- Section -->
  80. <td class="recipe_section">{{recipe.section}}</td>
  81. <!-- License -->
  82. <td class="recipe_license">{{recipe.license}}</td>
  83. <!-- Layer -->
  84. <td class="layer_version__layer__name">{{recipe.layer_version.layer.name}}</td>
  85. <!-- Layer branch -->
  86. <td class="layer_version__branch">{{recipe.layer_version.branch}}</td>
  87. <!-- Layer commit -->
  88. <td class="layer_version__layer__commit">
  89. <a class="btn"
  90. data-content="<ul class='list-unstyled'>
  91. <li>{{recipe.layer_version.commit}}</li>
  92. </ul>">
  93. {{recipe.layer_version.commit|truncatechars:13}}
  94. </a>
  95. </td>
  96. </tr>
  97. {% endfor %}
  98. {% include "basetable_bottom.html" %}
  99. {% endif %}
  100. </div>
  101. {% endblock %}