Skip to content

Commit

Permalink
wizard helps.
Browse files Browse the repository at this point in the history
  • Loading branch information
aleducode committed Sep 9, 2020
1 parent 7e8fa9a commit c5486f3
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 140 deletions.
79 changes: 34 additions & 45 deletions abjhelp/templates/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,48 @@
{% block content %}
<div class="page-content">
<div class="container-fluid">
<div class="col-xl-12">


<div class="card overflow-hidden">
<div class="bg-soft-primary">
<div class="row">
<div class="col-7">
<div class="text-primary p-3">
<h5 class="text-primary">Pedido {{help.pk}}</h5>
</div>
</div>
<div class="col-5 align-self-end">
<img src="{% static 'backoffice/assets/images/profile-img.png' %}" alt="" class="img-fluid">
</div>
<div class="col-xl-6 offset-lg-3">
<a href="{% url 'users:help-requests' %}">Regresar</a>

<div class="card overflow-hidden mt-2">
<div class="bg-soft-primary">
<div class="row">
<div class="col-7">
<div class="text-primary p-3">
<h5 class="text-primary">Pedido #{{help.pk}}</h5>
</div>
</div>
<div class="col-5 align-self-end">
<img src="{% static 'backoffice/assets/images/profile-img.png' %}" alt="" class="img-fluid">
</div>
</div>
<!-- end card -->

<div class="card">
<div class="card-body">
<h3 class="subtitle has-text-left">{{help.name|upper}}</h3>
</div>
</div>
<!-- end card -->

<p class="has-text-left is-size-6">{{help.description}}</p>
<div class="table-responsive">
<table class="table table-nowrap mb-0">
<tbody>
<tr>
<th scope="row">Ubicacion:</th>
<td>{{help.address}}</td>
</tr>
</tbody>
</table>
</div>
<h3 class="subtitle has-text-left">Contactar:</h3>
</div>
<div></div>
<h3 class="subtitle has-text-left">
<a class="button hover-grow is-half request-phone-button" href="tel:+541127123431">

<span>+57{{help.phone_number}}</span>
<div class="card">
<div class="card-body">
<h3 class="subtitle has-text-left">{{help.name|title}}</h3>

<p class="has-text-left is-size-6">{{help.description}}</p>
<h5 class="font-size-15 font-weight-bold">Ubicación: </h5>{{help.address}}
<h5 class="font-size-15 font-weight-bold mt-3">Contactar</h5>
<div class="row">
<div class="col-12 mt-3">
<a type="button" href="tel:+57{{help.phone_number}}"
class="btn btn-dark waves-effect waves-light mr-3">
<i class="bx bx-phone-outgoing font-size-24 align-middle mr-2"></i> Llamar
</a>
<a class="button hover-grow request-whatsapp-button"
href="https://wa.me/541127123431?text=Hola+mariano,+te+escribo+por+el+pedido+que+hiciste:+necesito+de+manera+urgente+mercaderia+https://argentinaporvos.org/pedidos/29">
<span class="icon is-small">

<img src="https://argentinaporvos.s3.amazonaws.com/static/img/whatsapp.svg" alt="">
</span>
<span>Contactar vía WhatsApp</span>
<a type="button" href="{{whatsapp}}" class="btn btn-success waves-effect waves-light">
<i class="bx bxl-whatsapp font-size-24 align-middle mr-2"></i> Whatsapp
</a>
</h3>
</div>
</div>
</div>


</div>

</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion abjhelp/templates/disclaimer_donor.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h4>Cómo funciona?</h4>
(asegurate que todos sean correctos) en la plataforma de unconviteporabejorral.org
</p>
</div>
<a href="{% url 'users:donor' %}"
<a href="{% url 'users:help-requests' %}"
class="btn btn-lg btn-block btn-success w-lg waves-effect waves-light"
style="color:white">Entendido</a>
</div>
Expand Down
11 changes: 0 additions & 11 deletions abjhelp/templates/help_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ <h3 class="mb-4 text-center">Solicitud de Ayuda</h3>
<form method="POST">
{% csrf_token %}


<div class="form-group">
<input class="form-check-input" type="checkbox" id="inlineFormCheck" switch="info" checked>
<label class="form-check-label" for="switch7" data-on-label="Si" data-off-label="No">
Es para mi?
</label>
</div>
<div class="form-group">
<input type="checkbox" id="inlineFormCheck" switch="info" checked />
<label class="form-check-label" for="switch7" data-on-label="Si" data-off-label="No">¿Es para mi?</label>
</div>
<div class="form-group">
<label>{{form.name.label}}</label>
<input type="text" class="form-control {%if form.name.errors %}is-invalid{%endif%}"
Expand Down
139 changes: 67 additions & 72 deletions abjhelp/templates/information.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,86 @@


{% block content %}

{% block css %}
<style>
.descrption{
color: inherit
}
.descrption:hover{
color: inherit;
}
</style>
{% endblock css %}

<div class="page-content">
<div class="container-fluid">
<div class="col-xl-12">
<div class="col-xl-6 offset-lg-3">
<div class="row">
<a href="{% url 'users:index' %}">Regresar</a>
<div class="col-12 text-center">
<div class="card-title">
<h3 class="mb-4">Listado de solicitudes</h3>
</div>
</div>

{% if helps %}

{% for help in helps %}
<div class="col-xl-4 col-sm-6">
<div class="card">
<div class="card-body">
<div class="media">
<div class="avatar-md mr-4">
<span class="avatar-title rounded-circle bg-soft-primary text-primary font-size-16">
{{help.name.0|upper}}
</span>

</div>
<div class="card" style="width: 100%;">
<div class="card-body pt-0">
<div>
<ul class="verti-timeline list-unstyled mt-4">
<li class="event-list ml-1 pl-0">
<div class="media">
<div class="mr-3">
<i class="bx bx-message-alt-dots h1 text-primary"></i>
</div>
<a href="{% url 'users:detail' help.pk %}" class="descrption">
<div class="media-body">
<div>
<h5 class="font-size-14">{{help.name|title}}</h5>
<p class="text-justify text-muted mb-0">
{{help.description|truncatechars:200 }} <a
href="{% url 'users:detail' help.pk %}">Leer Más</a>
</p>
</div>
<div class="mt-2 border-top">
<ul class="list-inline mt-3 mb-0">
<li class="list-inline-item mr-3">

<div class="media-body overflow-hidden">
<h5 class="text-truncate font-size-15"><a href="{% url 'users:detail' help.pk %}" class="text-dark">{{help.name}}</a></h5>
<p class="text-justify">{{help.description|truncatewords:3 }}</p></p>
<!--<div class="team">Tel: {{help.phone_number}}</div>-->
</div>
</div>
</div>
<div class="px-4 py-3 border-top">
<ul class="list-inline mb-0">
<li class="list-inline-item mr-3">

{% if help.is_active %}
<span class="badge badge-primary">Disponible</span>

{% else %}
<span class="badge badge-success">Completado</span>
{% endif %}
</li>
<li class="list-inline-item mr-3" data-toggle="tooltip" data-placement="top" title=""
data-original-title="Due Date">
<i class="bx bx-calendar mr-1"></i>{{help.created|date:"d-m-Y"}}
{% if help.is_active %}
<span class="badge badge-primary">Disponible</span>

{% else %}
<span class="badge badge-success">Completado</span>
{% endif %}
</li>
<li class="list-inline-item mr-3" data-toggle="tooltip"
data-placement="top" title=""
data-original-title="Fecha de solicitud">
<i class="bx bx-calendar mr-1"></i>{{help.created|date:"d-m-Y"}}
</li>
</ul>
</div>
</div>
</a>
</div>
</li>
</ul>

</div>
</div>
</div>


{% endfor %}

{% endif %}

</div>
<!-- end row -->

<div class="row">
<div class="col-lg-12">
<ul class="pagination pagination-rounded justify-content-center mt-2 mb-5">
<li class="page-item disabled">
<a href="#" class="page-link"><i class="mdi mdi-chevron-left"></i></a>
</li>
<li class="page-item">
<a href="#" class="page-link">1</a>
</li>
<li class="page-item active">
<a href="#" class="page-link">2</a>
</li>
<li class="page-item">
<a href="#" class="page-link">3</a>
</li>
<li class="page-item">
<a href="#" class="page-link">4</a>
</li>
<li class="page-item">
<a href="#" class="page-link">5</a>
</li>
<li class="page-item">
<a href="#" class="page-link"><i class="mdi mdi-chevron-right"></i></a>
</li>
</ul>
</div>
</div>
<!-- end row -->

</div> <!-- container-fluid -->
</div>
<!-- End Page-content -->
{% endif %}
</div>
</div>


</div> <!-- container-fluid -->
</div>
</div>
<!-- End Page-content -->
</div>
{% endblock content %}
8 changes: 4 additions & 4 deletions abjhelp/users/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
name='thanks_donor'
),
path(
route="informacion",
route="solicitudes",
view=users_view.InformationView.as_view(),
name='information'
name='help-requests'
),
path(
path(
route="detalle/<str:pk>/",
view=users_view.RequestDetailView.as_view(),
name='detail'
),
),

]
7 changes: 7 additions & 0 deletions abjhelp/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ class RequestDetailView(DetailView):
slug_url_kwarg = 'pk'
queryset = HelpRequest.objects.all()
context_object_name = 'help'

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
help_request = self.get_object()
context["whatsapp"] = f'https://wa.me/57{help_request.phone_number}?text=Hola+{help_request.name},+te+escribo+por+el+pedido+que+hiciste+en+la+app+Un+Convite+por+Abejorral+https://unconviteporabejorral.org/detalle/{help_request.pk}'
return context

7 changes: 0 additions & 7 deletions local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ services:
context: .
dockerfile: ./compose/local/django/Dockerfile
image: abjhelp_local_django
container_name: django
depends_on:
- postgres
- mailhog
Expand All @@ -28,7 +27,6 @@ services:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: abjhelp_production_postgres
container_name: postgres
volumes:
- local_postgres_data:/var/lib/postgresql/data
- local_postgres_data_backups:/backups
Expand All @@ -52,18 +50,15 @@ services:

mailhog:
image: mailhog/mailhog:v1.0.0
container_name: mailhog
ports:
- "8025:8025"

redis:
image: redis:5.0
container_name: redis

celeryworker:
<<: *django
image: abjhelp_local_celeryworker
container_name: celeryworker
depends_on:
- redis
- postgres
Expand All @@ -74,7 +69,6 @@ services:
celerybeat:
<<: *django
image: abjhelp_local_celerybeat
container_name: celerybeat
depends_on:
- redis
- postgres
Expand All @@ -85,7 +79,6 @@ services:
flower:
<<: *django
image: abjhelp_local_flower
container_name: flower
ports:
- "5555:5555"
command: /start-flower

0 comments on commit c5486f3

Please sign in to comment.