Commit cbf95ad9 authored by Bitcoin Please's avatar Bitcoin Please

Updated static content to live.

parent 92757405
......@@ -486,4 +486,25 @@ button {
.markdown a, .campaigns a {
display: inline-block;
}
#story table th, #story table td, #guide table th, #guide table td {
border: 1pt solid #c8c8c8;
padding: 5px;
}
#story h1, #story h2, #guide h1, #guide h2 {
margin-top: 30px;
margin-bottom: 10px;
padding-bottom: 5px;
border-bottom: 1pt solid #c8c8c8;
}
#story h1, #guide h1 {
font-size: 2.5em;
}
#story h2, #guide h2 {
font-size: 1.5em;
}
#story h3, #guide h3 {
margin-bottom: 10px;
}
</style>
......@@ -87,8 +87,8 @@
</div>
<div class="col">
<span>{{lastUpdate}}</span>
{{lastUpdateSuffix}}
<span>{{remaining.time}}</span>
{{remaining.suffix}}
</div>
</div>
......@@ -111,8 +111,8 @@
</div>
<div class="col">
<span>{{lastUpdate}}</span>
{{lastUpdateSuffix}}
<span>{{remaining.time}}</span>
{{remaining.suffix}}
</div>
</div>
......@@ -133,8 +133,8 @@
</div>
<div class="col">
<span>{{lastUpdate}}</span>
{{lastUpdateSuffix}}
<span>{{remaining.time}}</span>
{{remaining.suffix}}
</div>
</div>
......@@ -175,6 +175,7 @@ import { mapActions, mapGetters } from 'vuex'
/* Import modules. */
import Nito from 'nitojs'
import moment from 'moment'
import numeral from 'numeral'
/* Import components. */
......@@ -535,37 +536,107 @@ export default {
* Funding Pledged
*/
fundingPledged() {
if (this.campaign && this.campaign.assurances) {
const assuranceid = 0
if (this.campaign && (this.campaign.assurances || this.campaign.payouts)) {
if (this.campaign.assurances) {
const assuranceid = 0
/* Set recipients. */
const recipient = this.campaign.assurances[assuranceid].recipient
/* Set pledges. */
const pledges = this.campaign.assurances[assuranceid].pledges
/* Validate recipients. */
if (!recipient) {
return '$0.00'
}
/* Validate recipients. */
if (!pledges) {
return '$0.00'
}
// FOR DEV ONLY
const calc = (recipient.satoshis / 100000000 * this.usd) / 2.5
/* Initialize total. */
let pledgeTotal = 0
return numeral(calc).format('$0,0[.]00')
/* Loop through ALL pledges. */
Object.keys(pledges).forEach(pledgeid => {
/* Add satoshis to total. */
pledgeTotal += pledges[pledgeid].satoshis
})
/* Calculate USD total. */
const totalUSD = (pledgeTotal / 100000000 * this.usd)
/* Return formatted value. */
return numeral(totalUSD).format('$0,0.00')
}
if (this.campaign.payouts) {
return '$0.00-TODO'
}
}
return 'n/a'
},
numSupporters() {
return 50
},
if (this.campaign && (this.campaign.assurances || this.campaign.payouts)) {
if (this.campaign.assurances) {
const assuranceid = 0
lastUpdate() {
return 12
/* Set pledges. */
const pledges = this.campaign.assurances[assuranceid].pledges
/* Validate recipients. */
if (!pledges) {
return 0
}
/* Return count. */
return Object.keys(pledges).length
}
if (this.campaign.payouts) {
return '0-TODO'
}
}
return 'n/a'
},
lastUpdateSuffix() {
return 'days ago'
}
remaining() {
if (this.campaign && (this.campaign.assurances || this.campaign.payouts)) {
if (this.campaign.assurances) {
const assuranceid = 0
/* Set remaining time. */
const expiresAt = this.campaign.assurances[assuranceid].expiresAt
console.log('expiresAt', expiresAt, moment().unix());
/* Set (remaining) time. */
let time = expiresAt - moment().unix()
/* Initialize suffix. */
let suffix = null
/* Calculate minimum value. */
if (time > 86400) {
time = parseInt(time / 60 / 60 / 24)
suffix = 'days to go'
} else if (time > 3600) {
time = parseInt(time / 60 / 60)
suffix = 'hours to go'
} else if (time > 60) {
time = parseInt(time / 60)
suffix = 'mins to go'
} else {
suffix = 'ending now'
}
/* Return time time w/ suffix. */
return { time, suffix }
}
if (this.campaign.payouts) {
return { time: 0, suffix: 'TODO' }
}
}
return { time: 'n/a', suffix: '' }
},
},
methods: {
......
......@@ -288,6 +288,7 @@ export default {
]),
...mapActions('utils', [
'setClipboard',
'toast',
]),
......
......@@ -127,15 +127,8 @@ export default {
/* Set guide. */
const guide = this.quillGuide.getText()
/* Set images. */
// const images = {
// main: this.photo1Url || null,
// cover: this.photo1Url || null,
// gallery: [
// this.photo2Url || null,
// this.photo3Url || null,
// ]
// }
/* Set description. */
const tags = this.tags
/* Build campaign. */
const campaign = {
......@@ -143,7 +136,7 @@ export default {
summary,
description,
guide,
// images,
tags,
}
// console.log('WRITE (campaign):', campaign)
......@@ -213,16 +206,12 @@ export default {
this.quillGuide.insertText(0, this.campaign.guide)
}
/* Validate media. */
// if (this.campaign && this.campaign.media) {
// this.photo1Url = this.campaign.media.main
//
// /* Validate gallery. */
// if (this.campaign.media.gallery) {
// this.photo2Url = this.campaign.media.gallery[0]
// this.photo3Url = this.campaign.media.gallery[1]
// }
// }
/* Validate tags. */
if (this.campaign && this.campaign.tags) {
/* Set tags. */
this.tags = this.campaign.tags
}
}
},
mounted: function () {
......@@ -277,27 +266,6 @@ export default {
#desc-editor .ql-editor, #guide-editor .ql-editor {
height: 300px;
}
#story table th, #story table td {
border: 1pt solid #c8c8c8;
padding: 5px;
}
#story h1, #story h2 {
margin-top: 30px;
margin-bottom: 10px;
padding-bottom: 5px;
border-bottom: 1pt solid #c8c8c8;
}
#story h1 {
font-size: 2.5em;
}
#story h2 {
font-size: 1.5em;
}
#story h3 {
margin-bottom: 10px;
}
</style>
<style scoped>
......
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