diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-06-13 12:45:39 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-06-13 12:45:39 -0700 |
commit | a8b440f404da7ccd52329a7d69b0982b1736e2bf (patch) | |
tree | 65e0a9453894f3fda8b975d426a43276ab94580a /python/fatcat_web/templates/edit_macros.html | |
parent | 6a14c4be59794e6fedcd5874e09407cecf76cfdf (diff) | |
download | fatcat-a8b440f404da7ccd52329a7d69b0982b1736e2bf.tar.gz fatcat-a8b440f404da7ccd52329a7d69b0982b1736e2bf.zip |
editgroup selection as drop-down
Diffstat (limited to 'python/fatcat_web/templates/edit_macros.html')
-rw-r--r-- | python/fatcat_web/templates/edit_macros.html | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html index 66da04e7..a207e51e 100644 --- a/python/fatcat_web/templates/edit_macros.html +++ b/python/fatcat_web/templates/edit_macros.html @@ -35,22 +35,38 @@ </div> {%- endmacro %} -{% macro editgroup_dropdown(form, editgroup=None) -%} - <div class="ui accordion"> - <div class="{% if not editgroup %}active{% endif %} title"> - <h3><i class="dropdown icon"></i>Editgroup Meta</h3> - </div> - <div class="{% if not editgroup %}active{% endif %} content"> - {% if editgroup %} - <p>You have an editgroup in progress, and this edit will be included by - default. You can override this below. - {% else %} - <p>No existing editgroup is in progress (or at least, not is selected). - An existing ID can be pasted in, or if you leave that blank but give a - description, a new editgroup will be created for this edit. - {% endif %} - {{ form_field_inline(form.editgroup_id) }} +{% macro editgroup_dropdown(form, editgroup=None, potential_editgroups=None) -%} + {% if editgroup %} + <p>You are updating an existing un-merged editgroup: <a href="/editgroup/{{ editgroup.editgroup_id}}">{{ editgroup.editgroup_id }}</a>. + <p><b>Description:</b> {{ editgroup.description }} + {% else %} + {% if not potential_editgroups %} + <p>You have no un-submitted editgroups in progress; a new one will be + created. You can add a description for the whole group of edits: {{ form_field_inline(form.editgroup_description) }} - </div> - </div> + {% else %} + <p>Select an in-progress editgroup for this change to be part of (or start a new one): + + <div class="ui fluid selection dropdown"> + <input type="hidden" id="editgroup_id" name="editgroup_id" value="{{ form.editgroup_id.data }}"> + <i class="dropdown icon"></i> + <div class="default text">Select Editgroup</div> + <div class="menu"> + {% for peg in potential_editgroups %} + <div class="item" data-value="{{ peg.editgroup_id }}"> + <div class="right floated">{{ peg.created }}</div> + <code><b>editgroup_{{ peg.editgroup_id }}</b></code> + {% if peg.description %} + <br>{{ peg.description[:200] }} + {% endif %} + </div> + {% endfor %} + <div class="item" data-value=""><b>Start New Editgroup</b></div> + </div> + </div> + + <p>If starting a new editgroup, you can add a description for the whole group: + {{ form_field_inline(form.editgroup_description) }} + {% endif %} + {% endif %} {%- endmacro %} |