forked from Ruderverein-Donau-Linz/rowt
		
	add cox_needed attribute
This commit is contained in:
		@@ -19,6 +19,7 @@ pub struct PlannedEvent {
 | 
			
		||||
pub struct PlannedEventWithUser {
 | 
			
		||||
    #[serde(flatten)]
 | 
			
		||||
    planned_event: PlannedEvent,
 | 
			
		||||
    cox_needed: bool,
 | 
			
		||||
    cox: Vec<Registration>,
 | 
			
		||||
    rower: Vec<Registration>,
 | 
			
		||||
}
 | 
			
		||||
@@ -47,9 +48,11 @@ WHERE day=?",
 | 
			
		||||
 | 
			
		||||
        let mut ret = Vec::new();
 | 
			
		||||
        for event in events {
 | 
			
		||||
            let cox = Self::get_all_cox_for_id(db, event.id).await;
 | 
			
		||||
            ret.push(PlannedEventWithUser {
 | 
			
		||||
                planned_event: event.clone(),
 | 
			
		||||
                cox: Self::get_all_cox_for_id(db, event.id).await,
 | 
			
		||||
                cox_needed: event.planned_amount_cox > cox.len() as i64,
 | 
			
		||||
                cox,
 | 
			
		||||
                rower: Self::get_all_rower_for_id(db, event.id).await,
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -30,6 +30,11 @@
 | 
			
		||||
            <div class="pt-2">
 | 
			
		||||
              <div class="flex justify-between items-center">
 | 
			
		||||
                <div>
 | 
			
		||||
		{% if planned_event.cox_needed %}
 | 
			
		||||
		zusätzliche steuerperson notwendig!!!!!!elf!!
 | 
			
		||||
		{% else %}
 | 
			
		||||
		keine zusätzliche unbedingt notwendig
 | 
			
		||||
		{% endif %}
 | 
			
		||||
                  <strong class="text-primary-900">{{ planned_event.planned_starting_time }} Uhr</strong> <small class="text-gray-600">({{ planned_event.name }})</small><br/>
 | 
			
		||||
                  <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>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user