reviews.bitcoinabc.org/p/baby636/

1 15
Avatar for causes.cash
2 years ago

reviews.bitcoinabc.org/p/baby636/

https://Flipstarter.gitlap.BCHDEVCON3.HUSHYOURMONEY.cash

https://gitlab.com/flipstarter/flipstarter-electron-cash

<Vorlage>

<main>

<div v-if="budget">

<h1>Mittelverwendung</h1>

<p>

Jede Kampagne hat ein festes Budget, das strikte WIRD.

</p>

<Tabelle>

<tbody>

<tr>

<th>Etikett</th>

<th>Zuweisung</th>

<th>Kommentare</th>

</tr>

<tr v-for="posten des budgets" :key="item.txid">

<td>{{item.label}}</td>

<td>{{item.amount}}</td>

<td>{{item.comments}}</td>

</tr>

<!-- <tr>

<td>Andrew</td>

<td>80 $</td>

<td>15. Juni 2017</td>

</tr> -->

</tbody>

</table>

<Std. />

<h1>Kampagnenausgaben</h1>

<p>

Jede Kampagne hat feste Ausgaben, die öffentlich gemeldet werden.

</p>

<Tabelle>

<tbody>

<tr>

<th>Etikett</th>

<th>Betrag</th>

<th>Kommentare</th>

</tr>

<tr v-for="Ausgabenposten" :key="item.txid">

<td>{{item.label}}</td>

<td>{{item.amount}}</td>

<td>{{item.comments}}</td>

</tr>

<!-- <tr>

<td>Andrew</td>

<td>80 $</td>

<td>15. Juni 2017</td>

</tr> -->

</tbody>

</table>

</div>

<div v-else class="campaigns">

<h1>Mittelverwendung</h1>

<p class="m-3">

Es ist kein Budget verfügbar

</p>

</div>

</main>

</template>

<Skript>

Exportstandard {

Voraussetzung: {

Kampagne: Objekt,

},

Daten: () => {

Rückkehr {

Budget: null,

Ausgaben: null,

}

},

erstellt: Funktion () {

/* Beispielbudget. */

// konstantes Budget = {

// txid: 'irgendeine-zufällige-transaktions-id',

// Label: 'Entwicklung',

// Betrag: '100%',

// Kommentare: 'Noch zu bestimmen',

//}

// this.budget.push(budget)

/* Beispielausgaben. */

diese.Ausgaben = [{

txid: 'irgendeine-zufällige-Transaktions-ID',

Etikett: 'Essen',

Betrag: '10 $',

Bemerkungen: 'zu bestimmen',

}]

// this.expenses.push(Kosten)

},

}

</script>

<stilbezogen>

#Buchhaltungstabelle {

Breite: 100 %;

}

#Abrechnungstabelle tr th, #Abrechnungstabelle tr td {

Rahmen: 1px solid #ededed;

Polsterung: 15px;

}

</style>

<Vorlage>

<main role="tabpanel" class="tab-pane active" id="dashboard">

<div class="row">

<div class="col-3">

<!-- Abstandshalter -->

</div>

<div class="col-7">

<div v-if="title">

<h1>{{title}}-Dashboard</h1>

<h3 class="text-secondary">{{category}}</h3>

<Std. />

</div>

<div class="row mt-3">

<div class="col">

<p class="under-construction mt-3">

Hoppla! An diesem Bereich arbeiten wir noch.

</p>

<p class="under-construction mt-3">

Möchten Sie uns helfen, diese Plattform so wie schnell möglich bereit zu machen?

</p>

<p class="under-construction my-3">

Erfahren Sie, wie Ihr ❤️ und unterstützt Causes Cash.

</p>

<button class="btn btn-block btn-outline-success" @click="supportCauses">

Unterstützung verursacht Geld

</button>

</div>

<div class="col">

<!-- Dieser Bereich befindet sich noch in der Entwicklung. -->

<!-- <img class="under-construction" src=" https://i.imgur.com/8nvqTcU.png " /> -->

<img class="under-construction abgerundet" src=" https://i.imgur.com/1yAHZ69.png " />

</div>

</div>

<!-- <div class="row">

<div class="col-6">

<v-karte

class="mx-auto"

max-width="344"

>

<v-list-item dreizeilig>

<v-list-item-content>

<div class="overline mb-4">Nachrichten</div>

<v-list-item-title class="headline mb-1">Wöchentlicher Verdienstbericht 5</v-list-item-title>

<v-list-item-subtitle>Greyhound divisely hallo kalt fonwderfully</v-list-item-subtitle>

</v-list-item-content>

<v-list-item-avatar

Fliese

Größe="80"

Farbe="grau"

></v-list-item-avatar>

</v-list-item>

<v-card-aktionen>

<v-btn text>Schaltfläche</v-btn>

<v-btn text>Schaltfläche</v-btn>

</v-card-actions>

</v-karte>

</div>

<div class="col-6">

<v-karte

class="mx-auto"

max-width="344"

>

<v-list-item dreizeilig>

<v-list-item-content>

<div class="overline mb-4">Wöchentlicher Verdienstbericht</div>

<v-list-item-title class="headline mb-1">Überschrift 5</v-list-item-title>

<v-list-item-subtitle>Greyhound divisely hallo kalt fonwderfully</v-list-item-subtitle>

</v-list-item-content>

<v-list-item-avatar

Fliese

Größe="80"

Farbe="grau"

></v-list-item-avatar>

</v-list-item>

<v-card-aktionen>

<v-btn text>Schaltfläche</v-btn>

<v-btn text>Schaltfläche</v-btn>

</v-card-actions>

</v-karte>

</div>

</div> -->

<!-- <hr /> -->

<!-- <v-timeline>

<v-timeline-item color="red lighten-2" large>

<v-card class="elevation-2">

<v-card-title class="headline">Lorem ipsum</v-card-title>

<v-card-text>

Lorem ipsum dolor sit amet, kein nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.

</v-card-text>

</v-karte>

</v-timeline-item>

<v-timeline-item color="teal lighten-3" small>

<v-card class="elevation-2">

<v-card-title class="headline">Lorem ipsum</v-card-title>

<v-card-text>

Lorem ipsum dolor sit amet, kein nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.

</v-card-text>

</v-karte>

</v-timeline-item>

<v-timeline-element

klein

Füllpunkt

>

<Vorlage v-slot:icon>

<v-avatar>

<img src=" http://i.pravatar.cc/64 ">

</v-avatar>

</template>

<Vorlage v-slot:gegenüber>

<span>Neuer Mitwirkender</span>

</template>

<V-Alarm

Wert = "wahr"

color="blau"

Symbol=""

class="weiß--text"

>

Lorem ipsum dolor sit amet, kein nam oblique veritus. Commune scaevola imperdiet nec ut, sed euismod convenire principes at. Est et nobis iisque percipit, an vim zril disputando voluptatibus, vix an salutandi sententiae.

</v-alert>

</v-timeline-item>

</v-timeline> -->

</div>

</div>

</main>

</template>

<script>

/* Initialize vuex. */

import { mapActions, mapGetters } from 'vuex'

export default {

components: {

//

},

data: () => {

return {

ownerSlug: null,

slug: null,

extSlug: null,

campaign: null,

campaignId: null,

// fundId: null,

// referrerId: null,

}

},

computed: {

...mapGetters([

'getHelp',

]),

...mapGetters('campaigns', [

'getCampaign',

]),

...mapGetters('utils', [

'getCategoryDisplay',

]),

title() {

if (this.campaign && this.campaign.title) {

return this.campaign.title

} else {

return null

}

},

category() {

if (this.campaign && this.campaign.title) {

return this.getCategoryDisplay(this.campaign.category)

} else {

return null

}

},

location() {

if (this.campaign && this.campaign.location) {

return this.campaign.location

} else {

return null

}

},

},

methods: {

...mapActions('utils', [

'toast',

]),

supportCauses() {

this.$router.push('/@BCHPlease/causes-cash-8ab5c2fc')

},

},

created: async function () {

console.log('PARAMS', this.$route.params)

console.log('QUERY', this.$route.query)

console.log('HASH', this.$route.hash)

/* Set owner slug. */

this.ownerSlug = this.$route.params.pathMatch.toLowerCase()

console.log('OWNER SLUG', this.ownerSlug)

/* Set extended slug. */

this.slug = this.$route.params.slug

console.log('SLUG', this.slug)

/* Validate hash. */

// if (this.$route.hash) {

// /* Set extended slug. */

// this.fundId = this.$route.hash.slice(1)

// console.log('FUND ID (from hash)', this.fundId)

// }

/* Validate query. */

// if (this.$route.query && Object.keys(this.$route.query)[0]) {

// /* Set extended slug. */

// this.fundId = Object.keys(this.$route.query)[0]

// console.log('FUND ID (from query)', this.fundId)

// }

/* Validate slug. */

if (this.ownerSlug && this.slug) {

/* Set campaign. */

this.campaign = await this.getCampaign(this.ownerSlug, this.slug)

console.log('CAMPAIGN', this.campaign)

}

},

mounted: function () {

//

},

}

</script>

<style scoped>

p.under-construction {

font-size: 1.4em;

}

</style>

<template>

<main>

<h1>Featured Supporters</h1>

<table class="mt-3" v-if="funders">

<tbody>

<tr>

<th>Nickname / Alias</th>

<th class="text-center">Comment</th>

<th class="text-center">Amount (USD)</th>

<th class="text-right">Time</th>

</tr>

<tr v-for="funder of funders" :key="funder.publicKeyHash + ':' + funder.monthlyPledgeAmt">

<td>{{funder.alias}}</td>

<td class="text-center">{{funder.comment}}</td>

<td class="text-center">

{{formatUSD(funder.monthlyPledgeAmt)}}

<small>[ <span class="text-danger">{{funder.payouts ? funder.payouts.length : '0'}}x</span> ]</small>

</td>

<td class="text-right">{{formatDate(funder.createdAt)}}</td>

</tr>

</tbody>

</table>

<table class="mt-3" v-if="pledges">

<tbody>

<tr>

<th>Nickname / Alias</th>

<th class="text-center">Comment</th>

<th class="text-center">Amount (USD)</th>

<th class="text-right">Time</th>

</tr>

<tr v-for="pledge of pledges" :key="pledge.previousTransactionHash + ':' + pledge.previousOutputIndex">

<td>{{pledge.alias}}</td>

<td class="text-center">{{pledge.comment}}</td>

<td class="text-center">{{formatSatoshis(pledge.satoshis)}}</td>

<td class="text-right">{{formatDate(pledge.createdAt)}}</td>

</tr>

</tbody>

</table>

</main>

</template>

<script>

/* Import modules. */

import moment from 'moment'

import Nito from 'nitojs'

import numeral from 'numeral'

export default {

props: {

campaign: Object,

},

data: () => {

return {

usd: null,

funders: null,

pledges: null,

}

},

watch: {

campaign: function (_campaign) {

/* Handle campaign supporters. */

if (_campaign && (_campaign.assurances || _campaign.payouts)) {

console.log('CAMPAIGN HAS CHANGED, UPDATE SUPPORTERS!!', _campaign)

/* Validate assurances. */

if (_campaign.assurances) {

/* Set assurance id. */

const assuranceid = 0 // FIXME: Hard-coded to a single assurance campaign

/* Set pledges. */

const pledges = _campaign.assurances[assuranceid].pledges

/* Validate pledges. */

if (!pledges) {

return

}

/* Initialize pledges. */

this.pledges = []

/* Handle all pledges. */

Object.keys(pledges).filter(pledgeid => {

if (pledges[pledgeid].isFilled === true || pledges[pledgeid].isSpent === false) {

this.pledges.push(pledges[pledgeid])

}

})

/* Sort pledges (decending). */

this.pledges.sort((a, b) => {

return b.satoshis - a.satoshis

})

}

/* Validate payouts. */

if (_campaign.payouts && _campaign.payouts.funders) {

/* Set funders. */

const funders = _campaign.payouts.funders

/* Validate funders. */

if (!funders) {

return

}

/* Initialize funders. */

this.funders = []

/* Handle all funders. */

Object.keys(funders).filter(funderid => {

if (funders[funderid].nextPayoutAt) {

this.funders.push(funders[funderid])

}

})

/* Sort funders (decending). */

this.funders.sort((a, b) => {

return b.monthlyPledgeAmt - a.monthlyPledgeAmt

})

}

}

},

},

methods: {

formatSatoshis(_amount) {

const value = (_amount / 100000000) * this.usd

if (value) {

return numeral(value).format('$0,0[.]00')

} else {

return '$0.00'

}

},

formatUSD(_amount) {

const value = (_amount / 100)

if (value) {

return numeral(value).format('$0,0.00')

} else {

return '$0.00'

}

},

formatDate(_date) {

if (_date) {

return moment.unix(_date).fromNow()

} else {

return 'n/a'

}

},

},

created: async function () {

this.usd = await Nito.Markets.getTicker('BCH', 'USD')

// console.info(Market price (USD), this.usd)

/* Validate assurances. */

if (this.campaign && this.campaign.assurances) {

/* Set assurance id. */

const assuranceid = 0 // FIXME: Hard-coded to a single assurance campaign

/* Set pledges. */

const pledges = this.campaign.assurances[assuranceid].pledges

/* Validate pledges. */

if (!pledges) {

return

}

/* Initialize pledges. */

this.pledges = []

/* Handle all pledges. */

Object.keys(pledges).filter(pledgeid => {

if (pledges[pledgeid].isFilled === true || pledges[pledgeid].isSpent === false) {

this.pledges.push(pledges[pledgeid])

}

})

/* Sort pledges (decending). */

this.pledges.sort((a, b) => {

return b.satoshis - a.satoshis

})

}

/* Validate payouts. */

if (this.campaign && this.campaign.payouts && this.campaign.payouts.funders) {

/* Set funders. */

const funders = this.campaign.payouts.funders

/* Validate funders. */

if (!funders) {

return

}

/* Initialize funders. */

this.funders = []

/* Handle all funders. */

Object.keys(funders).filter(funderid => {

if (funders[funderid].nextPayoutAt) {

this.funders.push(funders[funderid])

}

})

/* Sort funders (decending). */

this.funders.sort((a, b) => {

return b.monthlyPledgeAmt - a.monthlyPledgeAmt

})

}

},

}

</script>

<style scoped>

main table {

width: 100%;

}

main table tr th, main table tr td {

border: 1px solid #ededed;

padding: 15px;

}

</style>

<template>

<div class="container campaign-content">

<div v-if="campaign && !campaign.isPublished" class="campaign-not-found clearfix">

<h1>CAMPAIGN NOT FOUND</h1>

<p class="p-3 mt-3">

<!-- We are sorry, but the campaign link you entered cannot be found. -->

Sorry we can't find that campaign.

Please check the link URL and try again.

</p>

<div class="col-12 col-md-7 form-group p-3">

<input

type="text"

class="form-control"

placeholder="Search by name, title, or town/city"

>

</div>

</div>

<div v-if="campaign && campaign.isPublished" class="campaign-item clearfix">

<div v-if="images" class="campaign-image">

<div id="campaign-gallery" class="campaign-slider">

<div class="item">

<img :src="images[0]" alt="">

</div>

<div class="item">

<img :src="images[1]" alt="">

</div>

<div class="item">

<img :src="images[2]" alt="">

</div>

</div>

</div>

<div class="campaign-box">

<div class="share">

<ul>

<li class="share-twitter">

<a href="javascript://"><i class="fa fa-twitter" aria-hidden="true"></i></a>

</li>

<li class="share-google-plus">

<a href="javascript://"><i class="fa fa-reddit" aria-hidden="true"></i></a>

</li>

<!-- <li class="share-facebook">

<a href="javascript://"><i class="fa fa-facebook" aria-hidden="true"></i></a>

</li> -->

<!-- <li class="share-linkedin">

<a href="javascript://"><i class="fa fa-linkedin" aria-hidden="true"></i></a>

</li> -->

<li class="share-code">

<a href="javascript://"><i class="fa fa-code" aria-hidden="true"></i></a>

</li>

</ul>

</div>

<a href="javascript://" class="category">{{category}}</a>

<h3>{{title}}</h3>

<div class="campaign-description clearfix">

<!-- <p v-html="summary" /> -->

<p>

{{summary}}

</p>

</div>

<div class="campaign-author">

<div class="author-profile">

<a class="author-icon" href="javascript://">

<img :src="ownerAvatar" alt=""></a>

by <a class="author-name" href="javascript://">{{ownerName}}</a>

</div>

<div class="author-address">

<i v-if="campaignModel == 'Cash Payouts'" class="fa fa-money mr-1" aria-hidden="true"></i>

<i v-if="campaignModel == 'Community Pledge'" class="fa fa-users mr-1" aria-hidden="true"></i>

<i v-if="campaignModel == 'Direct Donation'" class="fa fa-btc mr-1" aria-hidden="true"></i>

<i v-if="campaignModel == 'Unknown campaign type'" class="fa fa-question mr-1" aria-hidden="true"></i>

{{campaignModel}}

</div>

</div>

<div class="process">

<div class="raised">

<span v-if="campaignModel == 'Community Pledge'"></span>

</div>

<div v-if="recipient" class="recipient-address">

<a :href="'https://explorer.bitcoin.com/bch/address/' + recipient" target="_blank">

<i class="fa fa-check-circle text-success ml-2 mr-1"></i>

<span class="text-secondary">{{recipient}}</span>

</a>

(<a href="javascript://">view proof</a>)

</div>

<div v-if="campaignModel == 'Community Pledge'" class="row process-info">

<div class="col">

<span>{{fundingGoal}}</span>

funding goal

</div>

<div class="col">

<span>{{fundingPledged}}</span>

pledged

</div>

<div class="col">

<span>{{numSupporters}}</span>

supporters

</div>

<div class="col">

<span>{{verbleibende Zeit}}</span>

{{rest.suffix}}

</div>

</div>

<div v-if="campaignModel == 'Barauszahlungen'" class="row process-info">

<div class="col">

<span>{{fundingPledged}}</span>

<i class="fa fa-bitcoin" aria-hidden="true"></i>

IN <small>(letzte 30 Tage)</small>

</div>

<div class="col">

<span>$0.00</span>

<i class="fa fa-bitcoin" aria-hidden="true"></i>

OUT <small>(last 30 days)</small>

</div>

<div class="col">

<span>{{numSupporters}}</span>

supporters

</div>

<!-- <div class="col">

<span>{{remaining.time}}</span>

{{remaining.suffix}}

</div> -->

</div>

<div v-if="campaignModel == 'Direct Donation'" class="row process-info">

<div class="col">

<span>{{fundingGoal}}</span>

last 24hrs

</div>

<div class="col">

<span>{{fundingPledged}}</span>

last 30 days

</div>

<div class="col">

<span>{{numSupporters}}</span>

supporters

</div>

<!-- <div class="col">

<span>{{remaining.time}}</span>

{{remaining.suffix}}

</div> -->

</div>

</div>

<div v-if="showActions" class="button">

<a href="javascript://" class="btn-primary" @click="addMySupport">

<i class="fa fa-heart mr-2" aria-hidden="true"></i>

Add my support

</a>

<a href="javascript://" class="btn-warning mr-5" @click="stakePIF">

<i class="fa fa-flag mr-2" aria-hidden="true"></i>

Stake PIF

</a>

<a href="javascript://" class="btn-secondary" @click="remindMe">

<i class="fa fa-clock-o" aria-hidden="true"></i>

Remind me

</a>

</div>

</div>

</div>

<div v-if="campaign && campaign.isPublished" class="campaign-item clearfix">

<Reminder v-if="showReminder" :campaign="campaign" @cancel="showReminder = false; showActions = true" />

<Direct v-if="showDirect" :campaign="campaign" @cancel="showDirect = false; showActions = true" />

<Assurance v-if="showAssurance" :campaign="campaign" @cancel="showAssurance = false; showActions = true" />

<Payouts v-if="showPayouts" :campaign="campaign" @cancel="showPayouts = false; showActions = true" />

</div>

</div>

</template>

<script>

/* Initialize vuex. */

import { mapActions, mapGetters } from 'vuex'

/* Import modules. */

import Nito from 'nitojs'

import moment from 'moment'

import numeral from 'numeral'

/* Import components. */

import Assurance from './Content/Assurance'

import Direct from './Content/Direct'

import Payouts from './Content/Payouts'

import Reminder from './Content/Reminder'

/* Import jQuery. */

// FIXME: Remove ALL jQuery dependencies.

const $ = window.jQuery

/**

* Make Pages

*

* Creates thumbnail images under the main photo.

*/

function makePages() {

$.each(this.owl.userItems, function (i) {

$('.owl-controls .owl-page').eq(i)

.css({

'background': 'url(' + $(this).find('img').attr('src') + ')',

'background-size': 'cover',

// 'padding': '5px',

'margin': '4px',

'width': '180px',

'border': '1pt solid rgba(90, 90, 90, 0.2)',

'-moz-border-radius': '10px',

'-webkit-border-radius': '10px',

})

})

}

export default {

props: {

campaign: Object,

isLoading: Boolean,

},

components: {

Assurance,

Direct,

Payouts,

Reminder,

},

data: () => {

return {

usd: null,

pledgeAmount: null,

name: null,

comment: null,

showActions: null,

showReminder: null,

showDirect: null,

showAssurance: null,

showPayouts: null,

}

},

watch: {

campaign: function (_campaign) {

if (_campaign && _campaign.media && _campaign.isPublished) {

/* Wait a tick. */

setTimeout(() => {

$("#campaign-gallery").owlCarousel({

// navigation: true,

navigationText: [

'<span class="ion-ios-arrow-back"></span>',

'<span class="ion-ios-arrow-forward"></span>'

],

loop: true,

autoplay: true,

autoplayTimeout: 3000,

autoplayHoverPause: true,

singleItem: true,

afterInit: makePages,

afterUpdate: makePages

})

}, 0)

}

},

},

computed: {

...mapGetters('campaigns', [

'getAsset',

]),

...mapGetters('profile', [

'getNickname',

]),

...mapGetters('utils', [

'getCategoryDisplay',

'getMarkdown',

]),

/**

* Has Authorization

*/

hasAuth() {

// TODO: Improve authorization scheme.

if (this.getNickname) {

return true

} else {

return false

}

},

/**

* Category

*/

category() {

if (this.campaign && this.campaign.category) {

return this.getCategoryDisplay(this.campaign.category)

} else {

return null

}

},

/**

* Campaign Model

*/

campaignModel() {

/* Validate campaign theme. */

if (!this.campaign || !this.campaign.theme) {

return null

}

/* Set theme. */

const theme = this.campaign.theme

/* Validate theme. */

if (theme) {

/* Handle campaign type. */

switch(theme) {

case 'direct':

return 'Direct Cash'

case 'assurance':

return 'Community Pledge'

case 'payouts':

return 'Cash Payouts'

default:

return 'Unknown campaign type'

}

} else {

return null

}

},

/**

* Title

*/

title() {

/* Validate campaign funds. */

if (!this.campaign || !this.campaign.title) {

return null

}

/* Return campaign title. */

return this.campaign.title

},

/**

* Summary

*/

summary() {

/* Validate campaign. */

if (!this.campaign) {

return null

}

/* Initialize summary. */

let summary = null

/* Retrieve summary. */

summary = this.getAsset(

this.campaign.owner.slug,

${this.campaign.slug}.summary

)

// console.log('STORY (summary):', summary)

/* Validate summary. */

if (summary) {

/* Return summary (in markdown). */

// return this.getMarkdown(summary)

return summary

} else {

return null

}

},

recipient() {

if (this.campaign && (this.campaign.assurances || this.campaign.payouts)) {

if (this.campaign.assurances) {

const assuranceid = 0

/* Set recipient. */

const recipient = this.campaign.assurances[assuranceid].recipient

/* Validate recipient. */

if (!recipient) {

return ''

}

/* Return recipient address. */

return recipient.address

}

if (this.campaign.payouts) {

/* Set recipient. */

const recipient = this.campaign.payouts.recipient

/* Validate recipient. */

if (!recipient) {

return ''

}

/* Return recipient address. */

return recipient.address

}

}

return ''

},

/**

* Pledge Address

*

* For direct donations from funders.

*/

pledgeAddress() {

/* Validate campaign funds. */

if (!this.campaign || !this.campaign.funds) {

return null

}

/* Return pledge address. */

if (this.fundId) {

return this.campaign.funds[this.fundId].address

} else {

const defaultId = Object.keys(this.campaign.funds).find(fundId => {

return this.campaign.funds[fundId].isDefault === true

})

/* Return default fund address. */

return this.campaign.funds[defaultId].address

}

},

/**

* Owner Name

*/

ownerName() {

if (this.campaign && (this.campaign.owner.label || this.campaign.owner.nickname)) {

return this.campaign.owner.label || this.campaign.owner.nickname

} else {

return null

}

},

/**

* Owner Avatar

*/

EigentümerAvatar() {

if (this.campaign && this.campaign.owner.avatar) {

diese.campaign.owner.avatar zurückgeben

} anders {

null zurückgeben

}

},

/**

* Bilder

*/

Bilder () {

/* Kampagne validieren. */

if (!diese.Kampagne) {

null zurückgeben

}

/* Bilder initialisieren. */

const-Bilder = []

/* Hauptbild validieren. */

if (this.campaign.media && this.campaign.media.main) {

images.push(this.campaign.media.main)

}

// /* Galeriebilder validieren. */

if (this.campaign.media && this.campaign.media.gallery) {

lass max = 2

for (lassen Sie i = 0; i < this.campaign.media.gallery.length; i++) {

images.push(this.campaign.media.gallery[i])

// FIXME: Increase the maximum gallery size.

if (i + 1 === max) break

}

}

/* Return images. */

return images

},

/**

* Details

*/

details() {

if (!this.campaign || !this.campaign.theme) {

return null

}

/* Set theme. */

const theme = this.campaign.theme

if (theme === 'assurance') {

return JSON.stringify(this.campaign.assurances, null, 2)

}

return null

},

/**

* Satoshis

*/

satoshis() {

if (!this.campaign || !this.campaign.theme) {

return 0

}

/* Set theme. */

const theme = this.campaign.theme

const assuranceid = 0

if (theme === 'assurance') {

return this.campaign.assurances[assuranceid].recipient.satoshis

}

return 0

},

/**

* Address

*/

address() {

if (!this.campaign || !this.campaign.theme) {

return 0

}

/* Set theme. */

const theme = this.campaign.theme

const assuranceid = 0

if (theme === 'assurance') {

return this.campaign.assurances[assuranceid].recipient.address

}

return 0

},

/**

* Pledge

*

* Used by community pledges.

*/

pledge() {

const json = {

outputs: [{

value: this.satoshis,

address: this.address

}],

data: {

alias: this.name,

comment: this.comment

},

donation: {

amount: this.pledgeAmount

},

expires: 1596168000

}

return Buffer.from(JSON.stringify(json)).toString('base64')

},

/**

* Funding Goal

*/

fundingGoal() {

if (this.campaign && this.campaign.assurances) {

const assuranceid = 0

/* Set recipients. */

const recipient = this.campaign.assurances[assuranceid].recipient

/* Validate recipients. */

if (!recipient) {

return '$0.00'

}

const calc = (recipient.satoshis / 100000000 * this.usd)

return numeral(calc).format('$0,0[.]00')

}

return 'n/a'

},

/**

* Funding Pledged

*/

fundingPledged() {

if (this.campaign && (this.campaign.assurances || this.campaign.payouts)) {

if (this.campaign.assurances) {

const assuranceid = 0

/* Set pledges. */

const pledges = this.campaign.assurances[assuranceid].pledges

/* Validate recipients. */

if (!pledges) {

return '$0.00'

}

/* Initialize total. */

let pledgeTotal = 0

/* 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) {

/* Set funders. */

const funders = this.campaign.payouts.funders

// console.log('FUNDERS', funders);

/* Validate recipients. */

if (!funders) {

return '$0.00'

}

/* Initialize total. */

let funderTotal = 0

/* Loop through ALL funders. */

Object.keys(funders).forEach(funderid => {

/* Add satoshis to total. */

funderTotal += funders[funderid].monthlyPledgeAmt

})

// console.log('FUNDER TOTAL', funderTotal);

/* Calculate USD total. */

const totalUSD = (funderTotal / 1000000 * this.usd)

// console.log('TOTAL USD', totalUSD);

/* Return formatted value. */

return numeral(totalUSD).format('$0,0.00')

}

}

return 'n/a'

},

numSupporters() {

if (this.campaign && (this.campaign.assurances || this.campaign.payouts)) {

if (this.campaign.assurances) {

const assuranceid = 0

/* 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) {

/* Set funders. */

const funders = this.campaign.payouts.funders

/* Validate recipients. */

if (!funders) {

return 0

}

/* Return count. */

// FIXME: Limit to nextPayoutAt > 0

return Object.keys(funders).length

}

}

return 'n/a'

},

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 = 'Minuten zu gehen'

} anders {

Suffix = 'jetzt enden'

}

/* Rückgabezeit mit Suffix. */

return { Zeit, Suffix }

}

if (diese.kampagne.auszahlungen) {

return { Zeit: 0, Suffix: 'TODO' }

}

}

return { Zeit: 'n/a', Suffix: '' }

},

},

Methoden: {

...mapActions('utils', [

'Toast',

]),

/**

* Erinnere mich

*/

erinnere mich() {

this.toast(['Ups!', 'Kampagnenerinnerungen kommen bald', 'error'])

// this.showActions = false

// this.showReminder = true

},

/**

* PIF einsetzen

*/

StakePIF() {

this.toast(['Ups!', 'Sie haben kein PIF zum Abstecken', 'Fehler'])

// this.showActions = false

// this.showBurn = true

},

/**

* Meine Unterstützung hinzufügen

*/

addMySupport() {

/* Bestätigen Sie die Benutzerberechtigung. */

if (!this.hasAuth) {

/* Fehlerbenachrichtigung anzeigen. */

return this.toast(['Ups!', 'Bitte melden Sie sich zuerst an, um Ihre Unterstützung hinzuzufügen', 'error'])

}

/* Aktionen ausblenden. */

this.showActions = false

/* Unterstützungsfenster behandeln. */

if (diese.kampagne.zusicherungen) {

/* Assurance-Fenster anzeigen. */

this.showAssurance = true

} sonst if (this.campaign.direct) {

/* Direktes Fenster anzeigen. */

this.showDirect = true

} else if (this.campaign.payouts) {

/* Auszahlungsfenster anzeigen. */

this.showPayouts = true

} anders {

/* Aktionen anzeigen. */

this.showActions = true

/* Fehlerbenachrichtigung anzeigen. */

return this.toast(['Ups!', 'Support for this Kampagne wurde nicht gestartet', 'error'])

}

},

},

erstellt: asynchrone Funktion () {

/* Flag initialisieren. */

this.showActions = true

/* Pfandbetrag initialisieren. */

this.pledgeAmount = 0

this.usd = warten auf Nito.Markets.getTicker('BCH', 'USD')

// console.info( Market price (USD), this.usd)

},

montiert: Funktion () {

//

}

}

</script>

<stilbezogen>

.Kampagnen-Schieberegler .item img {

-moz-border-radius: 10px;

-webkit-border-radius: 10px;

Randradius: 10px; /* Zukunftssicherung */

-khtml-Grenzradius: 10px; /* für den alten Konqueror-Browser */

Rahmen: 1pt festes rgba (90, 90, 90, 0,2);

}

.Teilen {

rechts schwebend;

Rand: 0;

Polsterung: 0;

}

.prozess-info klein {

Schriftgröße: 0.7em;

Schriftstil: kursiv;

}

.Empfängeradresse {

Schriftgröße: 0.8em;

Rand-oben: -10px;

}

.Empfängeradresse a {

Anzeige: Inline-Block;

}

</style>

Sponsors of causes.cash
empty
empty
empty

1
$ 0.00
Avatar for causes.cash
2 years ago