Make sure the page displays correctly with Bootstrap 3, but when showing the table of packages and when showing no packages.
Signed-off-by: Belen Barros Pena <[email protected]> --- .../lib/toaster/toastergui/static/css/default.css | 12 ++- bitbake/lib/toaster/toastergui/tables.py | 3 +- .../toaster/toastergui/templates/customrecipe.html | 95 +++++++++++----------- .../toastergui/templates/pkg_add_rm_btn.html | 10 +-- .../snippets/pkg_dependencies_popover.html | 2 +- .../snippets/pkg_revdependencies_popover.html | 2 +- .../toaster/toastergui/templates/toastertable.html | 2 + 7 files changed, 67 insertions(+), 59 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css index 43c7c54..20bf498 100644 --- a/bitbake/lib/toaster/toastergui/static/css/default.css +++ b/bitbake/lib/toaster/toastergui/static/css/default.css @@ -49,12 +49,15 @@ img.logo { height: 30px; vertical-align: bottom; } /* Styles for our table controls */ .form-control[id^="search-input-"], .form-control[id^="new-search-input-"] { width: 30em; } +#search-input-selectpackagestable, +.form-control[id^="no-results-search-input-"]{ width: 20em; } #edit-columns-button { margin-right: 30px; } .navbar-default[id^="table-chrome-"] { background-color: transparent; } [id^="table-chrome-collapse-"] .navbar-form { margin-left: -15px; } .dropdown-menu.editcol { padding-left: 10px; min-width: 180px; } span[class^="remove-search-btn-"] { position: absolute; right: 5px; top: 0; bottom: 0; height: 14px; margin: auto; font-size: 14px; cursor: pointer; color: #777;} span[class^="remove-search-btn-"]:hover { color: #333; } +#no-results-special-selectpackagestable .form-inline { margin-top: 20px; } [id^="pagination-"] .pagination, [id^="pagination-"] .navbar-form { margin-top: 0; } [id^="table-chrome-"] .navbar-form { margin-left: -15px; margin-right: -15px; } @@ -77,7 +80,8 @@ thead > tr > th > a.sorted { font-weight: bold; color: #333; } thead > tr > th > .glyphicon-question-sign { margin-right: 5px; } /* Style build outcome in tables, download, remove and change icons */ -tbody > tr > td > .glyphicon-ok-circle { color: #3c763d; } +tbody > tr > td > .glyphicon-ok-circle, +dd > .glyphicon-ok-circle { color: #3c763d; } tbody > tr > td > .glyphicon-minus-sign { color: #a94442; } .glyphicon-download-alt, .glyphicon-edit { color: #337ab7; } @@ -169,7 +173,8 @@ legend { border: none; } .help-inline { color: #737373; margin-left: 10px; } /* Give some padding to the in-cell tooltips we use for notifications in tables */ -td > .tooltip-inner { padding: 10px; } +td > .tooltip-inner, +.inline-notification { padding: 10px; } /* Set sane widths for table columns */ #newcustomimagestable .get_description_or_summary, @@ -198,3 +203,6 @@ code { color: #333; background-color: transparent; } /* Style the new window icons */ .glyphicon-new-window:hover { text-decoration: none; } .dl-horizontal > dd > .glyphicon-new-window { margin-left: 5px; } + +/* Style the special no results message in the custom image details page */ +[id^="no-results-special-"] > .alert-warning > ol { margin-top: 10px; } diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index efc9c7b..f9940db 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -725,7 +725,8 @@ class PackagesTable(ToasterTable): self.add_column(title="License", field_name="license", - orderable=True) + orderable=True, + hidden=True) self.add_column(title="Dependencies", diff --git a/bitbake/lib/toaster/toastergui/templates/customrecipe.html b/bitbake/lib/toaster/toastergui/templates/customrecipe.html index fa76c8a..1a7f576 100644 --- a/bitbake/lib/toaster/toastergui/templates/customrecipe.html +++ b/bitbake/lib/toaster/toastergui/templates/customrecipe.html @@ -5,7 +5,6 @@ {% block pagecontent %} {% with recipe.get_base_recipe_file as base_recipe_file %} -<div class="row"> <ul class="breadcrumb"> <li> <a href="{% url 'project' project.id %}">{{project.name}}</a> @@ -18,7 +17,6 @@ {{recipe.name}} ({{recipe.layer_version.layer.name}}) </li> </ul> -</div> <script src="{% static 'js/customrecipe.js' %}"></script> <script> @@ -89,28 +87,24 @@ </div><!-- /.modal --> <!-- end package dependencies modal --> -<div class="row"> - <div class="col-md-12"> - <div class="alert alert-success lead" id="image-created-notification" style="margin-top: 15px; display: none"> - <button type="button" data-dismiss="alert" class="close">x</button> - Your custom image <strong>{{recipe.name}}</strong> has been created. You can now add or remove packages as needed. - </div> - <div class="page-header"> - <h1> - {{recipe.name}} - <small>({{recipe.layer_version.layer.name}})</small> - </h1> - </div> - </div> +<div class="alert alert-success lead" id="image-created-notification" style="margin-top: 15px; display: none"> + <button type="button" data-dismiss="alert" class="close">x</button> + Your custom image <strong>{{recipe.name}}</strong> has been created. You can now add or remove packages as needed. +</div> +<div class="page-header"> + <h1> + {{recipe.name}} + <small>({{recipe.layer_version.layer.name}})</small> + </h1> </div> <div class="row"> <div class="col-md-8"> <div class="button-place btn-group" style="width: 100%"> - <a class="btn btn-large col-md-6 build-custom-image" href="#" style="width: 50%"> + <a class="btn btn-default btn-lg build-custom-image" href="#" style="width: 50%"> Build {{recipe.name}} </a> - <a href="{% url 'customrecipedownload' project.id recipe.id %}" class="btn btn-large span6" style="width: 50%" + <a href="{% url 'customrecipedownload' project.id recipe.id %}" class="btn btn-default btn-lg" style="width: 50%" {% if not base_recipe_file %} disabled="disabled" {% endif %}> @@ -121,61 +115,64 @@ {% endif %} </a> </div> - <div id="no-results-special-{{table_name}}" class="air" style="display:none;"> - <div class="alert"> + <div id="no-results-special-{{table_name}}" class="top-air" style="display:none;"> + <div class="alert alert-warning"> <h3>No packages found</h3> - <p>You might consider <a href={% url 'projectsoftwarerecipes' project.id %}>searching the list of recipes</a> instead. If you find a recipe that matches the name of the package you want:</p> + <p>You might consider <a href={% url 'projectsoftwarerecipes' project.id %}>searching the list of recipes</a> instead.</p> + <p>If you find a recipe that matches the name of the package you want:</p> <ol> <li>Add the layer providing the recipe to your project</li> <li>Build the recipe</li> <li>Once the build completes, come back to this page and search for the package</li> </ol> - <form class="input-append no-results"> - <input type="text" class="input-xlarge no-results-search-input" id="no-results-search-input-{{table_name}}" name="search" placeholder="Search {{title|lower}}" /> - <a href="#" class="input-append-addon btn" id="no-results-remove-search-btn" tabindex="-1"> - <i class="glyphicon glyphicon-remove"></i> - </a> - <button class="btn search-submit-{{table_name}}">Search</button> + <form class="form-inline no-results"> + <div class="form-group"> + <div class="btn-group"> + <input type="text" class="form-control no-results-search-input" id="no-results-search-input-{{table_name}}" name="search" placeholder="Search {{title|lower}}" /> + <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" id="no-results-remove-search-btn" tabindex="-1"></span> + </div> + </div> + <button class="btn btn-default search-submit-{{table_name}}">Search</button> <button class="btn btn-link" id="no-results-show-all-packages">Show all packages</button> </form> - </div> - </div> + </div> + </div> <div id="results-found-{{table_name}}"> - <div id="packages-table"> - {% if recipe.get_all_packages.count == 0 and last_build == None %} - <h2> Add | Remove packages </h2> - <div class="alert alert-info air"> - <p class="lead">Toaster has no package information for {{recipe.name}}. To generate package information, build {{recipe.name}}</p> - <button class="btn btn-info btn-large build-custom-image" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button> - </div> - {% else %} - {# ToasterTable for Adding remove packages #} - {% url 'recipeselectpackages' project.id recipe.id as xhr_table_url %} - <h2>{{title}} (<span class="table-count-{{table_name}}">0</span>) </h2> - {% include "toastertable.html" %} - {% endif %} - </div> + <div id="packages-table"> + {% if recipe.get_all_packages.count == 0 and last_build == None %} + <h2> Add | Remove packages </h2> + <div class="alert alert-info"> + <p class="lead">Toaster has no package information for {{recipe.name}}. To generate package information, build {{recipe.name}}</p> + <button class="btn btn-info btn-lg build-custom-image" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button> + </div> + {% else %} + {# ToasterTable for Adding remove packages #} + {% url 'recipeselectpackages' project.id recipe.id as xhr_table_url %} + <h2>{{title}} (<span class="table-count-{{table_name}}">0</span>) </h2> + {% include "toastertable.html" %} + {% endif %} + </div> </div> </div> <div class="col-md-4"> <div class="well"> - <h2 style="margin-bottom:20px;">About {{recipe.name}}</h2> + <h2>About {{recipe.name}}</h2> <dl> <dt> Approx. packages included - <i class="icon-question-sign get-help" title="" data-original-title="The number of packages included is based on information from previous builds and from parsing layers, so we can never be sure it is 100% accurate"></i> + <span class="glyphicon glyphicon-question-sign get-help" title="" data-original-title="The number of packages included is based on information from previous builds and from parsing layers, so we can never be sure it is 100% accurate"></span> </dt> <dd id="total-num-packages">{{recipe.get_all_packages.count}}</dd> <dt> Approx. package size - <i class="icon-question-sign get-help" title="" data-original-title="Package size is based on information from previous builds, so we can never be sure it is 100% accurate"></i> + <span class="glyphicon glyphicon-question-sign get-help" title="Package size is based on information from previous builds, so we can never be sure it is 100% accurate"></span> </dt> <dd id="total-size-packages">{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd> {% if last_build %} <dt>Last build</dt> <dd> - <i class="icon-ok-sign success"></i> + <span class="glyphicon glyphicon-ok-circle"></span> <a href="{% url 'projectbuilds' project.id%}">{{last_build.completed_on|date:"d/m/y H:i"}}</a> </dd> {% endif %} @@ -187,7 +184,7 @@ {% with recipe.get_last_successful_built_target as last_build_target %} <dt>Last build</dt> <dd> - <i class="icon-ok-sign success"></i> + <span class="glyphicon glyphicon-ok-circle"></span> <a href="{% url 'builddashboard' last_build_target.build.pk %}"> {{last_build_target.build.completed_on|date:"d/m/y H:i"}}</a> </dd> @@ -197,7 +194,7 @@ <dt>Recipe file</dt> <dd> <code>{{recipe.name}}_{{recipe.version}}.bb</code> - <a href="{% url 'customrecipedownload' project.pk recipe.pk %}"><i class="icon-download-alt" title="Download recipe file"></i></a> + <a href="{% url 'customrecipedownload' project.pk recipe.pk %}"><span class="glyphicon glyphicon-download-alt" data-toggle="tooltip" title="Download recipe file"></span></a> </dd> {% endif %} <dt>Layer</dt> @@ -231,7 +228,7 @@ <dt>License</dt> <dd> {{recipe.license}} - <i class="icon-question-sign get-help" title="" data-original-title="All custom images have their license set to MIT. This is because the license applies only to the recipe (.bb) file, and not to the image itself. To see which licenses apply to the image you must check the license manifest generated with each build"></i> + <span class="glyphicon glyphicon-question-sign get-help" title="All custom images have their license set to MIT. This is because the license applies only to the recipe (.bb) file, and not to the image itself. To see which licenses apply to the image you must check the license manifest generated with each build"></i> </dd> </dl> <!-- diff --git a/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html b/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html index 0c71c8a..303faec 100644 --- a/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html +++ b/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html @@ -1,12 +1,12 @@ {# TODO move to snippets dir #} {% if data.is_locale_package %} <p class="text-center"> - <span class="muted">Locale package</span> - <i class="icon-question-sign get-help hover-help" title="" - data-original-title="This package is included in your image + <span class="text-muted">Locale package</span> + <span class="glyphicon glyphicon-question-sign get-help hover-help" + title="This package is included in your image based on the locale specified in the IMAGE_LINGUAS variable" style="visibility: hidden;"> - </i> + </span> </p> {% else %} @@ -21,7 +21,7 @@ <i class="icon-trash no-tooltip"></i> Remove package </button> - <button class="btn btn-block add-rm-package-btn" data-directive="add" data-id="{{data.pk}}" data-package-url="{% url 'xhr_customrecipe_packages' extra.recipe_id data.pk %}" data-name="{{data.name}}" style=" + <button class="btn btn-default btn-block add-rm-package-btn" data-directive="add" data-id="{{data.pk}}" data-package-url="{% url 'xhr_customrecipe_packages' extra.recipe_id data.pk %}" data-name="{{data.name}}" style=" {% if data.pk in extra.current_packages %} display:none {% endif %} diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html index 5ffcc6c..0a24e92 100644 --- a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html +++ b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html @@ -6,7 +6,7 @@ {% for dep in data.package_dependencies_source.all_depends %} <li>{{dep.depends_on.name}} {% if dep.depends_on.size > 0 %}({{dep.depends_on.size|filtered_filesizeformat}}){% endif %}</li> {% endfor %} - </ul>" title="" class="btn" data-original-title=" + </ul>" class="btn btn-default" title=" <strong>{{data.name}}</strong> dependencies - <strong>{{data.package_dependencies_source.get_total_source_deps_size.depends_on__size__sum|filtered_filesizeformat}}</strong>"> {{dep_count}} </a> diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html index 301d154..d470712 100644 --- a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html +++ b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html @@ -6,7 +6,7 @@ {% for dep in data.package_dependencies_target.all_depends|dictsort:'package.name' %} <li>{{dep.package.name}} {% if dep.package.size > 0 %}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li> {% endfor %} - </ul>" title="" class="btn" data-original-title=" + </ul>" class="btn btn-default" title=" <strong>{{data.name}}</strong> reverse dependencies - <strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum|filtered_filesizeformat}}</strong>"> {{dep_count}} </a> diff --git a/bitbake/lib/toaster/toastergui/templates/toastertable.html b/bitbake/lib/toaster/toastergui/templates/toastertable.html index 6634c20..e30acb5 100644 --- a/bitbake/lib/toaster/toastergui/templates/toastertable.html +++ b/bitbake/lib/toaster/toastergui/templates/toastertable.html @@ -121,3 +121,5 @@ </div> </form> </div> + +</div> <!--end table container --> -- 1.9.1 -- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
