Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-django
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ilham Maulana
library-app-django
Commits
88136780
Commit
88136780
authored
Jul 09, 2024
by
impfundev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: sifting book loan to use reusable template
parent
ffa82600
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
156 deletions
+8
-156
book_loan_create_form.html
book_loans/templates/book_loan_create_form.html
+0
-52
book_loan_delete_form.html
book_loans/templates/book_loan_delete_form.html
+0
-38
book_loan_table_data.html
book_loans/templates/book_loan_table_data.html
+5
-9
book_loan_update_form.html
book_loans/templates/book_loan_update_form.html
+0
-48
loans.html
book_loans/templates/loans.html
+3
-9
No files found.
book_loans/templates/book_loan_create_form.html
deleted
100644 → 0
View file @
ffa82600
<form
class=
"modal fade"
id=
"book_loan_modal_create"
tabindex=
"-1"
aria-labelledby=
"book_loan_modal_label"
aria-hidden=
"true"
action=
"/dashboard/book-loans/"
method=
"POST"
>
<div
class=
"modal-dialog modal-dialog-scrollable"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h1
class=
"modal-title fs-5"
id=
"exampleModalLabel"
>
Input Data
</h1>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"modal"
aria-label=
"Close"
></button>
</div>
<div
class=
"modal-body d-flex flex-column gap-2"
>
{% csrf_token %}
<label
for=
"book"
>
Book:
</label>
<select
id=
"book"
name=
"book"
class=
"form-select"
>
{% for book in books %}
<option
value=
"{{ book.id }}"
>
{{ book.title }}
</option>
{% endfor %}
</select>
<label
for=
"member"
>
Member:
</label>
<select
id=
"member"
name=
"member"
class=
"form-select"
>
{% for member in members %}
<option
value=
"{{ member.id }}"
>
{{ member.name }}
</option>
{% endfor %}
</select>
{% for field in form %}
<div
class=
"py-1"
>
<label
for=
"{{ field.id }}"
class=
"form-label"
>
{{ field.label }}
</label
>
{{ field }}
</div>
{% endfor %}
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-bs-dismiss=
"modal"
>
Close
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</div>
</div>
</div>
</form>
book_loans/templates/book_loan_delete_form.html
deleted
100644 → 0
View file @
ffa82600
{% for book_loan in book_loans %}
<form
class=
"modal fade"
id=
"book_loan_delete_modal_{{ book_loan.id }}"
tabindex=
"-1"
aria-labelledby=
"book_loan_delete_label"
aria-hidden=
"true"
action=
"/dashboard/book-loans/{{ book_loan.id }}/delete/"
method=
"POST"
>
{% csrf_token %}
<div
class=
"modal-dialog modal-dialog-centered"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h1
class=
"modal-title fs-5"
id=
"exampleModalLabel"
>
Are you sure want to delete this data
</b>
?
</h1>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"modal"
aria-label=
"Close"
></button>
</div>
<div
class=
"modal-body"
>
Once data is deleted, it cannot be restored.
<input
type=
"hidden"
name=
"book_id"
id=
"almacen_id"
value=
"{{ book_loan.book_id }}"
/>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-bs-dismiss=
"modal"
>
Cancel
</button>
<button
type=
"submit"
class=
"btn btn-danger"
>
Continue
</button>
</div>
</div>
</div>
</form>
{% endfor %}
book_loans/templates/book_loan_table_data.html
View file @
88136780
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
{% if
book_loans %} {% for loan in book_loans
%}
{% if
object_list %} {% for loan in object_list
%}
<tr>
<tr>
<td>
{{ loan.book.title }}
</td>
<td>
{{ loan.book.title }}
</td>
<td>
{{ loan.member.name }}
</td>
<td>
{{ loan.member.name }}
</td>
...
@@ -20,19 +20,15 @@
...
@@ -20,19 +20,15 @@
<td>
{{ loan.due_date }}
</td>
<td>
{{ loan.due_date }}
</td>
<td>
{{ loan.return_date }}
</td>
<td>
{{ loan.return_date }}
</td>
<td
class=
"d-flex gap-2 py-4"
>
<td
class=
"d-flex gap-2 py-4"
>
<a
<a
class=
"btn btn-success"
href=
"/dashboard/book-loans/{{ loan.id }}/"
>
class=
"btn btn-success"
href=
"/dashboard/book-loans/{{ loan.id }}/update/"
>
<i
class=
"bi bi-pencil-square"
></i>
<i
class=
"bi bi-pencil-square"
></i>
</a>
</a>
<
button
<
a
class=
"btn btn-danger"
class=
"btn btn-danger"
data-bs-toggle=
"modal"
href=
"/dashboard/book-loans/{{ loan.id }}/delete/"
data-bs-target=
"#book_loan_delete_modal_{{ loan.id }}"
>
>
<i
class=
"bi bi-trash3-fill"
></i>
<i
class=
"bi bi-trash3-fill"
></i>
</
button
>
</
a
>
</td>
</td>
</tr>
</tr>
{% endfor %} {% else %}
{% endfor %} {% else %}
...
...
book_loans/templates/book_loan_update_form.html
deleted
100644 → 0
View file @
ffa82600
{% extends "layout.html" %} {% block dashboard %}
<div
style=
"max-width: 80vw"
class=
"w-100 p-4"
>
<div
class=
"d-flex flex-column gap-2 mb-4"
>
<form
id=
"book_loan_update_modal_{{ loan.id }}"
action=
"/dashboard/book-loans/{{ loan.id }}/update/"
method=
"POST"
>
{% csrf_token %}
<div
class=
"modal-dialog modal-dialog-centered"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header justify-content-between"
>
<h1
class=
"fs-4"
>
Input Data
</h1>
<div
class=
"d-flex gap-2 my-2"
>
<a
href=
"/dashboard/book-loans/"
class=
"btn btn-secondary"
>
Cancel
</a>
<button
type=
"submit"
class=
"btn btn-primary"
>
Submit
</button>
</div>
</div>
<div
class=
"modal-body"
>
<label
for=
"book"
>
Book
</label>
<select
id=
"book"
name=
"book"
class=
"form-select"
>
{% for book in books %}
<option
value=
"{{ book.id }}"
selected=
"{% if initial_book_id == book.id %}true{% else %}false{% endif %}"
>
{{ book.title }}
</option>
{% endfor %}
</select>
<label
for=
"member"
>
Member
</label>
<select
id=
"member"
name=
"member"
class=
"form-select"
>
{% for member in members %}
<option
value=
"{{ member.id }}"
>
{{ member.name }}
</option>
{% endfor %}
</select>
{{ form.as_p }}
</div>
</div>
</div>
</form>
</div>
</div>
{% endblock dashboard %}
book_loans/templates/loans.html
View file @
88136780
{% extends "layout.html" %} {% block dashboard %}
{% extends "layout.html" %} {% block dashboard %}
<div
class=
"w-100 p-4"
>
<div
class=
"w-100 p-4"
>
{% include "book_loan_create_form.html" %}
<div
class=
"d-flex gap-2 mb-4"
>
<div
class=
"d-flex gap-2 mb-4"
>
{% include "order_form.html" %}
{% include "order_form.html" %}
<button
<a
type=
"button"
class=
"btn btn-primary"
href=
"/dashboard/book-loans/add/"
>
type=
"button"
class=
"btn btn-primary"
data-bs-toggle=
"modal"
data-bs-target=
"#book_loan_modal_create"
>
<i
class=
"bi bi-plus-circle"
></i>
Add Book Loan
<i
class=
"bi bi-plus-circle"
></i>
Add Book Loan
</
button
>
</
a
>
{% include "search_form.html" %}
{% include "search_form.html" %}
</div>
</div>
{% include "book_loan_table_data.html" %}
{% include "book_loan_table_data.html" %}
</div>
</div>
{%
include "book_loan_delete_form.html" %} {%
endblock dashboard %}
{% endblock dashboard %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment