-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maciej Matczak
committed
Sep 7, 2019
1 parent
b3e62b3
commit fe24ffb
Showing
10 changed files
with
226 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
scraper/templates/scraper/scrapingtask_confirm_delete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% extends 'scraper/base.html' %} | ||
{% load crispy_forms_tags %} | ||
|
||
{% block content %} | ||
|
||
<div class="entry-section"> | ||
<form method="POST"> | ||
{% csrf_token %} | ||
|
||
<fieldset class="form-group"> | ||
<legend class="border-bottom mb-4">Delete task</legend> | ||
Please confirm deleting task: "{{ object.title }}" | ||
</fieldset> | ||
<div class="form-group"> | ||
<button class="btn btn-outline-danger" type="submit">Yes, Delete</button> | ||
<a class="btn btn-outline-secondary" href="{% url 'scrapingtask-detail' object.id %}">Cancel</a> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends 'scraper/base.html' %} | ||
|
||
{% block content %} | ||
<div class="entry-section"> | ||
<div class="entry-header"> | ||
<h5 class="entry-title mr-4">{{ object.title }}</h5> | ||
</div> | ||
|
||
<div class="entry-content"> | ||
<pre><code class="YAML">{{ object.task }}</code></pre> | ||
</div> | ||
|
||
{% if object.user == user %} | ||
<div class="mt-2"> | ||
<a class="btn btn-secondary btn-sm mt-1 mb-1" href="{% url 'scrapingtask-update' object.id %}">Update</a> | ||
<a class="btn btn-warning btn-sm mt-1 mb-1" href="{% url 'scrapingtask-testrun' object.id %}">Test</a> | ||
<a class="btn btn-danger btn-sm mt-1 mb-1" href="{% url 'scrapingtask-delete' object.id %}">Delete</a> | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
|
||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% extends 'scraper/base.html' %} | ||
{% load crispy_forms_tags %} | ||
|
||
{% block content %} | ||
|
||
<div class="entry-section"> | ||
<form method="POST"> | ||
{% csrf_token %} | ||
<fieldset class="form-group"> | ||
<legend class="border-bottom mb-4">Scraping Task</legend> | ||
{{ form|crispy }} | ||
</fieldset> | ||
<div class="form-group"> | ||
<button class="btn btn-outline-info" type="submit">Save</button> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{% extends 'scraper/base.html' %} | ||
|
||
{% block content %} | ||
|
||
{% for task in object_list %} | ||
<div class="entry-section"> | ||
<div class="entry-header"> | ||
<h5 class="entry-title"> | ||
<a href="{% url 'scrapingtask-detail' pk=task.id %}"> | ||
{{ task.title }} | ||
</a> | ||
</a> | ||
</h5> | ||
|
||
</div> | ||
|
||
<div class="entry-content"> | ||
<pre><code class="YAML">{{ task.task }}</code></pre> | ||
</div> | ||
|
||
</div> | ||
{% endfor %} | ||
|
||
{% if is_paginated %} | ||
|
||
{% if page_obj.has_previous %} | ||
<a class="btn btn-outline-info mb-4" href="?page=1">First</a> | ||
<a class="btn btn-outline-info mb-4" href="?page={{ page_obj.previous_page_number }}">Previous</a> | ||
{% endif %} | ||
|
||
{% for num in page_obj.paginator.page_range %} | ||
{% if page_obj.number == num %} | ||
<a class="btn btn-info mb-4" href="?page={{ num }}">{{ num }}</a> | ||
{% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %} | ||
<a class="btn btn-outline-info mb-4" href="?page={{ num }}">{{ num }}</a> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if page_obj.has_next %} | ||
<a class="btn btn-outline-info mb-4" href="?page={{ page_obj.next_page_number }}">Next</a> | ||
<a class="btn btn-outline-info mb-4" href="?page={{ page_obj.paginator.num_pages }}">Last</a> | ||
{% endif %} | ||
|
||
{% endif %} | ||
|
||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters