Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Small Technology Foundation web site
spikes
patronage
Commits
37d75a97
Verified
Commit
37d75a97
authored
Aug 03, 2019
by
Aral Balkan
Browse files
Display patronage status in the “at a glance” section
parent
a2f53081
Changes
3
Hide whitespace changes
Inline
Side-by-side
.dynamic/client/patron.html
View file @
37d75a97
...
...
@@ -41,6 +41,7 @@
<h2>
At a glance
</h2>
<ul>
<li><strong>
Status:
</strong>
<span
id=
'patronage-status'
>
${patronageStatus}
</span></li>
<li><strong>
Patron since:
</strong>
${patronSinceRelative} (${patronSinceAbsolute})
</strong>
<li><strong>
Amount:
</strong>
€
<span
id=
'patronageAmountDisplay'
>
${patronageAmount}
</span>
/month
</li>
<li><strong>
Last payment:
</strong>
${currentPeriodStartRelative} (${currentPeriodStartAbsolute})
</li>
...
...
@@ -78,6 +79,7 @@
<script>
const
subscriptionId
=
'
${subscriptionId}
'
const
subscriptionStatus
=
'
${subscriptionStatus}
'
const
planId
=
'
${planId}
'
const
itemId
=
'
${itemId}
'
const
currentAmount
=
$
{
patronageAmount
}
...
...
.dynamic/client/patron.js
View file @
37d75a97
...
...
@@ -14,11 +14,7 @@ window.addEventListener('load', _ => {
response
=
JSON
.
parse
(
message
.
data
)
if
(
response
.
error
)
{
Modal
.
fire
(
'
Error
'
,
error
,
'
error
'
)
Modal
.
fire
(
'
Error
'
,
error
,
'
error
'
)
return
}
...
...
@@ -41,6 +37,7 @@ window.addEventListener('load', _ => {
$
(
'
#pauseButton
'
).
value
=
'
Pause my patronage
'
$
(
'
#pauseButton
'
).
disabled
=
false
$
(
'
#resume-your-patronage
'
).
hidden
=
false
$
(
'
#patronage-status
'
).
innerHTML
=
'
paused
'
Modal
.
fire
(
'
Patronage paused
'
,
`Your patronage has been paused effective immediately. You can resume it again at any time. Thank you for supporting us.`
,
...
...
@@ -53,6 +50,7 @@ window.addEventListener('load', _ => {
$
(
'
#resumeButton
'
).
value
=
'
Resume my patronage
'
$
(
'
#resumeButton
'
).
disabled
=
false
$
(
'
#pause-your-patronage
'
).
hidden
=
false
$
(
'
#patronage-status
'
).
innerHTML
=
'
active
'
Modal
.
fire
(
'
Patronage resumed
'
,
`Your patronage has been resumed effective immediately. You can pause it again at any time. Thank you for supporting us.`
,
...
...
.dynamic/https/get/patron.js
View file @
37d75a97
...
...
@@ -62,8 +62,8 @@ module.exports = async (request, response, next) => {
const
currentPeriodEndAbsolute
=
lowercaseFirstLetter
(
currentPeriodEndMoment
.
calendar
())
const
patronageAmount
=
subscription
.
quantity
const
isPaused
=
subscription
.
discount
!==
null
const
patronageStatus
=
subscriptionStatus
===
'
active
'
?
(
isPaused
?
'
paused
'
:
'
active
'
)
:
subscriptionStatus
// Newly-created?
let
newPatronMessage
=
''
...
...
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