UI - "Add new watch" URL at main input box should always grow to match the viewport

pull/2020/head
dgtlmoon 1 year ago
parent 684e96f5f1
commit 19e752e9ba

@ -402,8 +402,24 @@ label {
} }
#watch-add-wrapper-zone { #watch-add-wrapper-zone {
>div {
display: inline-block; @media only screen and (min-width: 760px) {
display: flex;
gap: 0.3rem;
flex-direction: row;
}
/* URL field grows always, other stay static in width */
> span {
flex-grow: 0;
input {
width: 100%;
padding-right: 1em;
}
&:first-child {
flex-grow: 1;
}
} }
@media only screen and (max-width: 760px) { @media only screen and (max-width: 760px) {

@ -683,11 +683,23 @@ label:hover {
#new-watch-form legend { #new-watch-form legend {
color: var(--color-text-legend); color: var(--color-text-legend);
font-weight: bold; } font-weight: bold; }
#new-watch-form #watch-add-wrapper-zone > div { #new-watch-form #watch-add-wrapper-zone {
display: inline-block; } /* URL field grows always, other stay static in width */ }
@media only screen and (max-width: 760px) { @media only screen and (min-width: 760px) {
#new-watch-form #watch-add-wrapper-zone #url { #new-watch-form #watch-add-wrapper-zone {
width: 100%; } } display: flex;
gap: 0.3rem;
flex-direction: row; } }
#new-watch-form #watch-add-wrapper-zone > span {
flex-grow: 0; }
#new-watch-form #watch-add-wrapper-zone > span input {
width: 100%;
padding-right: 1em; }
#new-watch-form #watch-add-wrapper-zone > span:first-child {
flex-grow: 1; }
@media only screen and (max-width: 760px) {
#new-watch-form #watch-add-wrapper-zone #url {
width: 100%; } }
#diff-col { #diff-col {
padding-left: 40px; } padding-left: 40px; }

@ -39,6 +39,24 @@
{% endmacro %} {% endmacro %}
{% macro render_nolabel_field(field) %}
<span>
{{ field(**kwargs)|safe }}
{% if field.errors %}
<span class="error">
{% if field.errors %}
<ul class=errors>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</span>
{% endif %}
</span>
{% endmacro %}
{% macro render_button(field) %} {% macro render_button(field) %}
{{ field(**kwargs)|safe }} {{ field(**kwargs)|safe }}
{% endmacro %} {% endmacro %}

@ -1,6 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block content %} {% block content %}
{% from '_helpers.jinja' import render_simple_field, render_field %} {% from '_helpers.jinja' import render_simple_field, render_field, render_nolabel_field %}
<script src="{{url_for('static_content', group='js', filename='jquery-3.6.0.min.js')}}"></script> <script src="{{url_for('static_content', group='js', filename='jquery-3.6.0.min.js')}}"></script>
<script src="{{url_for('static_content', group='js', filename='watch-overview.js')}}" defer></script> <script src="{{url_for('static_content', group='js', filename='watch-overview.js')}}" defer></script>
@ -11,14 +11,11 @@
<fieldset> <fieldset>
<legend>Add a new change detection watch</legend> <legend>Add a new change detection watch</legend>
<div id="watch-add-wrapper-zone"> <div id="watch-add-wrapper-zone">
<div>
{{ render_simple_field(form.url, placeholder="https://...", required=true) }} {{ render_nolabel_field(form.url, placeholder="https://...", required=true) }}
{{ render_simple_field(form.tags, value=tags[active_tag].title if active_tag else '', placeholder="watch label / tag") }} {{ render_nolabel_field(form.tags, value=tags[active_tag].title if active_tag else '', placeholder="watch label / tag") }}
</div> {{ render_nolabel_field(form.watch_submit_button, title="Watch this URL!" ) }}
<div> {{ render_nolabel_field(form.edit_and_watch_submit_button, title="Edit first then Watch") }}
{{ render_simple_field(form.watch_submit_button, title="Watch this URL!" ) }}
{{ render_simple_field(form.edit_and_watch_submit_button, title="Edit first then Watch") }}
</div>
</div> </div>
<div id="quick-watch-processor-type"> <div id="quick-watch-processor-type">
{{ render_simple_field(form.processor, title="Edit first then Watch") }} {{ render_simple_field(form.processor, title="Edit first then Watch") }}

Loading…
Cancel
Save