59 lines
		
	
	
		
			No EOL
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Twig
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			No EOL
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Twig
		
	
	
	
	
	
{% extends 'base.html.twig' %}
 | 
						|
 | 
						|
{% block title %}My offers{% endblock %}
 | 
						|
 | 
						|
{% block body %}
 | 
						|
    {% for message in app.flashes('success') %}
 | 
						|
        <div class="alert alert-success" role="alert">
 | 
						|
            {{ message }}
 | 
						|
        </div>
 | 
						|
    {% endfor %}
 | 
						|
    <h1>My Offers</h1>
 | 
						|
    {% if offers|length > 0 %}
 | 
						|
        <div class="card-deck d-flex justify-content-around justify-content-sm-around justify-content-md-between flex-wrap">
 | 
						|
            {% for offer in offers %}
 | 
						|
                <div class="mb-5">
 | 
						|
                    <div class="card offer h-100">
 | 
						|
                        <a href="{{ path('show_offer', {'id': offer.id }) }}">
 | 
						|
                            {% if offer.photoFilename %}
 | 
						|
                                <img class="card-img-top offer-img" src="{{ asset('uploads/photos/' ~ offer.photofilename) }}" />
 | 
						|
                            {% else %}
 | 
						|
                                <img class="card-img-top offer-img" src="{{ asset('placeholder.jpg') }}" />
 | 
						|
                            {% endif %}
 | 
						|
                            <div class="card-body">
 | 
						|
                                <h5 class="card-title">{{ offer.title }}</h5>
 | 
						|
                                <p class="card-text">{{ offer.description }}</p>
 | 
						|
                            </div>
 | 
						|
                        </a>
 | 
						|
                        <div class="card-footer offer-footer">
 | 
						|
                            <a href="{{ path('edit_offer', {'id': offer.id}) }}" class="btn btn-info"><i class="fas fa-pen"></i></a>
 | 
						|
                            <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#offer-modal-{{ offer.id }}"><i class="fas fa-trash-alt"></i></button>
 | 
						|
                        </div>
 | 
						|
                    </div>
 | 
						|
                    <!-- Modal -->
 | 
						|
                    <div class="modal fade" id="offer-modal-{{ offer.id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
 | 
						|
                        <div class="modal-dialog" role="document">
 | 
						|
                            <div class="modal-content">
 | 
						|
                                <div class="modal-header">
 | 
						|
                                    <h5 class="modal-title" id="exampleModalLabel">Warning</h5>
 | 
						|
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
 | 
						|
                                    <span aria-hidden="true">×</span>
 | 
						|
                                    </button>
 | 
						|
                                </div>
 | 
						|
                                <div class="modal-body">
 | 
						|
                                    Are you sure you want to delete this offer?
 | 
						|
                                </div>
 | 
						|
                                <div class="modal-footer">
 | 
						|
                                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
 | 
						|
                                    <a type="button" class="btn btn-danger" href="{{ path('delete_offer', {'id': offer.id}) }}">Delete</a>
 | 
						|
                                </div>
 | 
						|
                            </div>
 | 
						|
                        </div>
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
            {% endfor %}
 | 
						|
        </div>
 | 
						|
    {% else %}
 | 
						|
        <div class="alert alert-warning" role="alert">There are currently no active offers.</div>
 | 
						|
    {% endif %}
 | 
						|
{% endblock %} |