simple-web-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

submit.html (1816B)


      1 <div class="submit-page">
      2   <h2>Submit</h2>
      3 
      4   {% match error %}
      5   {% when Some with (err) %}
      6   <div class="error-message">{{ err }}</div>
      7   {% when None %}
      8   {% endmatch %}
      9 
     10   <validation-enhancer>
     11   <form action="/submit" method="post" class="submit-form">
     12     <div class="form-group">
     13       <label for="title">Title</label>
     14       <input type="text" id="title" name="title" value="{{ title }}" required maxlength="200" aria-errormessage="title-error" validation-valueMissing="Title is required" />
     15       <div id="title-error" class="field-error"></div>
     16     </div>
     17 
     18     <div class="form-group">
     19       <label for="url">URL</label>
     20       <input type="text" id="url" name="url" value="{{ url }}" placeholder="https://" />
     21     </div>
     22 
     23     <div class="form-separator">
     24       <span>or</span>
     25     </div>
     26 
     27     <div class="form-group">
     28       <label for="text">Text</label>
     29       <textarea id="text" name="text" rows="6" placeholder="Leave URL blank to submit a text post">{{ text }}</textarea>
     30     </div>
     31 
     32     {% if !all_tags.is_empty() %}
     33     <div class="form-group">
     34       <label>Tags</label>
     35       <div class="tag-checkboxes">
     36         {% for tag in all_tags %}
     37         {% match tag.name %}
     38         {% when Some with (name) %}
     39         <label class="tag-checkbox">
     40           <input type="checkbox" name="tags" value="{{ tag.id }}"
     41             {% if selected_tags.contains(tag.id) %} checked{% endif %} />
     42           {{ name }}
     43         </label>
     44         {% when None %}
     45         {% endmatch %}
     46         {% endfor %}
     47       </div>
     48     </div>
     49     {% endif %}
     50 
     51     <div class="form-actions">
     52       <button type="submit">Submit</button>
     53     </div>
     54   </form>
     55   </validation-enhancer>
     56 
     57   <p class="submit-info">
     58     Leave URL blank to submit a question or discussion.
     59     The text field is optional for link submissions.
     60   </p>
     61 </div>