Commit 90fabbf7 authored by Bitcoin Please's avatar Bitcoin Please
Browse files

Added support for campaign updates.

parent 3ae101e5
......@@ -323,30 +323,6 @@ export default {
$(this).addClass('active')
$("#"+tab_id).addClass('active')
})
var toolbarOptions = [
['bold'], // toggled buttons
[{ 'size': [false, 'large', 'huge'] }], // custom dropdown
[ 'link' ],
[ 'image' ],
[ 'video' ],
['clean'],
]
// var quill = new window.Quill('#editor', {
new window.Quill('#editor', {
modules: {
toolbar: toolbarOptions,
},
formats: [
'bold',
'size',
'link',
'image',
'video',
'clean',
],
theme: 'snow'
})
$('.create-perk').on('click', function (e) {
e.preventDefault()
$(this).parent().fadeOut(0)
......
......@@ -65,9 +65,9 @@ const routes = [{
path: '/@*/create',
component: CampaignCreate
}, {
// eg. https://causes.cash/@BCHPlease/nito-cash-8680bb0e/manage
// eg. https://causes.cash/@BCHPlease/nito-cash/manage
// NOTE: Avoid other wildcard conflicts.
path: '/@*/:extSlug/manage',
path: '/@*/:slug/manage',
component: CampaignManage
}, {
// eg. https://causes.cash/@BCHPlease/nito-cash-8680bb0e
......
......@@ -68,7 +68,7 @@ const getSignedMessage = (state, getters, rootState, rootGetters) => (_message)
signature,
nonce,
}
console.log('GET SIGNED MESSAGE (pkg):', pkg)
// console.log('GET SIGNED MESSAGE (pkg):', pkg)
/* Return signature package. */
return pkg
......
......@@ -524,7 +524,7 @@ export default {
// this.summary = null
this.location = null
alert('New Campaign Created Successfully!')
alert('New campaign created successfully!')
}
},
......
......@@ -142,9 +142,9 @@ export default {
},
created: async function () {
console.log('PARAMS', this.$route.params);
console.log('QUERY', this.$route.query);
console.log('HASH', this.$route.hash);
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()
......@@ -183,15 +183,12 @@ export default {
console.log('REFERRER ID', this.referrerId)
/* Set campaign. */
console.log('REQUESTING CAMPAIGN');
this.campaign = await this.getCampaign(this.ownerSlug, this.slug)
console.log('CAMPAIGN RESULTS', this.campaign);
console.log('CAMPAIGN', this.campaign)
/* Set referrer id (to campaign). */
this.campaign.referrerId = this.referrerId
console.log('CAMPAIGN', this.campaign)
/* Update assets. */
this.updateAssets()
}
......
......@@ -176,7 +176,7 @@ export default {
showReminder: null,
showDirect: null,
showAssurance: null,
ShowPayouts: null,
showPayouts: null,
}
},
watch: {
......
......@@ -18,6 +18,10 @@
<a href="javascript://">Budget</a>
</li>
<li data-tab="expenses">
<a href="javascript://">Expenses</a>
</li>
<li data-tab="faq">
<a href="javascript://">FAQ</a>
</li>
......@@ -32,6 +36,7 @@
<Story :campaign="campaign" />
<Backers :campaign="campaign" />
<Budget :campaign="campaign" />
<Expenses :campaign="campaign" />
<FAQ :campaign="campaign" />
<News :campaign="campaign" />
</div>
......@@ -49,6 +54,7 @@
import Backers from './History/Backers'
import Budget from './History/Budget'
import Events from './History/Events'
import Expenses from './History/Expenses'
import FAQ from './History/FAQ'
import News from './History/News'
import Story from './History/Story'
......@@ -65,6 +71,7 @@ export default {
Backers,
Budget,
Events,
Expenses,
FAQ,
News,
Story,
......
<template>
<div id="expenses" class="tabs">
<h1>Campaign Expenses</h1>
<p>
Every campaign has a fixed expenses that will be reported publicly.
</p>
<table>
<tbody>
<tr>
<th>Label</th>
<th>Amount</th>
<th>Comments</th>
</tr>
<tr v-for="item of expenses" :key="item.txid">
<td>{{item.label}}</td>
<td>{{item.expensesAmount}}</td>
<td>{{item.comments}}</td>
</tr>
<!-- <tr>
<td>Andrew</td>
<td>$80</td>
<td>June 15, 2017</td>
</tr> -->
</tbody>
</table>
</div>
</template>
<script>
export default {
props: {
campaign: Object,
},
data: () => {
return {
expenses: [],
}
},
created: function () {
/* Sample expenses. */
const expenses = {
txid: 'some-random-transaction-id',
label: 'Development',
expensesAmount: '100%',
comments: 'To be determined',
}
this.expenses.push(expenses)
},
}
</script>
<style scoped>
#expenses table {
width: 100%;
}
#expenses table tr th, #expenses table tr td {
border: 1px solid #ededed;
padding: 15px;
}
</style>
......@@ -42,7 +42,7 @@
<li data-tab="funds" class="pm-option">
<a href="javascript://">
<span><img src="@/assets/img/award.svg" alt=""></span>
<p>Funds</p>
<p>Finances</p>
</a>
</li>
......@@ -61,16 +61,16 @@
</li>
<li>
<a href="javascript://">
<a href="http://localhost:8080/#/@bchplease/mecenas-oracle-audit-66477a47" target="_blank">
<span><img src="@/assets/img/eye-17.svg" alt=""></span>
<p>Preview</p>
<p>Live View</p>
</a>
</li>
</ul>
<div class="tab-content">
<General />
<Funds />
<Finances />
<Story />
<Social />
<Messages />
......@@ -88,7 +88,7 @@
import Footer from '@/components/Footer.vue'
import Header from '@/components/Header.vue'
import Funds from './Manage/Funds.vue'
import Finances from './Manage/Finances.vue'
import General from './Manage/General.vue'
import Messages from './Manage/Messages.vue'
import Social from './Manage/Social.vue'
......@@ -99,7 +99,7 @@ export default {
Footer,
Header,
Funds,
Finances,
General,
Messages,
Social,
......@@ -107,7 +107,7 @@ export default {
},
data: () => {
return {
extSlug: null,
slug: null,
}
},
computed: {
......@@ -118,9 +118,9 @@ export default {
},
created: function () {
/* Set campaign extended slug. */
this.extSlug = this.$route.params.extSlug
console.log('EXTENDED SLUG', this.extSlug)
/* Set campaign slug. */
this.slug = this.$route.params.slug
console.log('SLUG', this.slug)
},
mounted: function () {
......
......@@ -5,7 +5,7 @@
<div class="start-form">
<div class="reward-top">
<h2 class="reward-title">
Default Fund
Finances
</h2>
<a href="javascript://" class="reward-delete">
......
......@@ -12,7 +12,7 @@
Your profile name will be searchable, too.
</span>
<input type="text" id="projecttitle" value="" maxlength="60">
<input type="text" id="projecttitle" v-model="title" maxlength="60" disabled>
</div>
<div class="field">
......@@ -65,7 +65,7 @@
Project Location
</label>
<input type="text" id="projectlocation">
<input type="text" id="projectlocation" v-model="location">
</div>
<div class="field">
......@@ -129,74 +129,6 @@
<input type="text" value="" id="fundinggoal">
</div>
<div class="field">
<label for="uploadfile">Campaign Image *</label>
<span class="label-desc">Upload a square image that represents your campaign. 570 x 350 recommended resolution.</span>
<div class="list-upload">
<div class="file-upload">
<div class="upload-bg">
<div id="myfileupload">
<input type="file" id="uploadfile" name="ImageUpload" onchange="readURL(this);" />
</div>
<div id="thumbbox">
<img src="images/assets/logo.png" height="100" width="100" alt="Thumb image" id="thumbimage" />
<a class="removeimg" href="javascript:"></a>
</div>
<div id="boxchoice">
<a href="javascript:" class="choicefile"><i class="fa fa-cloud-upload" aria-hidden="true"></i> Upload Image</a>
<p></p>
</div>
<label class="filename"></label>
</div>
</div>
<div class="file-upload">
<div class="upload-bg">
<div id="myfileupload1">
<input type="file" id="uploadfile1" name="ImageUpload" onchange="readURL1(this);" />
</div>
<div id="thumbbox1">
<img src="images/assets/logo.png" height="100" width="100" alt="Thumb image" id="thumbimage1" />
<a class="removeimg1" href="javascript:"></a>
</div>
<div id="boxchoice1">
<a href="javascript:" class="choicefile1"><i class="fa fa-cloud-upload" aria-hidden="true"></i> Upload Image</a>
<p></p>
</div>
<label class="filename1"></label>
</div>
</div>
<div class="file-upload">
<div class="upload-bg">
<div id="myfileupload2">
<input type="file" id="uploadfile2" name="ImageUpload" onchange="readURL2(this);" />
</div>
<div id="thumbbox2">
<img src="images/assets/logo.png" height="100" width="100" alt="Thumb image" id="thumbimage2" />
<a class="removeimg2" href="javascript:"></a>
</div>
<div id="boxchoice2">
<a href="javascript:" class="choicefile2"><i class="fa fa-cloud-upload" aria-hidden="true"></i> Upload Image</a>
<p></p>
</div>
<label class="filename2"></label>
</div>
</div>
</div>
</div>
<div class="field">
<label for="tag">Tags *</label>
<span class="label-desc">Enter up to five keywords that best describe your campaign.</span>
......@@ -221,6 +153,9 @@
</template>
<script>
/* Initialize vuex. */
import { mapActions, mapGetters } from 'vuex'
/* Import JQuery. */
// FIXME: Remove ALL jQuery dependencies.
const $ = window.jQuery
......@@ -229,6 +164,81 @@ export default {
components: {
//
},
data: () => {
return {
ownerSlug: null,
slug: null,
extSlug: null,
campaign: null,
campaignId: null,
// fundId: null,
// referrerId: null,
}
},
computed: {
...mapGetters('campaigns', [
'getAsset',
'getCampaign',
]),
title() {
if (this.campaign && this.campaign.title) {
return this.campaign.title
} else {
return null
}
},
location() {
if (this.campaign && this.campaign.location) {
return this.campaign.location
} else {
return null
}
},
},
methods: {
...mapActions('campaigns', [
'updateAsset',
]),
},
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 () {
$('.view-fees').on('click', function (e) {
e.preventDefault()
......
<template>
<div role="tabpanel" class="tab-pane" id="story">
<div class="start-form">
<form action="javascript://">
<div class="field">
<label for="capaignstory">Campaign Story *</label>
<span class="label-desc">Introduce yourself, your campaign and why it’s important to you.</span>
<textarea rows="4" id="capaignstory" placeholder="Enter a few tagline"></textarea>
</div>
<div class="field">
<label for="uploadfile1">
Project Video
</label>
<span class="label-desc">
Have fun – add a video!
Projects with a video have a much higher chance of success.
For a dose of inspiration, check out the <a href="javascript://">Creator Handbook.</a>
Need some help?
Visit our <a href="javascript://">Creator FAQ.</a>
</span>
<div class="list-upload">
<div class="file-upload">
<div class="upload-bg">
<div id="myfileupload1">
<input type="file" id="uploadfile1" name="ImageUpload" onchange="readURL1(this);" accept="video/*" />
</div>
<section class="campaign-form form-update">
<div class="start-form">
<form action="javascript://">
<div class="field">
<label for="capaignstory">
Campaign Story *
</label>
<span class="label-desc">
Introduce yourself, your campaign and why it’s important to you.
</span>
<textarea
rows="4"
id="capaignstory"
placeholder="Enter a few tagline"
v-model="summary"
></textarea>
</div>
<div class="field">
<label for="uploadfile">Campaign Image *</label>
<span class="label-desc">Upload a square image that represents your campaign. 570 x 350 recommended resolution.</span>
<div id="thumbbox1">
<img src="images/assets/logo.png" height="695" width="460" alt="Thumb image" id="thumbimage1" />
<div class="list-upload">
<div class="file-upload">
<div class="upload-bg">
<div id="myfileupload">
<input type="file" id="uploadfile" name="ImageUpload" onchange="readURL(this);" />
</div>
<a class="removeimg1" href="javascript:"></a>
<div id="thumbbox">
<img src="images/assets/logo.png" height="100" width="100" alt="Thumb image" id="thumbimage" />
<a class="removeimg" href="javascript:"></a>
</div>
<div id="boxchoice">
<a href="javascript:" class="choicefile"><i class="fa fa-cloud-upload" aria-hidden="true"></i> Upload Image</a>
<p></p>
</div>
<label class="filename"></label>
</div>
</div>
<div class="file-upload">
<div class="upload-bg">
<div id="myfileupload1">
<input type="file" id="uploadfile1" name="ImageUpload" onchange="readURL1(this);" />
</div>
<div id="thumbbox1">
<img src="images/assets/logo.png" height="100" width="100" alt="Thumb image" id="thumbimage1" />
<a class="removeimg1" href="javascript:"></a>
</div>
<div id="boxchoice1">
<a href="javascript:" class="choicefile1">
<i class="fa fa-cloud-upload" aria-hidden="true"></i>
Upload Video
</a>
<div id="boxchoice1">
<a href="javascript:" class="choicefile1"><i class="fa fa-cloud-upload" aria-hidden="true"></i> Upload Image</a>
<p></p>
</div>
<p></p>
<label class="filename1"></label>
</div>
</div>
<div class="file-upload">
<div class="upload-bg">
<div id="myfileupload2">
<input type="file" id="uploadfile2" name="ImageUpload" onchange="readURL2(this);" />
</div>
<div id="thumbbox2">
<img src="images/assets/logo.png" height="100" width="100" alt="Thumb image" id="thumbimage2" />
<a class="removeimg2" href="javascript:"></a>
</div>
<div id="boxchoice2">
<a href="javascript:" class="choicefile2"><i class="fa fa-cloud-upload" aria-hidden="true"></i> Upload Image</a>
<p></p>
</div>
<label class="filename1"></label>
<label class="filename2"></label>
</div>
</div>
</div>
</div>
</div>
<div class="field">
<label>Project description</label>
<div class="field">
<label for="uploadfile1">
Project Video
</label>
<span class="label-desc">