hide register button when necessary
This commit is contained in:
		| @@ -34,30 +34,41 @@ | ||||
|                   <a href="#" data-sidebar="true" data-trigger="detailEvent{{ planned_event.id }}" class="inline-block text-primary-600 hover:text-primary-900 underline mr-3">Details</a>                   | ||||
|                 </div> | ||||
|                 <div> | ||||
| 	      	  {% set_global cur_user_participates = false %} | ||||
|                   {% for rower in planned_event.rower%} | ||||
|                     {% if rower.name == loggedin_user.name %} | ||||
|                       <a href="/remove/{{ planned_event.trip_details_id }}" class="deregister-btn rounded-md bg-[#f43f5e] px-3 py-2 text-sm font-semibold text-white hover:bg-[#ff0000] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ff0000] cursor-pointer">Abmelden</a> | ||||
| 			{% set_global cur_user_participates = true %} | ||||
|                     {% endif %} | ||||
|                   {% endfor %}   | ||||
| 		  {% if cur_user_participates %} | ||||
|                   	<a href="/remove/{{ planned_event.trip_details_id }}" class="deregister-btn rounded-md bg-[#f43f5e] px-3 py-2 text-sm font-semibold text-white hover:bg-[#ff0000] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ff0000] cursor-pointer">Abmelden</a> | ||||
| 		  {% endif %} | ||||
|                   {% if planned_event.max_people > planned_event.rower | length %} | ||||
|                     <a href="/join/{{ planned_event.trip_details_id }}" class="register-btn rounded-md bg-primary-600 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">Mitrudern</a> | ||||
|                   {% endif %} | ||||
| 			{% if cur_user_participates == false %} | ||||
|         	            <a href="/join/{{ planned_event.trip_details_id }}" class="register-btn rounded-md bg-primary-600 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">Mitrudern</a> | ||||
|                 	{% endif %} | ||||
|                 {% endif %} | ||||
|                 </div> | ||||
|               </div> | ||||
|             </div> | ||||
|             {% if loggedin_user.is_cox %} | ||||
| 	      {% set_global cur_user_participates = false %} | ||||
|               {% for cox in planned_event.cox %} | ||||
|                 {% if cox.name == loggedin_user.name %} | ||||
| 			{% set_global cur_user_participates = true %} | ||||
|                 {% endif %} | ||||
|               {% endfor %} | ||||
| 	      {% if cur_user_participates %} | ||||
|                   <a href="/cox/remove/{{ planned_event.id }}" class="deregister-btn rounded-md bg-[#f43f5e] px-3 py-2 text-sm font-semibold text-white hover:bg-[#ff0000] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ff0000] cursor-pointer"> | ||||
|                     <svg width="16" height="16" fill="currentColor" class="inline-block mr-1 h-3 w-3" viewBox="0 0 16 16"> <path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z"/> </svg> | ||||
|                     Abmelden | ||||
|                   </a> | ||||
|                 {% endif %} | ||||
|               {% endfor %}    | ||||
|               <a href="/cox/join/{{ planned_event.id }}" class="register-btn rounded-md bg-primary-900 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-950 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-950 cursor-pointer"> | ||||
|                 <svg width="16" height="16" fill="currentColor" class="inline-block mr-1 h-3 w-3" viewBox="0 0 16 16"> <path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z"/> </svg> | ||||
|                 Steuern | ||||
|               </a> | ||||
| 		{% else %} | ||||
| 		      <a href="/cox/join/{{ planned_event.id }}" class="register-btn rounded-md bg-primary-900 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-950 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-950 cursor-pointer"> | ||||
| 			<svg width="16" height="16" fill="currentColor" class="inline-block mr-1 h-3 w-3" viewBox="0 0 16 16"> <path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z"/> </svg> | ||||
| 			Steuern | ||||
| 		      </a> | ||||
| 	      {% endif %} | ||||
|             {% endif %} | ||||
|      | ||||
|             <div class="sidebar slide-in from-right" id="detailEvent{{ planned_event.id }}" aria-modal="false"> | ||||
| @@ -131,12 +142,16 @@ | ||||
|                     <a href="#" data-sidebar="true" data-trigger="detailTrip{{ trip.trip_details_id }}" class="inline-block text-primary-600 hover:text-primary-900 underline mr-3">Details</a>                   | ||||
|                   </div> | ||||
|                   <div> | ||||
| 	      	    {% set_global cur_user_participates = false %} | ||||
|                     {% for rower in trip.rower %} | ||||
|                       {% if rower.name == loggedin_user.name %} | ||||
|                         <a href="/remove/{{ trip.trip_details_id }}" class="deregister-btn inline-block rounded-md bg-[#f43f5e] px-3 py-2 text-sm font-semibold text-white hover:bg-[#ff0000] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ff0000] cursor-pointer">Abmelden</a> | ||||
| 	      	  	{% set_global cur_user_participates = true %} | ||||
|                       {% endif %} | ||||
|                     {% endfor %} | ||||
|                     {% if trip.max_people > trip.rower | length  and trip.cox_id != loggedin_user.id %} | ||||
|                     {% if cur_user_participates %} | ||||
| 			<a href="/remove/{{ trip.trip_details_id }}" class="deregister-btn inline-block rounded-md bg-[#f43f5e] px-3 py-2 text-sm font-semibold text-white hover:bg-[#ff0000] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ff0000] cursor-pointer">Abmelden</a> | ||||
| 		    {% endif %} | ||||
|                     {% if trip.max_people > trip.rower | length  and trip.cox_id != loggedin_user.id and cur_user_participates == false%} | ||||
|                       <a href="/join/{{ trip.trip_details_id }}" class="register-btn inline-block rounded-md bg-primary-600 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">Mitrudern</a> | ||||
|                     {% endif %} | ||||
|                   </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user