src/Bidcoz/Bundle/FrontendBundle/Resources/views/Campaign/Volunteer/index.html.twig line 14

Open in your IDE?
  1. {% extends '@BidcozFrontend/campaign.html.twig' %}
  2. {% block sidebar '' %}
  3. {% block beforeContent %}
  4.     {{ parent() }}
  5.     <h1>CrewUp</h1>
  6. {% endblock %}
  7. {% block content %}
  8.     {% if tasks|length %}
  9.         <div class="volunteer-tasks d-flex flex-wrap mx-n3 align-items-stretch">
  10.             {% for task in tasks %}
  11.                 {% set currentUserSignedUp = loggedUser ? (task.assignments|filter(assignment => assignment.user and assignment.user.id == loggedUser.id)|length > 0) : false %}
  12.                 <div class="col-12 col-md-6 col-lg-4 col-xl-3 mb-4">
  13.                     <div class="panel d-flex flex-column h-100">
  14.                         <div class="panel-body pb-0">
  15.                             <h6 class="panel-title mb-2 mt-n2 mb-2">{{ task.title }}</h6>
  16.                             <div class="remaining-spots d-flex flex-wrap align-items-center">
  17.                                 {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'grid-fill', class: 'icon-sm' } %}
  18.                                 {% if task.hasAssignmentsAvailable %}
  19.                                     <small class="ml-1 text-green">Crew: {{ (task.numNeeded - task.assignmentsAvailable)|number_format }} of {{ task.numNeeded|number_format }} Onboard</small>
  20.                                 {% else %}
  21.                                     <small class="ml-1">Fully Crewed - Thanks for Stepping Up!</small>
  22.                                 {% endif %}
  23.                             </div>
  24.                             <hr class="visible-xs">
  25.                             {% if task.description %}<p class="description">{{ task.description|raw }}</p>{% endif %}
  26.                             <hr class="visible-xs">
  27.                             {% if loggedUser %}
  28.                                 {% if task.assignments|length %}
  29.                                     <div class="d-flex flex-wrap align-items-center">
  30.                                         {% include '@BidcozCore/Components/icon.html.twig' with { icon: 'user-fill', class: 'icon-sm' } %}
  31.                                         {% if task.hasAssignmentsAvailable %}
  32.                                             <small class="ml-1">Crew members already on board for this task:</small>
  33.                                         {% else %}
  34.                                             <small class="ml-1">The following people have signed up:</small>
  35.                                         {% endif %}
  36.                                     </div>
  37.                                     {% for assignment in task.assignments|filter(assignment => assignment.user) %}
  38.                                         <small class="ml-4">&bull; {{ assignment.user.name }}</small><br/>
  39.                                     {% endfor %}
  40.                                 {% else %}
  41.                                     <p class="text-center"><strong>You can be the first to crew up!</strong></p>
  42.                                 {% endif %}
  43.                                 <hr class="visible-xs">
  44.                             {% endif %}
  45.                             {% if currentUserSignedUp %}
  46.                                 <p class="text-center"><strong>You're an important part of this crew - thank you!</strong></p>
  47.                             {% endif %}
  48.                         </div>
  49.                         <div class="panel-footer mt-auto px-4 pb-4">
  50.                             {% if currentUserSignedUp %}
  51.                                 {% set canRelease = (task.dateNeededFrom is null) or ((task.dateNeededFrom|date('U')) - ('now'|date('U')) > 24 * 3600) %}
  52.                                 {% if canRelease %}
  53.                                     <div class="">
  54.                                         <form action="{{ path('campaign_volunteer_release_task', campaignParams|merge({taskId: task.id})) }}" method="post">
  55.                                             <button type="submit" class="btn btn-danger btn-sm volunteer-release-btn">Leave the Crew</button>
  56.                                         </form>
  57.                                     </div>
  58.                                 {% else %}
  59.                                     <div class="alert bg-light font-weight-normal text-dark border border-info" role="alert">
  60.                                         Since this task starts in less than 24 hours, please
  61.                                         <a href="{{ path('campaign_contact', campaignParams) }}">contact the CrewUp Administrator</a>
  62.                                         if you need to cancel so we can make sure your role is covered.
  63.                                     </div>
  64.                                 {% endif %}
  65.                             {% else %}
  66.                                 {% if loggedUser %}
  67.                                     <form action="{{ path('campaign_volunteer_for_task', campaignParams|merge({taskId: task.id})) }}" method="post">
  68.                                         <button type="submit" class="btn btn-primary task-select mt-3 volunteer-signup-btn">Count Me In!</button>
  69.                                     </form>
  70.                                 {% else %}
  71.                                     <h6 class="lead">
  72.                                         An account is required to participate.<br><br>
  73.                                         <a href="{{ path('campaign_login_user', campaignParams) }}" data-toggle="modal" data-target="#loginModal" class="btn btn-success trigger-login">Sign In or Create Account</a>
  74.                                     </h6>
  75.                                 {% endif %}
  76.                             {% endif %}
  77.                         </div>
  78.                     </div>
  79.                 </div>
  80.             {% endfor %}
  81.         </div>
  82.     {% else %}
  83.         <div class="panel h-100">
  84.             <div class="panel-body h-100 py-4">
  85.                 <div class="select-type-default center text-center">
  86.                     <div class="d-flex justify-content-center">
  87.                         <i class="fas fa-hands-helping icon"></i>
  88.                     </div>
  89.                     <h2>Sorry, there are currently no tasks available.</h2>
  90.                 </div>
  91.             </div>
  92.         </div>
  93.     {% endif %}
  94. {% endblock %}
  95. {% block stylesheets %}
  96.     {{ parent() }}
  97.     <link rel="stylesheet" href="/components/bootstrap-sweetalert/dist/sweetalert.css" />
  98. {% endblock %}
  99. {% block javascripts %}
  100.     {{ parent() }}
  101.     <script src="/components/bootstrap-sweetalert/dist/sweetalert.min.js" type="text/javascript"></script>
  102. {% endblock %}