IDDRS/templates/App/tfidf.html

204 lines
8.2 KiB
HTML
Raw Normal View History

2022-07-25 10:03:35 +00:00
{% extends "App/base.html" %}
2022-06-17 12:06:51 +00:00
{% load app_filters %}
{% load static %}
{% block page_content %}
<div class="row justify-content-center">
<div class="col-lg-8">
<form class="d-flex align-items-center" id="searchForm" method="get">
2022-06-27 13:48:56 +00:00
<input type="text" class="form-control" name="phrase" placeholder="Seach IDDRS ..."
aria-label="Seach IDDRS ..." aria-describedby="basic-addon1">
2022-06-17 12:06:51 +00:00
<button id="submitSearch" type="submit" class="btn-default">Search</button>
</form>
</div>
</div>
2022-07-25 10:03:35 +00:00
{% if 'phrase' in request.get_full_path or 'searchedPhrase' in request.get_full_path %}
2022-06-17 12:06:51 +00:00
<form id="fiterForm" method="get">
2022-07-25 10:03:35 +00:00
<div class="d-flex justify-content-between mt-3">
2022-06-17 12:06:51 +00:00
{% for level in levels %}
<div class="btn-group ">
<button class="level-{{ level.levelNumber }} btn btn-sm dropdown-toggle " type="button"
data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
{{ level.levelName }}
</button>
<div class="dropdown-menu dropdown-menu-end dropdown-menu-lg-start">
{% for standard in standards %}
{% if standard.standardLevel == level.levelNumber %}
<div class="form-check">
2022-06-27 13:48:56 +00:00
<input class="form-check-input" name="title" type="checkbox" value="{{ standard.standardTitle }}"
{% if standard.standardTitle in selectedChoices %} checked {% endif %}
2022-06-17 12:06:51 +00:00
id="checkbox{{ standard.id }}">
<label class="form-check-label" for="checkbox{{ standard.id }}">
2022-06-27 13:48:56 +00:00
{{ standard.stamdardNumber }} {{ standard.standardTitle }}
2022-06-17 12:06:51 +00:00
</label>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
2022-06-27 13:48:56 +00:00
<input type="text" class="form-control" name="searchedPhrase" value="{{phrase}}" hidden>
2022-07-25 10:03:35 +00:00
<div class="mt-3">
{% if selectedChoices %}
<h5>The following filter/s are applied: <a class="text-dark" id="filterBtn" href="#filterCollapse"
data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="filterCollapse"><i
class="fa fa-arrow-down" aria-hidden="true"></i></a> <a id="clear" class="clear">Clear all filters</a></h5>
<div class="ps-5 collapse" id="filterCollapse">
{% for choice in selectedChoices %}
<h6 class="text-secondary">{{choice}}</h6>
{% endfor %}
</div>
{% endif %}
</div>
2022-06-17 12:06:51 +00:00
</form>
2022-06-27 13:48:56 +00:00
2022-07-25 10:03:35 +00:00
<div class="results-container mt-5">
<div class="d-flex justify-content-between">
<div></div>
<div id="phrase">
{% if results %}
<h3 class="text-center">{{ phrase }}</h3>
{% endif %}
</div>
<div class="functions-menu" id="control">
{% with 'usersResults/'|add:excelFile as filePath %}
<a class="me-3" href="{% static filePath %}" title="Export to Excel"><i class="fa fa-save "></i></a>
{% endwith %}
<a class="me-3" data-bs-toggle="modal" data-bs-target="#linkShare" title="Share results"><i class="fa fa-share"></i></a>
{% with 'usersResults/'|add:pdfFile as filePath %}
<a class="me-3" href="{% static filePath %}" target="_blank" title="Print PDF"><i class="fa fa-print"></i></a>
{% endwith %}
</div>
</div>
2022-06-27 13:48:56 +00:00
2022-06-17 12:06:51 +00:00
{% for result in results %}
<div class="card" data-bs-toggle="modal" data-bs-target="#staticBackdrop{{result.index}}">
<div class="card-header card-header-test1 level-text-{{ result.level|make_list|first }}">
2022-06-27 13:48:56 +00:00
Level {{ result.level|make_list|first }}, IDDRS {{result.module}}, <span class="float-end"> Page
{{result.pageNumber}} </span>
2022-06-17 12:06:51 +00:00
</div>
<div class="card-body">
<h5 class="card-title">
{{result.heading1}}
</h5>
<p class="card-text">
{{result.paragraph | truncatewords:50}}
</p>
</div>
</div>
{% endfor %}
</div>
2022-07-25 10:03:35 +00:00
{% endif %}
2022-06-27 13:48:56 +00:00
2022-06-17 12:06:51 +00:00
{% if results %}
<nav aria-label="Page navigation example">
<ul class="pagination">
2022-06-27 13:48:56 +00:00
{% for i in pages.page_range %}
{% if 'title' in request.get_full_path or 'phrase' in request.get_full_path or 'searchedPhrase' in request.get_full_path %}
<li class="page-item {% if i == pNumber %} active {% endif %}"><a class="page-link"
href="{{ request.get_full_path }}&page={{ i }}">{{ i }}</a></li>
{% else %}
2022-07-25 10:03:35 +00:00
<li class="page-item {% if i == pNumber %} active {% endif %}"><a class="page-link" href="?page={{ i }}">{{ i }}</a></li>
2022-06-27 13:48:56 +00:00
{% endif %}
2022-06-17 12:06:51 +00:00
{% endfor %}
</ul>
</nav>
{% endif %}
2022-06-27 13:48:56 +00:00
<div class="d-flex justify-content-between mt-5">
2022-07-25 10:03:35 +00:00
<div class="border p-2 fq">
2022-06-27 13:48:56 +00:00
<h4 class="text-decoration-underline">Featured Questions About IDDRS Framework</h4>
<ul>
2022-07-25 10:03:35 +00:00
<li class="mb-4 mt-4">
2022-06-27 13:48:56 +00:00
<div class="fw-bold">Featured Questions About IDDRS Framework</div>
</li>
2022-07-25 10:03:35 +00:00
<li class="mb-4">
2022-06-27 13:48:56 +00:00
<div class="fw-bold">Featured Questions About IDDRS Framework</div>
</li>
2022-07-25 10:03:35 +00:00
<li class="mb-4">
2022-06-27 13:48:56 +00:00
<div class="fw-bold">Featured Questions About IDDRS Framework</div>
</li>
2022-07-25 10:03:35 +00:00
<li class="mb-4">
2022-06-27 13:48:56 +00:00
<div class="fw-bold">Featured Questions About IDDRS Framework</div>
</li>
2022-07-25 10:03:35 +00:00
<li>
2022-06-27 13:48:56 +00:00
<div class="fw-bold">Featured Questions About IDDRS Framework</div>
</li>
2022-07-25 10:03:35 +00:00
2022-06-27 13:48:56 +00:00
</ul>
</div>
2022-07-25 10:03:35 +00:00
<div class="border" style="width: 50%; height:400px">
2022-06-27 13:48:56 +00:00
<div id="wordCloud">
</div>
</div>
2022-06-17 12:06:51 +00:00
</div>
2022-07-25 10:03:35 +00:00
<!-- Results Modal -->
2022-06-17 12:06:51 +00:00
{% for result in results %}
2022-07-25 10:03:35 +00:00
2022-06-17 12:06:51 +00:00
<div class="modal fade" id="staticBackdrop{{result.index}}" data-bs-backdrop="static" data-bs-keyboard="false"
tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<div class="" id="staticBackdropLabel{{result.index}}">
2022-07-25 10:03:35 +00:00
<p class="modal-level level-text-{{ result.level|make_list|first }}">Level {{result.level}} {{result.levelName }}</p>
2022-06-27 13:48:56 +00:00
<p class="modal-module">IDDRS {{result.module}}</p>
2022-06-17 12:06:51 +00:00
<p class="modal-heading">{{result.heading1}}</p>
<p class="modal-heading modal-heading-2">{{result.heading2}}</p>
<p class="modal-heading modal-heading-3">{{result.heading3}}</p>
<p class="modal-heading modal-heading-4">{{result.heading4}}</p>
</div>
<button type="button" class="btn-close align-self-start" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div>
</div>
<div class="modal-body">
2022-06-27 13:48:56 +00:00
<p>{{ result.paragraph|highlight_search:result.sentence|safe|linebreaks }}</p>
2022-06-17 12:06:51 +00:00
<p class="text-end">Page: {{result.pageNumber}}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{% endfor %}
2022-07-25 10:03:35 +00:00
<!-- Share Modal -->
<div class="modal fade" id="linkShare" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="staticBackdropLabel">Copy link to share results</h3>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<h4 id="url">{{ request.build_absolute_uri }}</h4>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<input type="button" id ="copyURL" class="btn btn-primary" value="Copy">
</div>
</div>
</div>
</div>
2022-06-27 13:48:56 +00:00
2022-07-25 10:03:35 +00:00
{% endblock %}