Add license cc attribution non commercial 4.0 international #101
3 changed files with 5 additions and 4 deletions
|
@ -1,9 +1,9 @@
|
||||||
const logger = require('winston');
|
const logger = require('winston');
|
||||||
|
const licenses = ['Creative Commons', 'Public Domain', 'CC Attribution-NonCommercial 4.0 International'];
|
||||||
module.exports = ({ value }) => {
|
module.exports = ({ value }) => {
|
||||||
logger.debug('checking isFreePublicClaim ?');
|
logger.debug('checking isFreePublicClaim ?');
|
||||||
if (
|
if (
|
||||||
(value.stream.metadata.license.indexOf('Public Domain') !== -1 || value.stream.metadata.license.indexOf('Creative Commons') !== -1) &&
|
(Array.asList(licenses).contains(value.stream.metadata.license)) &&
|
||||||
(!value.stream.metadata.fee || value.stream.metadata.fee.amount === 0)
|
(!value.stream.metadata.fee || value.stream.metadata.fee.amount === 0)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -30,8 +30,8 @@ module.exports = {
|
||||||
throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and "-"');
|
throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and "-"');
|
||||||
}
|
}
|
||||||
// validate license
|
// validate license
|
||||||
if ((license.indexOf('Public Domain') === -1) && (license.indexOf('Creative Commons') === -1)) {
|
if ((license.indexOf('Public Domain') === -1) && (license.indexOf('Creative Commons') === -1) && (license.indecOf('CC Attribution-NonCommercial 4.0 International') === -1)) {
|
||||||
throw new Error('Only posts with a license of "Public Domain" or "Creative Commons" are eligible for publishing through spee.ch');
|
throw new Error('Only posts with a "Public Domain" license, or one of the Creative Commons licenses are eligible for publishing through spee.ch');
|
||||||
}
|
}
|
||||||
switch (nsfw) {
|
switch (nsfw) {
|
||||||
case true:
|
case true:
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<p class="stop-float">
|
<p class="stop-float">
|
||||||
<label for="publish-license">License:</label>
|
<label for="publish-license">License:</label>
|
||||||
<select type="text" id="publish-license" name="license" value="license">
|
<select type="text" id="publish-license" name="license" value="license">
|
||||||
|
<option value="CC Attribution-NonCommercial 4.0 International"><a href="http://creativecommons.org/licenses/by-nc/4.0/">CC Attribution-NonCommercial 4.0 International</a></option>
|
||||||
<option value="Public Domain">Public Domain</option>
|
<option value="Public Domain">Public Domain</option>
|
||||||
<option value="Creative Commons">Creative Commons</option>
|
<option value="Creative Commons">Creative Commons</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in a new issue