-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging djreservation with gentelella #74
base: reservations
Are you sure you want to change the base?
Changes from all commits
488aa9f
33c9fa4
1055037
a114d77
d24f62b
14f4891
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
""" | ||
|
||
import os | ||
from django.conf import settings | ||
from datetime import datetime | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
@@ -61,7 +63,7 @@ | |
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [os.path.join(BASE_DIR, 'demo/templates/')], | ||
'DIRS': [os.path.join(BASE_DIR, 'demo/templates/', 'djgentelella/reservation/templates')], | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
|
@@ -140,3 +142,19 @@ | |
'use_readonlywidgets': True, | ||
'use_flags': True | ||
} | ||
|
||
TOKENIZE = getattr(settings, 'DJRESERVATION_TOKENIZE', False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. el objecto settings de djreservation tiene sentido, acá la variable settings no existe, además que fuerza al usuario a siempre poner esos settings y eso no es deseado |
||
|
||
START_RESERVATION_DATETIME = getattr( | ||
settings, 'DJRESERVATION_START_RESERVATION_DATETIME', None) | ||
|
||
END_RESERVATION_DATETIME = getattr( | ||
settings, 'DJRESERVATION_END_RESERVATION_DATETIME', None) | ||
|
||
if START_RESERVATION_DATETIME: | ||
START_RESERVATION_DATETIME = datetime.strptime( | ||
START_RESERVATION_DATETIME, '%d/%m/%Y %H:%M') | ||
|
||
if END_RESERVATION_DATETIME: | ||
END_RESERVATION_DATETIME = datetime.strptime( | ||
END_RESERVATION_DATETIME, '%d/%m/%Y %H:%M') |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
|
||
{% block css%} {%endblock%} | ||
|
||
{% block content %} | ||
{%endblock%} | ||
|
||
{% block js %} | ||
{%endblock%} | ||
{% extends 'gentelella/base.html' %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{% extends 'base.html' %} | ||
{% load static i18n %} | ||
|
||
{% block css%} | ||
{% block css%} | ||
<link rel="stylesheet" type="text/css" media="screen" | ||
href="{% static 'css/bootstrap-datetimepicker.min.css' %}"> | ||
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" | ||
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Esto hay que eliminarlo, ya que djgentelella tiene iconos incorpoados de la versión 4 |
||
rel="stylesheet"> | ||
|
||
<style> | ||
|
@@ -13,7 +13,7 @@ | |
width: 270px; | ||
} | ||
</style> | ||
|
||
{%endblock%} | ||
|
||
|
||
|
@@ -25,15 +25,15 @@ <h1> {% trans "Creating a reservation"%} </h1> | |
{% endblock %} | ||
{{form.errors}} | ||
<form class="form-horizontal" method="post"> | ||
{% csrf_token %} | ||
{% csrf_token %} | ||
|
||
{% block form_start %}{% endblock %} | ||
|
||
{% block form_start %}{% endblock %} | ||
|
||
<div class="form-group"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sería mejor un {{form.as_horizontal }} ?? |
||
{{ form.reserved_start_date.errors }} | ||
<label id="{{ form.reserved_start_date.id_label_tag }}" class="col-sm-2 control-label" > {% trans 'Reservation start date' %} </label> | ||
<div id="dtp_reserved_start_date" class="input-append date"> | ||
<div class="col-sm-2"> | ||
<div class="col-sm-2"> | ||
{{ form.reserved_start_date }} | ||
</div> | ||
|
||
|
@@ -44,13 +44,13 @@ <h1> {% trans "Creating a reservation"%} </h1> | |
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="form-group"> | ||
{{ form.reserved_end_date.errors }} | ||
<label id="{{ form.reserved_end_date.id_label_tag }}" class="col-sm-2 control-label" > {% trans 'Reservation end date' %} </label> | ||
<div id="dtp_reserved_end_date" class="input-append date"> | ||
<div class="col-sm-2"> | ||
<div class="col-sm-2"> | ||
{{ form.reserved_end_date }} | ||
</div> | ||
|
||
|
@@ -61,27 +61,10 @@ <h1> {% trans "Creating a reservation"%} </h1> | |
</div> | ||
</div> | ||
</div> | ||
{% block form_end %}{% endblock %} | ||
<button type="submit" class="btn btn-default">{% trans 'Submit' %}</button> | ||
{% block form_end %}{% endblock %} | ||
|
||
<button type="submit" class="btn btn-outline-success">{% trans 'Submit' %}</button> | ||
</form> | ||
|
||
{% endblock %} | ||
|
||
{% block js %} | ||
<script type="text/javascript" | ||
src="{% static 'js/bootstrap-datetimepicker.min.js' %}"> | ||
</script> | ||
|
||
<script type="text/javascript"> | ||
rsd= $('#dtp_reserved_start_date').datetimepicker({ | ||
format: 'MM/dd/yyyy hh:mm', | ||
autoclose: true | ||
}); | ||
rd= $('#dtp_reserved_end_date').datetimepicker({ | ||
format: 'MM/dd/yyyy hh:mm', | ||
autoclose: true | ||
}); | ||
</script> | ||
|
||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
<div class="panel-heading" role="tab" id="headingOne"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Esto debería utilizar un tabla de gentelella, para esta primera etapa está ok, pero en la siguiente hay que cambia para que se conecte a un api |
||
<h4 class="panel-title"> | ||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{reservation.pk}}" aria-expanded="true" aria-controls="collapse{{reservation.pk}}"> | ||
{{reservation}} | ||
{{reservation}} | ||
</a> | ||
</h4> | ||
</div> | ||
|
@@ -18,21 +18,21 @@ <h4 class="panel-title"> | |
<ul class="list-group"> | ||
{% for product in reservation.product_set.all%} | ||
<li class="list-group-item">{{product}} | ||
{% if product.borrowed %} | ||
{% if product.borrowed %} | ||
<a href="#" style="position: absolute;right: 15px;" > | ||
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span> | ||
</a> | ||
{%else%} | ||
<a href="#" style="position: absolute;right: 15px;" > | ||
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> | ||
</a> | ||
{% endif %} | ||
{% endif %} | ||
</li> | ||
{% endfor%} | ||
</ul> | ||
|
||
{% if reservation.observation_set.count %} | ||
<div class="alert alert-info"> | ||
<div class="alert alert-info" role="alert"> | ||
<h2> {% trans 'Observations' %}</h2> | ||
{% for observation in reservation.observation_set.all %} | ||
{{observation.text}} | ||
|
@@ -45,7 +45,7 @@ <h2> {% trans 'Observations' %}</h2> | |
</div> | ||
|
||
{% empty %} | ||
<h2> {% trans 'No reservations saved yet' %}</h2> | ||
<h2 class="text-center title"> {% trans 'No reservations saved yet' %}</h2> | ||
{% endfor %} | ||
</div> | ||
|
||
|
@@ -58,11 +58,11 @@ <h2> {% trans 'No reservations saved yet' %}</h2> | |
<a href="?page={{ page_obj.previous_page_number }}">{% trans 'Previous' %}</a> | ||
</li> | ||
{% endif %} | ||
|
||
<li> | ||
{% trans 'Page' %} {{ page_obj.number }} -- {{ page_obj.paginator.num_pages }}. | ||
</li> | ||
|
||
{% if page_obj.has_next %} | ||
<li> | ||
<a href="?page={{ page_obj.next_page_number }}">{% trans 'Next' %}</a> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No puso la app en installed apps por eso es que no le reconoce las plantillas.