Fix sponsor display and warnings for explicit-contract sponsors master github/master
authorMagnus Hagander <magnus@hagander.net>
Mon, 9 Jun 2025 13:51:12 +0000 (15:51 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 9 Jun 2025 13:52:03 +0000 (15:52 +0200)
Make sure the warning is actually shown in all cases, so one doesn't
accidentally click through a sponsor that's actually waiting for a
contract.

template/confsponsor/admin_sponsor.html
template/confsponsor/admin_sponsor_details.html

index 75ae0a8358772f2b3c9cef23d37c83aeca9f60ed..5a0fe5493764942838475a6d7fc33b26f8f2c130 100644 (file)
@@ -168,11 +168,6 @@ for this sponsor, it can be confirmed before the invoice is paid.
   contract level sponsorship, so as soon as the sponsorship
   details above have been verified, an invoice should be generated.
 </p>
-<p>
-  Once generated, the invoice will automatically
-  be emailed to the sponsor, as well as show up on their dashboard. Once
-  the invoice is paid, the sponsorship will automatically become confirmed.
-</p>
 {%else%}{%comment%}no invoice, not instant, so awaiting contract{%endcomment%}
 {%if sponsor.signmethod == 0%}
 <p>
@@ -209,7 +204,12 @@ has been received, go ahead and generate the invoice.
 {%endif%}
 <form method="post" action=".">{%csrf_token%}
 {%if sponsor.level.levelcost %}
-<input type="submit" name="submit" value="Generate sponsorship invoice" class="btn btn-default{%if sponsor.signmethod == 0%} confirm-btn{%endif%}"{%if sponsor.signmethod == 0%} data-confirm="This sponsor is using a digital contract! Normally invoicing/confirmation is automatic through that system and you should *not* do it manually. are you sure you want to proceed?"{%endif%}>
+<p>
+  Once generated, the invoice will automatically
+  be emailed to the sponsor, as well as show up on their dashboard. Once
+  the invoice is paid, the sponsorship will automatically become confirmed.
+</p>
+<input type="submit" name="submit" value="Generate sponsorship invoice" class="btn btn-default{%if sponsor.signmethod == 0 or sponsor.explicitcontract == 1 or sponsor.level.contractlevel == 2%} confirm-btn{%endif%}"{%if sponsor.signmethod == 0%} data-confirm="This sponsor is using a digital contract! Normally invoicing/confirmation is automatic through that system and you should *not* do it manually. are you sure you want to proceed?"{%elif sponsor.level.contractlevel == 2 or sponsor.explicitcontract == 1%} data-confirm="This sponsorship expects a signed and coutersigned contract before generating the invoice. Proceed?"{%endif%}>
 {%else%}
 <input type="submit" name="submit" value="Confirm sponsorship without invoice" class="btn btn-default confirm-btn" data-confirm="Once confirmed, there is no going back!">
 {%endif%}
index deacbc8c8a1cf0d4ec480d2b5ef51b577395647b..113d660c838af079f059375b379ae7f4057eeedd 100644 (file)
@@ -43,7 +43,7 @@
       No contract needed for this level.
       {%elif sponsor.level.contractlevel == 1 and not sponsor.explicitcontract %}
       Click-through contract completed. {%if not sponsor.confirmed%}<form class="inline-block-form" method="post" action="resendcontract/">{% csrf_token %}<input type="submit" class="btn btn-sm btn-default confirm-btn" value="Re-send contract anyway" data-confirm="Are you sure you want to re-send a new contract to this sponsor?{%if sponsor.signmethod == 0%} {{conference.contractprovider.implementation.resendprompt}}{%endif%}"></form>{%endif%}
-      {%else%}{%comment%}Full contract{%endcomment%}
+      {%elif sponsor.level.contractlevel == 2 or sponsor.explicitcontract %}{%comment%}Full contract, or explicit contract{%endcomment%}
        {%if sponsor.signmethod == 0%}
        Digital contract.<br/>
         {%if sponsor.contract.completed%}Signed ({{sponsor.contract.firstsigned}}) and countersigned ({{sponsor.contract.completed}}).