1
0
mirror of https://github.com/github/choosealicense.com synced 2024-06-26 13:43:03 +02:00
choosealicense.com/_includes/license-overview.html
2016-02-12 15:51:44 -08:00

78 lines
2.9 KiB
HTML

<div class="license-family clearfix">
<div class="license-family-heading">
<h3 class="license-family-name">
<a href="{{ license.url }}">
{% if license.family %}
{{ license.family }}
{% else %}
{% if license.nickname %}
{{ license.nickname }}
{% else %}
{{ license.title }}
{% endif %}
{% endif %}
</a>
</h3>
<p class="license-family-description">{{ license.description }}</p>
</div>
<div class="license-details">
<div class="license-variations js-license-variations">
<!-- always show this div, even w/o variations, for proper spacing -->
{% if license.family %}
<ul class="nav-pills js-nav-pills">
{% assign variations = site.licenses | where:"hidden",false | where:"family",license.family %}
{% for variation in variations %}
<li{% if license.id == variation.id %} class="active"{% endif %}><a href="#{{ variation.id | remove: '.' | remove: '/licenses/' }}" data-selected-tab="variation-{{ variation.id | remove: '.' | remove: '/licenses/' }}">
{% if variation.nickname != nil %}
{{ variation.nickname }}
{% else %}
{{ variation.title }}
{% endif %}
</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
{% if license.family %}
{% assign variations = site.licenses | where:"hidden",false | where:"family",license.family %}
{% else %}
{% assign variations = site.licenses | where:"title",license.title %}
{% endif %}
{% for variation in variations %}
<div {% if variation.id %}id="{{ variation.id | remove: '.' | remove: '/licenses/' }}" {% endif %}class="variation-tab {% if variation.id %}variation-{{ variation.id | remove: '.' | remove: '/licenses/' }}{% endif %} js-variation-tab{% if license.id == variation.id %} active{% endif %}">
<table class="license-rules">
<tr>
{% assign types = "required|permitted|forbidden" | split: "|" %}
{% for type in types %}
<th class="label">{{ type | capitalize }}</th>
{% endfor %}
</tr>
<tr>
{% for type in types %}
<td>
<ul class="license-{{ type }}">
{% assign rules = site.data.rules[type] | sort: "label" %}
{% for rule_obj in rules %}
{% assign req = rule_obj.tag %}
{% if variation[type] contains req %}
<li class="{{ req }}">
<span class="license-sprite"></span>
{{ rule_obj.label }}
</li>
{% endif %}
{% endfor %}
</ul>
</td>
{% endfor %}
</tr>
</table>
<p class="small"><a href="{{ variation.url }}">View full {{ variation.title }} license »</a></p>
</div>
{% endfor %}
</div>
</div>