Skip to content

Commit

Permalink
Resolve #70, Disable donation in staging version of app (#73)
Browse files Browse the repository at this point in the history
* Resolve #70, Disable donation in staging version of app

* Add info about screenshots on Mac and Linux

* Remove hidden class from alert message
  • Loading branch information
ajwalkiewicz authored Jan 22, 2023
1 parent 4f32630 commit 5917ef7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
7 changes: 3 additions & 4 deletions webapp/templates/donation.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ <h6>Project's costs</h6>

if (currentURL.hostname === "www.staging.cochar.pl") {

const message = '<div class="row">\
<div id="primary-alert" class="alert alert-primary hidden" role="alert">\
const message = '\
<div id="primary-alert" class="alert alert-primary" role="alert">\
Donation is disabled in staging version of application.\
</div>\
</div>'
</div>'

const mainContainer = document.getElementsByClassName("border")[0]
const donateButton = document.getElementsByClassName("btn-primary")[0]
Expand Down
6 changes: 3 additions & 3 deletions webapp/templates/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ <h3>How can I notify about an issue/bug that I found?</h3>
>issue</a
>
in the project's
<a href="https://github.com/ajwalkiewicz/cochar">github page</a>. It
will be later triage. If triage ends positively it will be included in
the project's plan.
<a href="https://github.com/ajwalkiewicz/cochar/issues">github page</a
>. It will be later triage. If triage ends positively it will be
included in the project's plan.
</p>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion webapp/templates/generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ <h4 class="modal-title">Feature not implemented</h4>
<p>
As a workaround we suggest to take a screenshot.
</p>
<p>Windows: <code>Win+Shift+S</code> or <code>Printscreen</code></p>
<p>Windows: <code>Win+Shift+S</code> or <code>Print Screen</code></p>
<p>Mac: <code>Shift+Command+4</code> or <code>Shift+Command+3</code></p>
<p>Linux: <code>Print Screen</code></p>
<p>Sorry fot the inconvenience.</p>
</div>

<!-- Modal footer -->
Expand Down
19 changes: 18 additions & 1 deletion webapp/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h3>History</h3>
as professional as I can, but I'm not even a developer. With that
having said I hope you enjoy it :)
</p>
<h3>Support</h3>
<h3 id="support-title">Support</h3>
<p>
If you would like to financially support cochar project, please visit
<a href="/donation">donation</a> section.
Expand Down Expand Up @@ -107,4 +107,21 @@ <h3>Legal note</h3>
</div>
</div>
</div>
<script>
const currentURL = new URL(window.location.href);

if (currentURL.hostname === "www.staging.cochar.pl") {
const message =
'\
<div id="primary-alert" class="alert alert-primary" role="alert">\
Donation is disabled in staging version of application.\
</div>';

const donateButton = document.getElementsByClassName("btn-primary")[0];
const supportTitle = document.getElementById("support-title");

supportTitle.insertAdjacentHTML("afterend", message);
donateButton.classList.add("disabled");
}
</script>
{% endblock %}

0 comments on commit 5917ef7

Please sign in to comment.