aboutsummaryrefslogtreecommitdiffstats
path: root/lib/srtgui/templates/report.html
blob: 4c2b24502b1d0fbcdb162ed4b75150598e4faa6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{% extends "base.html" %}

{% load static %}
{% load projecttags %}
{% load humanize %}

{% block title %} Report/Export {% endblock %}

{% block pagecontent %}
  <div class="row">
		<div class="col-md-7" style="padding-left: 50px;">
		  <h1>Report/Export: {{title}}</h1>
		</div>
  </div>

  <form method="POST"> {% csrf_token %}
    <input type="hidden" name="parent_page" value="{{parent_page}}">
    <input type="hidden" name="record_list" value="{{record_list}}">

	{% if error_message %}
	<br>
	<font size="3" color="red">{{error_message}}</font>
	<br>
	{% endif %}

	{% if report_type_list %}
	    <hr>
		Report Type:<br>
		<select name="report_type">
		{{report_type_list|safe}}
		</select>
	{% else %}
	    <hr>
		Note: There is no report defined for this page.<br>
	{% endif %}

	{% if report_get_title %}
    <hr>
    Title:<br>
    <input type="text" name="title">
    <br>
	{% endif %}
    <hr>

	{% if report_recordrange_list %}
	Record Range:<br>
	{{report_recordrange_list|safe}}
	<br>
	{% endif %}
	{% if report_columnrange_list %}
	Column Range:<br>
	{{report_columnrange_list|safe}}
	{% endif %}
    <hr>

	{% if report_format_list %}
    Export Format:<br>
	{{report_format_list|safe}}
    <hr>
	{% endif %}

	{% if report_date_list %}
    Date Range (mm/dd/yyyy):<br>
	{{report_date_list|safe}}
    <hr>
	{% endif %}

	{% if report_custom_list %}
    Page Specific Settings:<br>
	{{report_custom_list|safe}}
    <hr>
	{% endif %}

	{% if report_enable_submit %}
	  <input type="submit" id="submit-report-button" class="btn btn-primary btn-lg" value="Generate and Download Report"/>
	  <a class="btn btn-info btn-lg" id="report-done" href="{% url 'landing' %}">Done</a>
	{% else %}
	  <a class="btn btn-info btn-lg" id="report-cancel" href="{% url 'landing' %}">Cancel</a>
	{% endif %}

  </form>

  <br>
  <!--	  <input type="submit" id="submit-report-button" class="btn btn-primary btn-lg" value="Generate and Download Report"/> -->
  <!--  <button type="button" id="submit-report-button" class="btn btn-primary btn-lg"> Generate and Download Report </button> -->
  <!--    <button id="select-these" class="btn btn-default" type="button">Select these</button> -->

  <!-- Javascript support -->
  <script>

  $(document).ready(function() {

	/* Handle the post button */
    $('#test-submit-report-button').click(function(){
        document.getElementById("submit-report-button").innerText = " ... working ... ";
        data = {
      	"action"  : 'foo',
      	"pub"     : $('#bar').is(':checked') ? "yes" : "no",
      	}

	    $.post("wr/report/management", data, function(data, status){
		  alert("Data: " + data + "\nStatus: " + status);
	    });
	});

  });
  </script>

{% endblock %}