Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/eoglethorpe/deep into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
bibekdahal committed Jun 14, 2017
2 parents baa4bfb + 8154ba2 commit 19b2254
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 83 deletions.
140 changes: 70 additions & 70 deletions entries/templates/entries/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,41 @@
<script type="text/javascript" src="{% watchful_static_url 'js/entries/export.js' %}"></script>

<script>
var eventId = "{{ event.pk }}";
var exportProgressUrl = "{% url 'export_progress' %}";
var downloadUrl = "{% url 'download_file' %}";

var pillars = [
{% for pillar in pillars %}
{
id: "{{ pillar.pk }}",
name: "{{ pillar.name|escapejs }}",
contains_sectors: {% if pillar.contains_sectors %}true{% else %}false{% endif %},

subpillars: [
{% for subpillar in pillar.informationsubpillar_set.all %}
{ id: "{{ subpillar.pk }}", name: "{{ subpillar.name|escapejs }}", },
{% endfor %}
],
},
{% endfor %}
];

var sectors = [
{% for sector in sectors %}
{
id: "{{ sector.pk }}",
name: "{{ sector.name|escapejs }}",
{% comment %}
subsectors: [
{% for subsector in sector.subsector_set.all %}
{ id: "{{ subsector.pk }}", name: "{{ subsector.name|escapejs }}", },
{% endfor %}
],
{% endcomment %}
},
{% endfor %}
];
var eventId = "{{ event.pk }}";
var exportProgressUrl = "{% url 'export_progress' %}";
var downloadUrl = "{% url 'download_file' %}";

var pillars = [
{% for pillar in pillars %}
{
id: "{{ pillar.pk }}",
name: "{{ pillar.name|escapejs }}",
contains_sectors: {% if pillar.contains_sectors %}true{% else %}false{% endif %},

subpillars: [
{% for subpillar in pillar.informationsubpillar_set.all %}
{ id: "{{ subpillar.pk }}", name: "{{ subpillar.name|escapejs }}", },
{% endfor %}
],
},
{% endfor %}
];

var sectors = [
{% for sector in sectors %}
{
id: "{{ sector.pk }}",
name: "{{ sector.name|escapejs }}",
{% comment %}
subsectors: [
{% for subsector in sector.subsector_set.all %}
{ id: "{{ subsector.pk }}", name: "{{ subsector.name|escapejs }}", },
{% endfor %}
],
{% endcomment %}
},
{% endfor %}
];
</script>

{% endblock %}
Expand Down Expand Up @@ -88,7 +88,7 @@
</div>
</div>
</header>

<div id="filter-section">
<h4>Filters</h4>
<div class="filters">
Expand All @@ -112,10 +112,10 @@ <h5>Leads published date order</h5>
</div>

</div>

<div id="structure-section">
<h4>Report Structure</h4>

<input id="list-order" name="list-order" value="" type="hidden">
<div class="check-group-list">
</div>
Expand All @@ -127,45 +127,45 @@ <h4>Report Structure</h4>
<input class="group-order" type="hidden">
</div>
</div>

</form>
</div>
</section>
<!--
<section>
<h2>Assessment Registry</h2>
<div class="content">
<button class="btn-excel export-button" data-url="{% url 'leads:exportsosxls' event=event.pk %}"><i class="fa fa-file-excel-o"></i>Export xlsx</button>
<button class="btn-json export-button" data-url="{% url 'api_leads:sos' %}?event={{event.pk}}&file=1"><i class="fa fa-file-text-o"></i>Export json</button>
</div>
</section>
<section>
<h2>Weekly snapshot</h2>
<div class="content">
<button class="btn-excel export-button" data-url="{% url 'entries:exportxls_weekly' event=event.pk %}"><i class="fa fa-file-excel-o"></i>Export xlsx</button>
<button class="btn-json export-button" data-url="{% url 'api_report:reports' %}?event={{event.pk}}&file=1"><i class="fa fa-file-text-o"></i>Export json</button>
</div>
</section>
-->
<h2>Assessment Registry</h2>
<div class="content">
<button class="btn-excel export-button" data-url="{% url 'leads:exportsosxls' event=event.pk %}"><i class="fa fa-file-excel-o"></i>Export xlsx</button>
<button class="btn-json export-button" data-url="{% url 'api_leads:sos' %}?event={{event.pk}}&file=1"><i class="fa fa-file-text-o"></i>Export json</button>
</div>
</section>
<section>
<h2>Weekly snapshot</h2>
<div class="content">
<button class="btn-excel export-button" data-url="{% url 'entries:exportxls_weekly' event=event.pk %}"><i class="fa fa-file-excel-o"></i>Export xlsx</button>
<button class="btn-json export-button" data-url="{% url 'api_report:reports' %}?event={{event.pk}}&file=1"><i class="fa fa-file-text-o"></i>Export json</button>
</div>
</section>
-->
</main>

<div class="modal-container" hidden>
<div id="date-range-input" class="modal" hidden>
<header>
<h3 class="modal-title">Enter date range</h3>
</header>
<div class="input-container">
<label>start date:</label>
<input type="date" id="start-date" class="form-control">
</div>
<div class="input-container">
<label>end date:</label>
<input type="date" id="end-date" class="form-control">
</div>
<div class="action-buttons">
<button id="cancel-btn" class="cancel" data-action="dismiss"><i class="fa fa-times"></i>Cancel</button>
<button id="ok-btn" class="success" data-action="proceed"><i class="fa fa-check"></i>Ok</button>
<div id="date-range-input" class="modal" hidden>
<header>
<h3 class="modal-title">Enter date range</h3>
</header>
<div class="input-container">
<label>start date:</label>
<input type="date" id="start-date" class="form-control">
</div>
<div class="input-container">
<label>end date:</label>
<input type="date" id="end-date" class="form-control">
</div>
<div class="action-buttons">
<button id="cancel-btn" class="cancel" data-action="dismiss"><i class="fa fa-times"></i>Cancel</button>
<button id="ok-btn" class="success" data-action="proceed"><i class="fa fa-check"></i>Ok</button>
</div>
</div>
</div>

{% endblock %}
{% endblock %}
32 changes: 24 additions & 8 deletions leads/templates/leads/sos.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% block head %}
<script>
var currentEvent = {{event.pk}};
var currentEvent = {{event.pk}};
</script>
<link href="{% watchful_static_url 'css/sos.css' %}" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{% watchful_static_url 'css/datatables.min.css' %}"/>
Expand All @@ -17,11 +17,27 @@
<script type="text/javascript" src="{% watchful_static_url 'js/common/selectize.js' %}"></script>
<script type="text/javascript" src="{% watchful_static_url 'js/common/utils.js' %}"></script>
<script type="text/javascript" src="{% watchful_static_url 'js/sos/sos.js' %}"></script>

<script>
var exportProgressUrl = "{% url 'export_progress' %}";

$(document).ready(function() {
$('.export-button').click(function() {
window.open(exportProgressUrl + '?url=' + encodeURIComponent(window.location.origin + $(this).data('url')), '_blank');
});
});
</script>
{% endblock %}

{% block body %}
{% include 'navbar.html' %}

<header>
<h1>Assessment Registry</h1>
<div class="content">
<button class="btn-excel export-button" data-url="{% url 'leads:exportsosxls' event=event.pk %}"><i class="fa fa-file-excel-o"></i>Export xlsx</button>
<button class="btn-json export-button" data-url="{% url 'api_leads:sos' %}?event={{event.pk}}&file=1"><i class="fa fa-file-text-o"></i>Export json</button>
</div>
</header>
<main>
<table id="sos-table" cellspacing="0" width="100%">
<thead>
Expand All @@ -40,10 +56,10 @@
</tr>
</thead>
</table>
<main>
<main>

<form id="delete-form" method="post" action="{% url 'leads:delete_sos' event=event.pk %}" hidden>
{% csrf_token %}
<input id="delete-id" name="id" type="text">
</form>
{% endblock %}
<form id="delete-form" method="post" action="{% url 'leads:delete_sos' event=event.pk %}" hidden>
{% csrf_token %}
<input id="delete-id" name="id" type="text">
</form>
{% endblock %}
17 changes: 15 additions & 2 deletions report/templates/report/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,28 @@
{% endfor %}
};

var exportProgressUrl = "{% url 'export_progress' %}";

$(document).ready(function() {
$('.export-button').click(function() {
window.open(exportProgressUrl + '?url=' + encodeURIComponent(window.location.origin + $(this).data('url')), '_blank');
});
});
</script>
{% endblock %}

{% block body %}
{% include 'navbar.html' %}
<main>
<header>
<h1>Report Dashboard</h1>
<span class="loader"></span>
<div>
<h1>Report Dashboard</h1>
<span class="loader"></span>
</div>
<div class="content">
<button class="btn-excel export-button" data-url="{% url 'entries:exportxls_weekly' event=event.pk %}"><i class="fa fa-file-excel-o"></i>Export xlsx</button>
<button class="btn-json export-button" data-url="{% url 'api_report:reports' %}?event={{event.pk}}&file=1"><i class="fa fa-file-text-o"></i>Export json</button>
</div>
</header>
<section id="country-panel">
<div id="country-panel-header">
Expand Down
14 changes: 13 additions & 1 deletion static/css/report-dash.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion static/css/sos.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions stylesheets/report/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ main{
display: flex;
align-items: center;
padding: 0 16px;
padding-right: 0;
justify-content: space-between;

button {
padding: 6px 10px;
@include btn-shadow-sm;

.fa {
margin-right: 8px;
}
&.btn-excel {
background-color: #1f7244;
color: #fff;
}
}

h1{
margin: 0;
Expand All @@ -19,6 +34,7 @@ main{
.loader {
margin-left: 16px;
}

}

.loader{
Expand Down
35 changes: 34 additions & 1 deletion stylesheets/sos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,41 @@ body{
.dataTables_filter{
margin-bottom: 8px;
}
button {
padding: 6px 10px;
@include btn-shadow-sm;

.fa {
margin-right: 8px;
}
&.btn-word {
background-color: #295497;
color: #fff;
}
&.btn-pdf {
background-color: #c11e07;
color: #fff;
}
&.btn-excel {
background-color: #1f7244;
color: #fff;
}
}
header{
display: flex;
justify-content: space-between;
align-items: center;

h1{
font-weight: $font-weight-bold;
padding: 0 12px;
text-transform: uppercase;
}
>div{
margin-right: 12px;
}
}
main{
margin-top: 16px;
padding: 10px 16px;

input[type="search"]{
Expand Down

0 comments on commit 19b2254

Please sign in to comment.