Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Causes Cash
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bitcoin Please
Causes Cash
Commits
703dc148
Commit
703dc148
authored
Aug 29, 2020
by
Bitcoin Please
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes and updates for campaign assurance details.
parent
e5ca73fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
18 deletions
+35
-18
src/views/Campaign/Details/Content/Assurance.vue
src/views/Campaign/Details/Content/Assurance.vue
+35
-18
No files found.
src/views/Campaign/Details/Content/Assurance.vue
View file @
703dc148
...
...
@@ -98,23 +98,28 @@
<div
class=
"form-group row pledge-group"
>
<label
for=
"pledge-details"
>
Pledge
Details
Pledge
details
<small
class=
"text-danger"
>
(base64 encoded)
</small>
</label>
<textarea
:value=
"pledgeDetails"
class=
"pledge-output"
id=
"pledge-details"
/>
<textarea
id=
"pledge-details"
:value=
"pledgeDetails"
class=
"pledge-output"
@
click=
"copyDetails"
/>
</div>
<div
class=
"form-group row pledge-group"
>
<label
for=
"pledge-auth"
>
Pledge
Authorization
Pledge
authorization
<small
class=
"text-danger"
>
(base64 encoded)
</small>
</label>
<
input
<
textarea
ref=
"pledgeAuth"
class=
"form-control pledge-auth"
type=
"text"
id=
"pledge-auth"
placeholder=
"waiting for authorization message..."
type=
"text"
class=
"form-control pledge-auth"
placeholder=
"Waiting... Paste your encoded authorization message here."
v-model=
"pledgeAuth"
@
change=
"handleAuth"
@
keyup=
"handleAuth"
...
...
@@ -188,8 +193,11 @@ export default {
]),
pledgeAddress
()
{
// FIXME
return
this
.
getAddress
(
'
deposit
'
)
if
(
this
.
getAddress
(
'
causes
'
))
{
return
this
.
getAddress
(
'
causes
'
)
}
else
{
return
null
}
},
/**
...
...
@@ -204,13 +212,17 @@ export default {
return
0
}
/* Set pledges. */
const
pledges
=
this
.
campaign
.
assurances
[
assuranceid
].
pledges
console
.
log
(
'
PLEDGES
'
,
pledges
)
/* Calculate pledged (satoshis). */
const
pledged
=
this
.
campaign
.
assurances
[
assuranceid
].
pledges
.
reduce
((
accumulator
,
pledge
)
=>
{
if
(
pledge
.
isSpent
===
true
)
{
const
pledged
=
Object
.
keys
(
pledges
)
.
reduce
((
accumulator
,
pledge
id
)
=>
{
if
(
pledge
s
[
pledgeid
]
.
isSpent
===
true
)
{
return
accumulator
}
else
{
return
accumulator
+
pledge
.
satoshis
return
accumulator
+
pledge
s
[
pledgeid
]
.
satoshis
}
},
0
)
console
.
log
(
'
PLEDGED
'
,
pledged
)
...
...
@@ -252,7 +264,7 @@ export default {
},
qr
()
{
if
(
!
this
.
getAddress
(
'
deposit
'
))
{
if
(
!
this
.
getAddress
(
'
causes
'
))
{
return
null
}
...
...
@@ -271,13 +283,13 @@ export default {
}
/* Calculate pledge amount (in BCH). */
//
const amount = parseFloat(this.pledgeSatoshis / 100000000.0)
const
amount
=
parseFloat
(
this
.
pledgeSatoshis
/
100000000.0
)
/* Set payment URL. */
//
const paymentUrl = `${this.pledgeAddress}?amount=${amount}`
const
paymentUrl
=
`
${
this
.
pledgeAddress
}
?amount=
${
amount
}
`
//
QRCode.toString(paymentUrl, params, (err, value) => {
QRCode
.
toString
(
this
.
getAddress
(
'
deposit
'
),
params
,
(
err
,
value
)
=>
{
QRCode
.
toString
(
paymentUrl
,
params
,
(
err
,
value
)
=>
{
// QRCode.toString(this.getAddress('causes
'), params, (err, value) => {
if
(
err
)
{
return
console
.
error
(
'
QR Code ERROR:
'
,
err
)
}
...
...
@@ -557,9 +569,14 @@ form {
.pledge-output
{
width
:
90%
;
height
:
100px
;
cursor
:
grab
;
}
.pledge-auth
{
width
:
90%
;
}
textarea
{
background-color
:
rgba
(
141
,
195
,
81
,
0.5
);
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment