Commit 9dd70de9 authored by Bitcoin Please's avatar Bitcoin Please

Completed create campaign page.

parent 7362ad17
......@@ -4,6 +4,8 @@
### https://causes.cash
Platform Tour — __https://tour.causes.cash__
Documentation — __https://docs.causes.cash__
Open Source — __https://gitlab.com/bchplease/causes.cash__
......
......@@ -2,7 +2,7 @@
<!-- <div class="page-title background-page"> -->
<div class="page-title" :style="{ 'background-image': 'url(' + bannerImg + ')' }">
<div class="container">
<h1 class="text-capitalize">@{{this.user}} Wallet</h1>
<h1 class="text-capitalize">@{{this.ownerSlug}} Wallet</h1>
<div class="breadcrumbs">
<ul>
<li>
......@@ -49,7 +49,7 @@ export default {
},
data: () => {
return {
user: null,
ownerSlug: null,
}
},
computed: {
......@@ -84,12 +84,8 @@ export default {
},
created: function () {
/* Set user. */
const user = this.$route.params.pathMatch
/* Validate user. */
// FIXME: What should we do if validation fails??
this.user = user
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
mounted: function () {
//
......
......@@ -60,7 +60,7 @@ export default {
},
data: () => {
return {
user: null,
ownerSlug: null,
}
},
computed: {
......@@ -106,12 +106,8 @@ export default {
},
created: function () {
/* Set user. */
const user = this.$route.params.pathMatch
/* Validate user. */
// FIXME: What should we do if validation fails??
this.user = user
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
......
......@@ -4,7 +4,7 @@
<div class="page-title background-page">
<div class="container">
<h1 class="text-capitalize">@{{this.user}} Backed Causes</h1>
<h1 class="text-capitalize">@{{this.ownerSlug}} Backed Causes</h1>
<div class="breadcrumbs">
<ul>
<li><router-link to="/">Home</router-link><span>/</span></li>
......@@ -92,16 +92,12 @@ export default {
},
data: () => {
return {
user: null,
ownerSlug: null,
}
},
created: function () {
/* Set user. */
const user = this.$route.params.pathMatch
/* Validate user. */
// FIXME: What should we do if validation fails??
this.user = user
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -4,7 +4,7 @@
<div class="page-title background-page">
<div class="container">
<h1 class="text-capitalize">@{{this.user}} Campaigns</h1>
<h1 class="text-capitalize">@{{this.ownerSlug}} Campaigns</h1>
<div class="breadcrumbs">
<ul>
<li><router-link to="/">Home</router-link><span>/</span></li>
......@@ -75,16 +75,12 @@ export default {
},
data: () => {
return {
user: null,
ownerSlug: null,
}
},
created: function () {
/* Set user. */
const user = this.$route.params.pathMatch
/* Validate user. */
// FIXME: What should we do if validation fails??
this.user = user
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -4,7 +4,7 @@
<div class="page-title background-page">
<div class="container">
<h1 class="text-capitalize">@{{this.user}} Dashboard</h1>
<h1 class="text-capitalize">@{{this.ownerSlug}} Dashboard</h1>
<div class="breadcrumbs">
<ul>
<li><router-link to="/">Home</router-link><span>/</span></li>
......@@ -84,16 +84,12 @@ export default {
},
data: () => {
return {
user: null,
ownerSlug: null,
}
},
created: function () {
/* Set user. */
const user = this.$route.params.pathMatch
/* Validate user. */
// FIXME: What should we do if validation fails??
this.user = user
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -5,7 +5,7 @@
<div class="page-title background-page">
<div class="container">
<h1 class="text-capitalize">@{{this.user}} Payments</h1>
<h1 class="text-capitalize">@{{this.ownerSlug}} Payments</h1>
<div class="breadcrumbs">
<ul>
<li><router-link to="/">Home</router-link><span>/</span></li>
......@@ -95,11 +95,12 @@ export default {
},
data: () => {
return {
//
ownerSlug: null,
}
},
created: function () {
//
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -4,7 +4,7 @@
<div class="page-title background-page">
<div class="container">
<h1 class="text-capitalize">@{{this.user}} Profile</h1>
<h1 class="text-capitalize">@{{this.ownerSlug}} Profile</h1>
<div class="breadcrumbs">
<ul>
<li><router-link to="/">Home</router-link><span>/</span></li>
......@@ -190,16 +190,12 @@ export default {
},
data: () => {
return {
user: null,
ownerSlug: null,
}
},
created: function () {
/* Set user. */
const user = this.$route.params.pathMatch
/* Validate user. */
// FIXME: What should we do if validation fails??
this.user = user
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -4,7 +4,7 @@
<div class="page-title background-page">
<div class="container">
<h1 class="text-capitalize">@{{this.user}} Pledges Received</h1>
<h1 class="text-capitalize">@{{this.ownerSlug}} Pledges Received</h1>
<div class="breadcrumbs">
<ul>
<li><router-link to="/">Home</router-link><span>/</span></li>
......@@ -92,16 +92,12 @@ export default {
},
data: () => {
return {
user: null,
ownerSlug: null,
}
},
created: function () {
/* Set user. */
const user = this.$route.params.pathMatch
/* Validate user. */
// FIXME: What should we do if validation fails??
this.user = user
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -83,11 +83,12 @@ export default {
},
data: () => {
return {
//
ownerSlug: null,
}
},
created: function () {
//
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -75,14 +75,12 @@ export default {
},
data: () => {
return {
//
ownerSlug: null,
}
},
computed: {
//
},
created: function () {
//
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
},
}
</script>
......
......@@ -465,8 +465,6 @@ export default {
* Create New
*/
async createNew() {
const target = 'http://localhost:6767/v1/campaigns'
/* Validate title. */
if (!this.title || !this.slug) {
return alert('Enter a title')
......@@ -493,9 +491,15 @@ export default {
title: this.title,
category: this.category,
summary: this.summary,
owner: {
slug: this.ownerSlug,
},
location: this.location,
}
/* Set api target. */
const target = 'https://api.causes.cash/v1/campaigns'
const result = await superagent
.post(target)
.send(pkg)
......@@ -533,6 +537,12 @@ export default {
}
}
},
created: function () {
/* Set owner slug. */
this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
console.log('OWNER SLUG', this.ownerSlug)
},
mounted: function () {
$('.view-residence').on('click', function (e) {
e.preventDefault()
......
......@@ -64,17 +64,17 @@ export default {
},
created: function () {
/* Set cause. */
const cause = this.$route.params.cause
/* Set campaign. */
const campaign = this.$route.params.campaign
/* Validate cause. */
if (cause && cause.lastIndexOf('-') !== -1) {
/* Validate campaign. */
if (campaign && campaign.lastIndexOf('-') !== -1) {
/* Set campaign id. */
this.campaignId = cause.slice(0, cause.lastIndexOf('-'))
this.campaignId = campaign.slice(0, campaign.lastIndexOf('-'))
// console.log('this.campaignId', this.campaignId)
/* Set referrer id. */
const referrerId = cause.slice(cause.lastIndexOf('-') + 1)
const referrerId = campaign.slice(campaign.lastIndexOf('-') + 1)
// console.log('referrerId', referrerId)
/* Set extended slug. */
......
......@@ -224,8 +224,8 @@ export default {
this.summary = this.getAsset(
this.campaign.ownerId, `${this.campaign.slug}.summary`)
/* Set user. */
// const user = this.$route.params.pathMatch
/* Set owner slug. */
// this.ownerSlug = this.$route.params.pathMatch.toLowerCase()
// TODO: Validate the user.
......
......@@ -111,6 +111,14 @@ export default {
return 'https://i.imgur.com/9vNfGgt.jpg'
},
},
created: function () {
/* Set campaign. */
const campaign = this.$route.params.campaign
console.log('CAMPAIGN', campaign);
console.log('PARAMS', this.$route.params);
},
mounted: function () {
//
......
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