diff options
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 1 | ||||
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/templates/recipes.html | 106 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 77 |
3 files changed, 145 insertions, 39 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 113631def0..1803de60e5 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -209,6 +209,7 @@ class Package_File(models.Model): | |||
| 209 | size = models.IntegerField() | 209 | size = models.IntegerField() |
| 210 | 210 | ||
| 211 | class Recipe(models.Model): | 211 | class Recipe(models.Model): |
| 212 | search_allowed_fields = ['name', 'version', 'file_path', 'license', 'layer_version__layer__name', 'layer_version__branch', 'layer_version__commit', 'layer_version__layer__local_path'] | ||
| 212 | name = models.CharField(max_length=100, blank=True) | 213 | name = models.CharField(max_length=100, blank=True) |
| 213 | version = models.CharField(max_length=100, blank=True) | 214 | version = models.CharField(max_length=100, blank=True) |
| 214 | layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version') | 215 | layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version') |
diff --git a/bitbake/lib/toaster/toastergui/templates/recipes.html b/bitbake/lib/toaster/toastergui/templates/recipes.html index 2e0c2d1c6d..aa0610434f 100755 --- a/bitbake/lib/toaster/toastergui/templates/recipes.html +++ b/bitbake/lib/toaster/toastergui/templates/recipes.html | |||
| @@ -1,51 +1,83 @@ | |||
| 1 | {% extends "basebuildpage.html" %} | 1 | {% extends "basebuildpage.html" %} |
| 2 | 2 | ||
| 3 | {% load projecttags %} | ||
| 4 | |||
| 3 | {% block localbreadcrumb %} | 5 | {% block localbreadcrumb %} |
| 4 | <li>Recipes</li> | 6 | <li>Recipes</li> |
| 5 | {% endblock %} | 7 | {% endblock %} |
| 6 | 8 | ||
| 7 | {% block buildinfomain %} | 9 | {% block buildinfomain %} |
| 8 | <div class="row-fluid pull-right span10"> | 10 | <div class="span10"> |
| 11 | <div class="page-header" style="margin-top:40px;"> | ||
| 12 | <h1> | ||
| 13 | {% if request.GET.filter or request.GET.search and objects.count > 0 %} | ||
| 14 | {{objects.paginator.count}} recipe{{objects.paginator.count|pluralize}} found | ||
| 15 | {%elif objects.paginator.count == 0%} | ||
| 16 | No Recipes | ||
| 17 | {%else%} | ||
| 18 | Recipes | ||
| 19 | {%endif%} | ||
| 20 | </h1> | ||
| 21 | </div> | ||
| 9 | {% include "basetable_top.html" %} | 22 | {% include "basetable_top.html" %} |
| 10 | 23 | ||
| 11 | <tr> | 24 | {% for recipe in objects %} |
| 12 | </tr> | ||
| 13 | <th>Name</th> | ||
| 14 | <th>Version</th> | ||
| 15 | <th>Summary</th> | ||
| 16 | <th>Description</th> | ||
| 17 | <th>Section</th> | ||
| 18 | <th>License</th> | ||
| 19 | <th>License file</th> | ||
| 20 | <th>Homepage</th> | ||
| 21 | <th>Bugtracker</th> | ||
| 22 | <th>File_path</th> | ||
| 23 | <th style="width: 30em">Recipe Dependency</th> | ||
| 24 | |||
| 25 | |||
| 26 | {% for recipe in objects %} | ||
| 27 | 25 | ||
| 28 | <tr class="data"> | 26 | <tr class="data"> |
| 29 | <td><a name="{{recipe.name}}" href="{% url "recipe" build.pk recipe.pk %}">{{recipe.name}}</a></td> | 27 | <td><a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.name}}</a></td> |
| 30 | <td>{{recipe.version}}</td> | 28 | <td><a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.version}}</a></td> |
| 31 | <td>{{recipe.summary}}</td> | 29 | <!-- Depends --> |
| 32 | <td>{{recipe.description}}</td> | 30 | <td class="depends_on"> |
| 33 | <td>{{recipe.section}}</td> | 31 | {% if recipe.r_dependencies_recipe.all.count %} |
| 34 | <td>{{recipe.license}}</td> | 32 | <a class="btn" |
| 35 | <td>{{recipe.licensing_info}}</td> | 33 | title="<a href='{% url "recipe" build.pk recipe.pk %}#dependencies'>{{recipe.name}}</a> depends on" |
| 36 | <td>{{recipe.homepage}}</td> | 34 | data-content="<ul class='unstyled'> |
| 37 | <td>{{recipe.bugtracker}}</td> | 35 | {% for i in recipe.r_dependencies_recipe.all|dictsort:"depends_on.name"%} |
| 38 | <td>{{recipe.file_path}}</td> | 36 | <li><a href='{% url "recipe" build.pk i.depends_on.pk %}'>{{i.depends_on.name}}</a></li> |
| 39 | <td> | 37 | {% endfor %} |
| 40 | <div style="height: 5em; overflow:auto"> | 38 | </ul>"> |
| 41 | {% for rr in recipe.r_dependencies_recipe.all %} | 39 | {{recipe.r_dependencies_recipe.all.count}} |
| 42 | <a href="#{{rr.depends_on.name}}">{{rr.depends_on.name}}</a><br/> | 40 | </a> |
| 43 | {% endfor %} | 41 | {% endif %} |
| 44 | </div> | 42 | </td> |
| 45 | </td> | 43 | <!-- Brought in by --> |
| 46 | </tr> | 44 | <td class="depends_by"> |
| 45 | {% if recipe.r_dependencies_depends.all.count %} | ||
| 46 | <a class="btn" | ||
| 47 | title="<a href='{% url "recipe" build.pk recipe.pk %}#brought-in-by'>{{recipe.name}}</a> is brought in by" | ||
| 48 | data-content="<ul class='unstyled'> | ||
| 49 | {% for i in recipe.r_dependencies_depends.all|dictsort:"recipe.name"%} | ||
| 50 | <li><a href='{% url "recipe" build.pk i.recipe.pk %}'>{{i.recipe.name}}</a></li> | ||
| 51 | {% endfor %} | ||
| 52 | </ul>"> | ||
| 53 | {{recipe.r_dependencies_depends.all.count}} | ||
| 54 | </a> | ||
| 55 | {% endif %} | ||
| 56 | </td> | ||
| 57 | <!-- Recipe file --> | ||
| 58 | <td class="recipe_file">{{recipe.file_path}}</td> | ||
| 59 | <!-- Section --> | ||
| 60 | <td class="recipe_section">{{recipe.section}}</td> | ||
| 61 | <!-- License --> | ||
| 62 | <td class="recipe_license">{{recipe.license}}</td> | ||
| 63 | <!-- Layer --> | ||
| 64 | <td class="layer_version__layer__name">{{recipe.layer_version.layer.name}}</td> | ||
| 65 | <!-- Layer branch --> | ||
| 66 | <td class="layer_version__branch">{{recipe.layer_version.branch}}</td> | ||
| 67 | <!-- Layer commit --> | ||
| 68 | <td class="layer_version__layer__commit"> | ||
| 69 | <a class="btn" | ||
| 70 | data-content="<ul class='unstyled'> | ||
| 71 | <li>{{recipe.layer_version.commit}}</li> | ||
| 72 | </ul>"> | ||
| 73 | {{recipe.layer_version.commit|truncatechars:13}} | ||
| 74 | </a> | ||
| 75 | </td> | ||
| 76 | <!-- Layer directory --> | ||
| 77 | <td class="layer_version__layer__local_path">{{recipe.layer_version.layer.local_path}}</td> | ||
| 78 | </tr> | ||
| 47 | 79 | ||
| 48 | {% endfor %} | 80 | {% endfor %} |
| 49 | 81 | ||
| 50 | {% include "basetable_bottom.html" %} | 82 | {% include "basetable_bottom.html" %} |
| 51 | </div> | 83 | </div> |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 37e2af2574..1105829d96 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -540,7 +540,7 @@ def tasks(request, build_id): | |||
| 540 | 540 | ||
| 541 | def recipes(request, build_id): | 541 | def recipes(request, build_id): |
| 542 | template = 'recipes.html' | 542 | template = 'recipes.html' |
| 543 | mandatory_parameters = { 'count': 100, 'page' : 1}; | 543 | mandatory_parameters = { 'count': 100, 'page' : 1, 'orderby':'name:+'}; |
| 544 | retval = _verify_parameters( request.GET, mandatory_parameters ) | 544 | retval = _verify_parameters( request.GET, mandatory_parameters ) |
| 545 | if retval: | 545 | if retval: |
| 546 | return _redirect_parameters( 'recipes', request.GET, mandatory_parameters, build_id = build_id) | 546 | return _redirect_parameters( 'recipes', request.GET, mandatory_parameters, build_id = build_id) |
| @@ -550,7 +550,80 @@ def recipes(request, build_id): | |||
| 550 | 550 | ||
| 551 | recipes = _build_page_range(Paginator(queryset, request.GET.get('count', 100)),request.GET.get('page', 1)) | 551 | recipes = _build_page_range(Paginator(queryset, request.GET.get('count', 100)),request.GET.get('page', 1)) |
| 552 | 552 | ||
| 553 | context = {'build': Build.objects.filter(pk=build_id)[0], 'objects': recipes, } | 553 | context = { |
| 554 | 'objectname': 'recipes', | ||
| 555 | 'build': Build.objects.filter(pk=build_id)[0], | ||
| 556 | 'objects': recipes, | ||
| 557 | 'tablecols':[ | ||
| 558 | { | ||
| 559 | 'name':'Recipe', | ||
| 560 | 'qhelp':'Information about a single piece of software, including where to download the source, configuration options, how to compile the source files and how to package the compiled output', | ||
| 561 | 'orderfield': _get_toggle_order(request, "name"), | ||
| 562 | 'ordericon':_get_toggle_order_icon(request, "name"), | ||
| 563 | }, | ||
| 564 | { | ||
| 565 | 'name':'Recipe version', | ||
| 566 | 'qhelp':'The recipe version and revision', | ||
| 567 | }, | ||
| 568 | { | ||
| 569 | 'name':'Dependencies', | ||
| 570 | 'qhelp':'Recipe build-time dependencies (other recipes)', | ||
| 571 | 'clclass': 'depends_on', 'hidden': 1, | ||
| 572 | }, | ||
| 573 | { | ||
| 574 | 'name':'Reverse dependencies', | ||
| 575 | 'qhelp':'Recipe build-time reverse dependencies (i.e. which other recipes depend on this recipe)', | ||
| 576 | 'clclass': 'depends_by', 'hidden': 1, | ||
| 577 | }, | ||
| 578 | { | ||
| 579 | 'name':'Recipe file', | ||
| 580 | 'qhelp':'Location in disk of the recipe .bb file', | ||
| 581 | 'orderfield': _get_toggle_order(request, "file_path"), | ||
| 582 | 'ordericon':_get_toggle_order_icon(request, "file_path"), | ||
| 583 | 'clclass': 'recipe_file', 'hidden': 0, | ||
| 584 | }, | ||
| 585 | { | ||
| 586 | 'name':'Section', | ||
| 587 | 'qhelp':'The section in which packages should be categorised. There are 5 sections: base, console, utils, devel and libs', | ||
| 588 | 'orderfield': _get_toggle_order(request, "section"), | ||
| 589 | 'ordericon':_get_toggle_order_icon(request, "section"), | ||
| 590 | 'clclass': 'recipe_section', 'hidden': 0, | ||
| 591 | }, | ||
| 592 | { | ||
| 593 | 'name':'License', | ||
| 594 | 'qhelp':'The list of source licenses for the recipe. Separate license names using | (pipe) means there is a choice between licenses. Separate license names using & (ampersand) means multiple licenses exist that cover different parts of the source', | ||
| 595 | 'orderfield': _get_toggle_order(request, "license"), | ||
| 596 | 'ordericon':_get_toggle_order_icon(request, "license"), | ||
| 597 | 'clclass': 'recipe_license', 'hidden': 0, | ||
| 598 | }, | ||
| 599 | { | ||
| 600 | 'name':'Layer', | ||
| 601 | 'qhelp':'The name of the layer prodiving the recipe', | ||
| 602 | 'orderfield': _get_toggle_order(request, "layer_version__layer__name"), | ||
| 603 | 'ordericon':_get_toggle_order_icon(request, "layer_version__layer__name"), | ||
| 604 | 'clclass': 'layer_version__layer__name', 'hidden': 0, | ||
| 605 | }, | ||
| 606 | { | ||
| 607 | 'name':'Layer branch', | ||
| 608 | 'qhelp':'The Git branch of the layer prodiving the recipe', | ||
| 609 | 'orderfield': _get_toggle_order(request, "layer_version__branch"), | ||
| 610 | 'ordericon':_get_toggle_order_icon(request, "layer_version__branch"), | ||
| 611 | 'clclass': 'layer_version__branch', 'hidden': 1, | ||
| 612 | }, | ||
| 613 | { | ||
| 614 | 'name':'Layer commit', | ||
| 615 | 'qhelp':'The Git commit of the layer prodiving the recipe', | ||
| 616 | 'clclass': 'layer_version__layer__commit', 'hidden': 1, | ||
| 617 | }, | ||
| 618 | { | ||
| 619 | 'name':'Layer directory', | ||
| 620 | 'qhelp':'Location in disk of the layer prodiving the recipe', | ||
| 621 | 'orderfield': _get_toggle_order(request, "layer_version__layer__local_path"), | ||
| 622 | 'ordericon':_get_toggle_order_icon(request, "layer_version__layer__local_path"), | ||
| 623 | 'clclass': 'layer_version__layer__local_path', 'hidden': 1, | ||
| 624 | }, | ||
| 625 | ] | ||
| 626 | } | ||
| 554 | 627 | ||
| 555 | return render(request, template, context) | 628 | return render(request, template, context) |
| 556 | 629 | ||
