Commit 32b000f3 authored by Curtis Adam's avatar Curtis Adam

Fix the show license modal

parent a5935c81
//------------------------ IMPORTS
import {Template} from "meteor/templating";
import {Session} from "meteor/session";
import "../../modal/license.js";
import "./license.html";
/*
......
<template name="showLicense">
<div class="modal fade" id="showLicenseModal" tabindex="-1" role="dialog"
aria-labelledby="showLicenseTitle">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 id="showLicenseTitle" class="modal-title">{{_ "sidebar-nav.poolLicense"}}: {{getTopic}}
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</h4>
</div>
<div class="modal-body">
<div class="form-horizontal">
<div class="form-group">
<div id=cc-description class="col-md-12">
{{#if getLicenseCount}}
{{#if getLicenseType 'by'}}
<img class="col-md-2" src="/img/by.large.png" alt="Namensnennung"/>
<p class="col-md-10">{{_ "modal-dialog.by-desc"}}</p>
{{/if}}
{{#if getLicenseType 'nc'}}
<img class="col-md-2" src="/img/nc-eu.large.png" alt="Nicht kommerziell"/>
<p class="col-md-10">{{_ "modal-dialog.nc-desc"}}</p>
{{/if}}
{{#if getLicenseType 'nd'}}
<img class="col-md-2" src="/img/nd.large.png" alt="Keine Bearbeitung"/>
<p class="col-md-10">{{_ "modal-dialog.nd-desc"}}</p>
{{/if}}
{{#if getLicenseType 'sa'}}
<img class="col-md-2" src="/img/sa.large.png"
alt="Weitergabe unter gleichen Bedingungen"/>
<p class="col-md-10">{{_ "modal-dialog.sa-desc"}}</p>
{{/if}}
{{else}}
<img class="col-md-2" src="/img/zero.large.png" alt="Keine Lizenz"/>
<p class="col-md-10">{{_ "modal-dialog.zero-desc"}}</p>
{{/if}}
</div>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</template>
//------------------------ IMPORTS
import {Template} from "meteor/templating";
import {Session} from "meteor/session";
import {Cardsets} from "../../../../api/cardsets.js";
import "./license.html";
/*
* ############################################################################
* showLicense
* ############################################################################
*/
Template.showLicense.helpers({
getTopic: function () {
if (Session.get('selectedCardset')) {
let item = Cardsets.findOne({_id: Session.get('selectedCardset')});
return item.name;
}
},
getLicenseCount: function () {
if (Session.get('selectedCardset')) {
let item = Cardsets.findOne({_id: Session.get('selectedCardset')});
return (item.license.length > 0);
}
},
getLicenseType: function (type) {
if (Session.get('selectedCardset')) {
let item = Cardsets.findOne({_id: Session.get('selectedCardset')});
return (item.license.includes(type));
}
}
});
......@@ -71,52 +71,3 @@
</div>
<!-- /.modal -->
</template>
<template name="showLicense">
<div class="modal fade" id="showLicenseModal" tabindex="-1" role="dialog"
aria-labelledby="showLicenseTitle">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 id="showLicenseTitle" class="modal-title">{{_ "sidebar-nav.poolLicense"}} {{_ "set-list.topic"}}
: {{getTopic}}
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</h4>
</div>
<div class="modal-body">
<div class="form-horizontal">
<div class="form-group">
<div id=cc-description class="col-md-12">
{{#if getLicenseCount}}
{{#if getLicenseType 'by'}}
<img class="col-md-2" src="/img/by.large.png" alt="Namensnennung"/>
<p class="col-md-10">{{_ "modal-dialog.by-desc"}}</p>
{{/if}}
{{#if getLicenseType 'nc'}}
<img class="col-md-2" src="/img/nc-eu.large.png" alt="Nicht kommerziell"/>
<p class="col-md-10">{{_ "modal-dialog.nc-desc"}}</p>
{{/if}}
{{#if getLicenseType 'nd'}}
<img class="col-md-2" src="/img/nd.large.png" alt="Keine Bearbeitung"/>
<p class="col-md-10">{{_ "modal-dialog.nd-desc"}}</p>
{{/if}}
{{#if getLicenseType 'sa'}}
<img class="col-md-2" src="/img/sa.large.png"
alt="Weitergabe unter gleichen Bedingungen"/>
<p class="col-md-10">{{_ "modal-dialog.sa-desc"}}</p>
{{/if}}
{{else}}
<img class="col-md-2" src="/img/zero.large.png" alt="Keine Lizenz"/>
<p class="col-md-10">{{_ "modal-dialog.zero-desc"}}</p>
{{/if}}
</div>
</div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</template>
......@@ -964,3 +964,7 @@ th {
border: 0;
box-shadow: $default_box_shadow !important;
}
#showLicenseModal {
z-index: 1060;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment