Skip to content

Commit

Permalink
Include donation links in the about menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bastimeyer committed Oct 15, 2016
1 parent a7a9c05 commit 9226b20
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
24 changes: 20 additions & 4 deletions src/styles/routes/About.less
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@

.content-about {
@width: 15rem;
@margin-data: ( @width + 1 );

article {
.clearfix();
}

.dl-horizontal {
@width: 15rem;
h3 > i.fa {
margin-right: .333em;
}

.dl-horizontal {
> dt {
width: @width;
}

> dd {
margin-left: ( @width + 1 );
margin-left: @margin-data;
}
}

.text-donation {
width: 24rem;
margin-left: @margin-data;
}

.coinaddress {
display: inline-block;
margin-left: 1em;
font-size: smaller;
font-style: italic;
}
}
16 changes: 14 additions & 2 deletions src/templates/About.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<main class="content content-about">
<h2>About</h2>
<article>
<h3><i class="fa fa-desktop"></i> Livestreamer Twitch GUI</h3>
<h3><i class="fa fa-desktop"></i>Livestreamer Twitch GUI</h3>
<dl class="dl-horizontal">
<dt>Homepage</dt>
<dd>{{#external-link url=metadata.package.homepage}}{{metadata.package.homepage}}{{/external-link}}</dd>
Expand All @@ -19,8 +19,20 @@
<dd>{{nwjsVersion}}</dd>
</dl>
</article>
{{#if metadata.donation.length}}
<article>
<h3><i class="fa fa-sitemap"></i> Third party applications</h3>
<h3><i class="fa fa-heart"></i>Support &amp; donate</h3>
<p class="text-donation">If you think that this application is helpful, please consider supporting the creator by donating.<br>Thank you very much!</p>
<dl class="dl-horizontal">
{{#each metadata.donation as |item|}}
<dt><i class="fa fa-angle-right"></i></dt>
<dd>{{#external-link url=item.url}}{{item.text}}{{/external-link}}{{#if item.coinaddress}}{{#selectable-text tagName="span" class="coinaddress"}}{{item.coinaddress}}{{/selectable-text}}{{/if}}</dd>
{{/each}}
</dl>
</article>
{{/if}}
<article>
<h3><i class="fa fa-sitemap"></i>Third party applications</h3>
<dl class="dl-horizontal">
{{#each dependencies as |elem|}}
<dt>{{elem.title}}</dt>
Expand Down
12 changes: 10 additions & 2 deletions src/web_loaders/metadata-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,25 @@ module.exports = function() {
});
}

function getDonationData() {
return process.env.hasOwnProperty( "RELEASES_DONATION" )
? JSON.parse( process.env.RELEASES_DONATION )
: [];
}


Promise.all([
promisePackageData(),
promiseGitContributors(),
promiseDependencies()
promiseDependencies(),
getDonationData()
])
.then(function( data ) {
callback( null, "module.exports=" + JSON.stringify({
"package" : data[0],
"contributors": data[1],
"dependencies": data[2]
"dependencies": data[2],
"donation" : data[3]
}) );
}, callback );
};

0 comments on commit 9226b20

Please sign in to comment.