simple-web-app

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

edit.html (1699B)


      1 <div class="submit-page">
      2   <h2>Edit Story</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="/story/{{ story_id }}/edit" 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">{{ 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">Save Changes</button>
     53       <a href="/story/{{ story_id }}">Cancel</a>
     54     </div>
     55   </form>
     56   </validation-enhancer>
     57 </div>