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