upload.twig 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {#
  2. /**
  3. * Public Printer Control System
  4. *
  5. * Copyright © 2018 - 2019, Aaron Speer, aaron.speerfamily.ie ajamesspeer@gmail.com.
  6. * All Rights Reserved.
  7. */
  8. #}
  9. {% extends "templates/app.twig" %}
  10. {% block content %}
  11. <div class="page-header">
  12. <h1>File Successfully Submitted</h1>
  13. </div>
  14. {% for message in messages %}
  15. {{ makeError(message[0], message[1], message[2]) | raw }}
  16. {% endfor %}
  17. <div class="col-md-6">
  18. <div class="panel panel-warning">
  19. <div class="panel-heading">Confirm Print Preview</div>
  20. <div class="panel-body">
  21. <label>Open print preview in new tab:</label><br>
  22. <a class="btn btn-success" href="{{ link }}" target="_blank">View Print Preview</a><br><br>
  23. <div class="radio">
  24. <label><input id="ok" value="ok" type="radio" name="optradio"><span class="text-success" style="font-weight: bold;">Looks Good!</span></label>
  25. </div>
  26. <div class="radio">
  27. <label><input id="no" value="no" type="radio" name="optradio"><span class="text-danger" style="font-weight: bold;">Somethings Wrong?</span></label>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="col-md-6">
  33. <div id="print" style="display: none" class="panel panel-success">
  34. <div class="panel-heading">Success: Ready to Print</div>
  35. <div class="panel-body">
  36. <form action="/print" method="post">
  37. <div class="form-group">
  38. <label for="printer">Choose Printer:</label>
  39. <select name="printer" class="form-control" id="printer">
  40. {% for id, name in printers %}
  41. <option value="{{id}}">{{name}}</option>
  42. {% endfor %}
  43. </select>
  44. <label for="copies">Select number of copies:</label>
  45. <select name="copies" class="form-control" id="copies">
  46. <option selected="selected">1</option>
  47. <option>2</option>
  48. <option>3</option>
  49. <option>4</option>
  50. <option>5</option>
  51. <option>6</option>
  52. <option>7</option>
  53. <option>8</option>
  54. <option>9</option>
  55. <option>10</option>
  56. <option>11</option>
  57. <option>12</option>
  58. <option>13</option>
  59. <option>14</option>
  60. <option>15</option>
  61. <option>16</option>
  62. <option>17</option>
  63. <option>18</option>
  64. <option>19</option>
  65. <option>20</option>
  66. </select>
  67. <input type="hidden" name="path" value="{{path}}">
  68. <br>
  69. <input type="submit" value="Submit" class="btn btn-success">
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="col-md-6">
  76. <div id="esc" style="display: none" class="panel panel-danger">
  77. <div class="panel-heading">Failed!</div>
  78. <div class="panel-body">
  79. <p>{{instr}}</p>
  80. <a href="/" class="btn btn-danger">Return to Homepage</a>
  81. </div>
  82. </div>
  83. </div>
  84. {% endblock %}
  85. {% block js %}
  86. <script>
  87. $('input:radio[name="optradio"]').change(function(){
  88. if($(this).val() === 'ok'){
  89. document.getElementById("print").style.display = "block";
  90. document.getElementById("esc").style.display = "none";
  91. }
  92. if($(this).val() === 'no'){
  93. document.getElementById("esc").style.display = "block";
  94. document.getElementById("print").style.display = "none";
  95. }
  96. });
  97. </script>
  98. {% endblock %}