index.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. {% extends "layout.html" %}
  2. {% set title ='BIBFRAME ScriptShifter' %}
  3. {% block body %}
  4. <style>
  5. body{
  6. font-family: Avenir,Helvetica,Arial,sans-serif;
  7. }
  8. textarea{
  9. width: 99%;
  10. height: 15vh;
  11. padding: 0.5em;
  12. }
  13. fieldset.float-left {
  14. margin-right: 2rem;
  15. }
  16. #results{
  17. font-size: 1.25em;
  18. background-color: whitesmoke;
  19. margin-top: 1em;
  20. padding: 1em;
  21. }
  22. #feedback_cont {
  23. margin: 4em;
  24. padding: 4em;
  25. background-color: whitesmoke;
  26. }
  27. pre.warnings{
  28. border-left: 0.3rem solid #FF5722 !important;
  29. }
  30. .hidden {
  31. display: none !important;
  32. }
  33. p.input_descr {
  34. font-size: 80%;
  35. font-style: italic;
  36. margin-bottom: .5rem;
  37. }
  38. .center {
  39. display: block;
  40. margin: 20px auto;
  41. }
  42. </style>
  43. <form id="transliterate" action="/trans" method="POST">
  44. <fieldset>
  45. <label for="text">Input text</label>
  46. <textarea id="text" name="text"></textarea>
  47. <label for="lang">Language</label>
  48. <select id="lang" name="lang">
  49. {% for k, v in languages.items() %}
  50. <option value="{{ k }}">{{ v["name"] }}</option>
  51. {% endfor %}
  52. </select>
  53. </fieldset>
  54. <div class="clearfix">
  55. <h3>General Options</h3>
  56. <fieldset class="float-left">
  57. <legend>Direction</legend>
  58. <div>
  59. <label class="label-inline" for="s2r">Script to Roman</label>
  60. <input
  61. type="radio" id="opt_s2r" name="t_dir" value="s2r"
  62. checked>
  63. </div>
  64. <div>
  65. <label class="label-inline" for="r2s">Roman to script</label>
  66. <input
  67. type="radio" id="opt_r2s" name="t_dir" value="r2s">
  68. </div>
  69. </fieldset>
  70. <fieldset class="float-left">
  71. <legend>Capitalize</legend>
  72. <div>
  73. <label class="label-inline" for="no-change">No change</label>
  74. <input
  75. type="radio" id="no-change" name="capitalize"
  76. value="no_change" checked>
  77. </div>
  78. <div>
  79. <label class="label-inline" for="first">First word</label>
  80. <input type="radio" id="first" name="capitalize" value="first">
  81. </div>
  82. <div>
  83. <label class="label-inline" for="all">All words</label>
  84. <input type="radio" id="all" name="capitalize" value="all">
  85. </div>
  86. </fieldset>
  87. </div>
  88. <div id="options" class="clearfix"></div>
  89. <fieldset>
  90. <input class="button button-primary" type="submit" value="Transliterate!">
  91. </fieldset>
  92. {% if feedback_form %}
  93. <fieldset id="feedback_btn_cont" class="hidden">
  94. <input
  95. id="feedback_btn" class="button button-outline"
  96. value="Suggest improvements">
  97. </fieldset>
  98. {% endif %}
  99. </form>
  100. <div id="warnings-toggle" class="hidden">
  101. <pre class="warnings"><code id="warnings"></code></pre>
  102. </div>
  103. <div id="results_cont">
  104. <img id="loader_results" src="/static/loading.gif" class="hidden"/>
  105. <div id="results">Results will appear here.</div>
  106. </div>
  107. {% if feedback_form %}
  108. <div id="feedback_cont" class="hidden">
  109. <h2>Submit feedback</h2>
  110. <form
  111. id="feedback_form" action="/feedback"
  112. method="POST">
  113. <fieldset>
  114. <label class="label-inline" for="lang">Language</label>
  115. <input id="lang_fb_input" name="lang" disabled />
  116. </fieldset>
  117. <fieldset>
  118. <label class="label-inline" for="src">Input text</label>
  119. <input id="src_fb_input" name="src" disabled />
  120. </fieldset>
  121. <fieldset>
  122. <label class="label-inline" for="t_dir">Direction</label>
  123. <input id="t_dir_fb_input" name="t_dir" disabled />
  124. </fieldset>
  125. <fieldset>
  126. <label class="label-inline" for="result">Result</label>
  127. <textarea id="result_fb_input" name="result" disabled>
  128. </textarea>
  129. </fieldset>
  130. <fieldset>
  131. <label class="label-inline" for="expected">
  132. Expected result
  133. </label>
  134. <textarea
  135. id="expected_fb_input" name="expected"
  136. style="background-color: white"></textarea>
  137. </fieldset>
  138. <fieldset>
  139. <label class="label-inline" for="contact">Contact</label>
  140. <input id="contact_fb_input" name="contact" />
  141. </fieldset>
  142. <fieldset>
  143. <label class="label-inline" for="notes">Notes</label>
  144. <textarea id="notes_fb_input" name="notes"></textarea>
  145. </fieldset>
  146. <input type="hidden" id="options_fb_input" name="options" />
  147. <fieldset>
  148. </fieldset>
  149. <button type="submit" class="button button-primary">
  150. Submit
  151. </button>
  152. <button
  153. id="cancel_fb_btn"
  154. class="button button-clear">Cancel</button>
  155. </form>
  156. </div>
  157. {% endif %}
  158. <script type="text/javascript" src="/static/ss.js"></script>
  159. {% endblock %}