Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update system_dependencies, fixing bugs, removing cruft, and adding descriptions from Python #416

Merged
merged 11 commits into from
Sep 25, 2024
25 changes: 6 additions & 19 deletions _includes/package_body.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h3 class="panel-title">Wiki Tutorials</h3>

<div class="tab-pane" id="{{distro}}-deps">
<div class="row">
<div class="col-sm-5">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Package Dependencies</h3>
Expand All @@ -229,7 +229,6 @@ <h3 class="panel-title">Package Dependencies</h3>
<table class="table table-condensed table-striped">
<thead>
<th class="text-center">Deps</th>
<th class="text-center"><span class="glyphicon glyphicon-th" title="Package instances"></span></th>
<th style="width: 100%">Name</th>
</thead>
<tbody>
Expand All @@ -238,26 +237,16 @@ <h3 class="panel-title">Package Dependencies</h3>
{% if n_instances > 0 %}
<tr>
<td class="text-center">
{% assign n_2nd_order_pdeps = p[1].snapshots[distro].data.pkg_deps | size %}
{% assign n_2nd_order_sdeps = p[1].snapshots[distro].data.system_deps | size %}
{% assign n_2nd_order_deps = n_2nd_order_pdeps | plus: n_2nd_order_sdeps %}
<a href="{{site.baseurl}}/p/{{p[0]}}#{{distro}}-deps" {% if n_2nd_order_deps == 0 %}class="inactive"{% endif %}>
{% assign n_2nd_order_deps = p[1].snapshots[distro].data.pkg_deps | size %}
<a href="{{site.baseurl}}/p/{{p[0]}}#{{distro}}-deps" {% if n_2nd_order_deps == 0 %}class="endoftree"{% endif %}>
<span class="glyphicon glyphicon-arrow-left" title="Package dependencies"></span>
</a>
</td>
<td class="text-center">
<a href="{{site.baseurl}}/packages/{{p[0]}}" class="label label-{% if n_instances > 1 %}primary{% else %}default{% endif %}">
{{n_instances}}
</a>
</td>
<td><a href="{{site.baseurl}}/p/{{p[0]}}#{{distro}}">{{p[0]}}</a></td>
<td><a href="{{site.baseurl}}/p/{{p[0]}}#{{distro}}">{{p[0]}} {{n_2nd_order_pdeps}} {{n_2nd_order_sdeps}}</a></td>
</tr>
{% else %}
<tr>
<td class="text-center"></td>
<td class="text-center">
<span class="label label-danger">0</span>
</td>
<td>{{p[0]}}</td>
</tr>
{% endif %}
Expand Down Expand Up @@ -298,7 +287,7 @@ <h3 class="panel-title">System Dependencies</h3>
</div>
</div>

<div class="col-sm-7">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Dependant Packages</h3>
Expand All @@ -308,7 +297,6 @@ <h3 class="panel-title">Dependant Packages</h3>
<table class="table table-condensed table-striped">
<thead>
<th>Name</th>
<th>Repo</th>
<th class="text-center">Deps</th>
</thead>
<tbody>
Expand All @@ -317,10 +305,9 @@ <h3 class="panel-title">Dependant Packages</h3>
{% for dep_instance in d[1] %}
<tr>
<td><a href="{{site.baseurl}}/p/{{dep_name}}/{{dep_instance.id}}#{{distro}}">{{dep_name}}</a></td>
<td><a href="{{site.baseurl}}/r/{{dep_instance.repo.name}}/{{dep_instance.id}}">{{dep_instance.id}}</a></td>
<td class="text-center">
{% assign n_2nd_order_deps = dep_instance.package.data.dependants | size %}
<a href="{{site.baseurl}}/p/{{dep_name}}/{{dep_instance.id}}#{{distro}}-deps" {% if n_2nd_order_deps == 0 %}class="inactive"{% endif %}>
<a href="{{site.baseurl}}/p/{{dep_name}}/{{dep_instance.id}}#{{distro}}-deps" {% if n_2nd_order_deps == 0 %}class="endoftree"{% endif %}>
<span class="glyphicon glyphicon-arrow-right"></span>
</a>
</td>
Expand Down
52 changes: 27 additions & 25 deletions _layouts/dep.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
{% comment %}<img style="width: 80px;" src="{{ '/assets/repo.png' | prepend: site.baseurl }}">{% endcomment %}
</td>
<td>
<h3><a style="text-decoration:none;" href="{{site.baseurl}}/d/{{page.dep_name}}">{{page.dep_name}}</a> <small>system dep</small></h3>
<h3><a style="text-decoration:none;" href="{{site.baseurl}}/d/{{page.dep_name}}">{{page.dep_name}}</a>
<small> {{page.description}}</small></h3>
</td>
</tr>
</table>
Expand All @@ -30,6 +31,31 @@ <h3><a style="text-decoration:none;" href="{{site.baseurl}}/d/{{page.dep_name}}"
</div>
</div>

<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Used in Packages</h3></div>
<div class="panel-body table-responsive">
<table class="table">
<tbody>
{% for distro_dependants in page.dependants_per_distro %}
{% assign distro = distro_dependants[0] %}
{% assign dependants = distro_dependants[1] %}
<tr>
<th scope="row">{{distro}}</th>
<td>
{% for dependant in dependants %}
<a href="{{site.baseurl}}/p/{{dependant.package.name}}#{{distro}}" class="label label-primary pkg-label">
{{dependant.package.name}}
</a>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

</div>
</div>

<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Dependency Availability</h3></div>
Expand Down Expand Up @@ -107,28 +133,4 @@ <h3><a style="text-decoration:none;" href="{{site.baseurl}}/d/{{page.dep_name}}"
</div>
</div>

<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Used in Packages</h3></div>
<div class="panel-body table-responsive">
<table class="table">
<tbody>
{% for distro_dependants in page.dependants_per_distro %}
{% assign distro = distro_dependants[0] %}
{% assign dependants = distro_dependants[1] %}
<tr>
<th scope="row">{{distro}}</th>
<td>
{% for dependant in dependants %}
<a href="{{site.baseurl}}/p/{{dependant.package.name}}#{{distro}}" class="label label-primary pkg-label">
{{dependant.package.name}}
</a>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

</div>
</div>
</div>
166 changes: 76 additions & 90 deletions _layouts/system_deps.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,107 +10,93 @@
<li class="active">System Dependencies</li>
</ol>
</div>
<div class="row">
{% comment %}{% include distro_switch.html %}{% endcomment %}
</div>
<div class="row">
{% comment %}&nbsp;{% endcomment %}
</div>
{% for distro in page.all_distros %}
<div class="row distro distro-{{distro}}">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">System Dependencies </h3></div>
<div class="table-responsive">
<table class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th style="text-align: left;">
{% if page.sort_id == 'name' %}
<span class="selected-sort-label">Name</span>
{% else %}
<a class="unselected-sort-label" href="{{site.baseurl}}/deps/page/1/name">Name</a>
{% endif %}
</th>
{% for platform in site.data.platforms %}
<th>
{% comment %}class="rotate45" style="text-align:left;">{% endcomment %}
{{ platform[0] }}
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for dep in page.list[distro] %}
{% assign dep_name = dep[0] %}
{% assign dep_details = dep[1] %}
<tr>
<td>
<a href="{{site.baseurl}}/d/{{dep_name}}">{{ dep_name }}</a>
</td>
{% comment %}<td>{% endcomment %}
{% comment %}{{dep_details}}{% endcomment %}
{% comment %}</td>{% endcomment %}
{% for p in site.data.platforms %}
{% assign platform = p[0] %}
{% assign platform_details = p[1] %}
{% assign versions = platform_details.versions %}
<div class="row panel panel-default">
<div class="panel-heading"><h3 class="panel-title">System Dependencies </h3></div>
<div class="table-responsive">
<table class="table table-condensed table-striped table-hover">
<thead>
<tr>
<th style="text-align: left;">
{% if page.sort_id == 'name' %}
<span class="selected-sort-label">Name</span>
{% else %}
<a class="unselected-sort-label" href="{{site.baseurl}}/deps/page/1/name">Name</a>
{% endif %}
</th>
<th style="text-align: right;">Usage</th>
<th style="text-align: left;">Description</th>
{% for platform in site.data.common.platforms %}
<th style="text-align:left;" class="rotatel90">
<div><span>{{platform[0]}}</span></div>
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for dep in page.list %}
{% assign dep_name = dep[0] %}
{% assign dep_details = dep[1].data_per_platform %}
{% assign dep_description = dep[1].description %}
{% assign dep_usage = dep[1].dependants_per_distro | size %}
<tr>
<td>
<a href="{{site.baseurl}}/d/{{dep_name}}">{{ dep_name }}</a>
</td>
<td style="text-align: right;">{{dep_usage}}</td>
<td>{{dep_description}}</td>
{% for p in site.data.common.platforms %}
{% assign platform = p[0] %}
{% assign platform_details = p[1] %}
{% assign versions = platform_details.versions %}


{% assign found_all = true %}
{% assign found_one = false %}
{% assign found_all = true %}
{% assign found_one = false %}

{% assign dep_platform = dep_details[platform] %}
{% assign dep_platform = dep_details[platform] %}

{% assign n_versions = versions | size %}
{% if n_versions > 0 %}
{% for v in versions %}
{% assign version_key = v[0] %}
{% assign dep_version = dep_platform[version_key] %}
{% assign n_deps = dep_version | size %}
{% if n_deps > 0 %}
{% assign found_one = true %}
{% else %}
{% assign found_all = false %}
{% endif %}
{% endfor %}
{% else %}
{% assign n_deps = dep_platform | size %}
{% if n_deps > 0 %}
{% assign found_one = true %}
{% else %}
{% assign found_all = false %}
{% endif %}
{% endif %}
{% if found_all %}
<td title="{{dep_name}} available in all {{platform}} versions" data-toggle="tooltip" data-placement="bottom" class="text-center">
<span class="glyphicon glyphicon-ok"></span>
</td>
{% elsif found_one %}
<td title="{{dep_name}} available in some {{platform}} versions" data-toggle="tooltip" data-placement="bottom" class="text-center">
<span class="glyphicon glyphicon-minus"></span>
</td>
{% assign n_versions = versions | size %}
{% if n_versions > 0 %}
{% for v in versions %}
{% assign version_key = v[0] %}
{% assign dep_version = dep_platform[version_key] %}
{% assign n_deps = dep_version | size %}
{% if n_deps > 0 %}
{% assign found_one = true %}
{% else %}
<td title="{{dep_name}} not available in any {{platform}} version" data-toggle="tooltip" data-placement="bottom" class="text-center">
<span class="glyphicon glyphicon-none"></span>
</td>
{% assign found_all = false %}
{% endif %}
{% endfor %}
</tr>
{% else %}
{% assign n_deps = dep_platform | size %}
{% if n_deps > 0 %}
{% assign found_one = true %}
{% else %}
{% assign found_all = false %}
{% endif %}
{% endif %}
{% if found_all %}
<td title="{{dep_name}} available in all {{platform}} versions" data-toggle="tooltip" data-placement="bottom" class="text-center">
<span class="glyphicon glyphicon-ok"></span>
</td>
{% elsif found_one %}
<td title="{{dep_name}} available in some {{platform}} versions" data-toggle="tooltip" data-placement="bottom" class="text-center">
<span class="glyphicon glyphicon-minus"></span>
</td>
{% else %}
<td title="{{dep_name}} not available in any {{platform}} version" data-toggle="tooltip" data-placement="bottom" class="text-center">
<span class="glyphicon glyphicon-none"></span>
</td>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}
</div>
<div class="row text-center">
{% include package_pager.html %}
</div>
</div>
</div>

<script type="text/javascript">
$(document).ready(function() {
setupDistroSwitch("{{ site.distros[0] }}");
});
</script>
Loading
Loading