Skip to content

Commit

Permalink
UI - Fix mobile styling inconsistencies and resolve diff page overflo…
Browse files Browse the repository at this point in the history
…w issue (#2716)
  • Loading branch information
ojigs authored Oct 21, 2024
1 parent c1dd681 commit b0ff9d1
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 11 deletions.
4 changes: 2 additions & 2 deletions changedetectionio/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ class processor_text_json_diff_form(commonSettingsForm):
text_should_not_be_present = StringListField('Block change-detection while text matches', [validators.Optional(), ValidateListRegex()])
webdriver_js_execute_code = TextAreaField('Execute JavaScript before change detection', render_kw={"rows": "5"}, validators=[validators.Optional()])

save_button = SubmitField('Save', render_kw={"class": "pure-button pure-button-primary"})
save_button = SubmitField('Save', render_kw={"class": "pure-button button-small pure-button-primary"})

proxy = RadioField('Proxy')
filter_failure_notification_send = BooleanField(
Expand Down Expand Up @@ -616,7 +616,7 @@ def __init__(self, formdata=None, obj=None, prefix="", data=None, meta=None, **k

requests = FormField(globalSettingsRequestForm)
application = FormField(globalSettingsApplicationForm)
save_button = SubmitField('Save', render_kw={"class": "pure-button pure-button-primary"})
save_button = SubmitField('Save', render_kw={"class": "pure-button button-small pure-button-primary"})


class extractDataForm(Form):
Expand Down
16 changes: 14 additions & 2 deletions changedetectionio/static/styles/diff.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ html[data-darkmode="true"] {
border: 1px solid transparent;
vertical-align: top;
font: 1em monospace;
text-align: left; }
text-align: left;
overflow: clip; }
#diff-ui pre {
white-space: pre-wrap; }

Expand All @@ -172,7 +173,9 @@ ins {
text-decoration: none; }

#result {
white-space: pre-wrap; }
white-space: pre-wrap;
word-break: break-word;
overflow-wrap: break-word; }

#settings {
background: rgba(0, 0, 0, 0.05);
Expand Down Expand Up @@ -231,3 +234,12 @@ td#diff-col div {
border-radius: 5px;
background: var(--color-background);
box-shadow: 1px 1px 4px var(--color-shadow-jump); }

.pure-form button.reset-margin {
margin: 0px; }

.diff-fieldset {
display: flex;
align-items: center;
gap: 4px;
flex-wrap: wrap; }
15 changes: 15 additions & 0 deletions changedetectionio/static/styles/scss/diff.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
vertical-align: top;
font: 1em monospace;
text-align: left;
overflow: clip; // clip overflowing contents to cell boundariess
}

pre {
Expand All @@ -50,6 +51,8 @@ ins {

#result {
white-space: pre-wrap;
word-break: break-word;
overflow-wrap: break-word;

.change {
span {}
Expand Down Expand Up @@ -134,3 +137,15 @@ td#diff-col div {
background: var(--color-background);
box-shadow: 1px 1px 4px var(--color-shadow-jump);
}

// resets button margin to 0px
.pure-form button.reset-margin {
margin: 0px;
}

.diff-fieldset {
display: flex;
align-items: center;
gap: 4px;
flex-wrap: wrap;
}
17 changes: 16 additions & 1 deletion changedetectionio/static/styles/scss/parts/_extra_browsers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,22 @@ ul#requests-extra_browsers {
/* each proxy entry is a `table` */
table {
tr {
display: inline;
display: table-row; // default display for small screens
input[type=text] {
width: 100%;
}
}
}

// apply inline display for larger screens
@media only screen and (min-width: 1280px) {
table {
tr {
display: inline;
input[type=text] {
width: 100%;
}
}
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion changedetectionio/static/styles/scss/parts/_extra_proxies.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ ul#requests-extra_proxies {
/* each proxy entry is a `table` */
table {
tr {
display: inline;
display: table-row; // default display for small screens
input[type=text] {
width: 100%;
}
}
}

// apply inline display for large screens
@media only screen and (min-width: 1024px) {
table {
tr {
display: inline;
}
}
}
}
Expand Down
16 changes: 14 additions & 2 deletions changedetectionio/static/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ ul#requests-extra_proxies {
ul#requests-extra_proxies li > label {
display: none; }
ul#requests-extra_proxies table tr {
display: inline; }
display: table-row; }
ul#requests-extra_proxies table tr input[type=text] {
width: 100%; }
@media only screen and (min-width: 1024px) {
ul#requests-extra_proxies table tr {
display: inline; } }

#request {
/* Auto proxy scan/checker */ }
Expand Down Expand Up @@ -161,7 +166,14 @@ ul#requests-extra_browsers {
ul#requests-extra_browsers li > label {
display: none; }
ul#requests-extra_browsers table tr {
display: inline; }
display: table-row; }
ul#requests-extra_browsers table tr input[type=text] {
width: 100%; }
@media only screen and (min-width: 1280px) {
ul#requests-extra_browsers table tr {
display: inline; }
ul#requests-extra_browsers table tr input[type=text] {
width: 100%; } }

#extra-browsers-setting {
border: 1px solid var(--color-grey-800);
Expand Down
4 changes: 2 additions & 2 deletions changedetectionio/templates/diff.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<div id="settings">
<form class="pure-form " action="" method="GET" id="diff-form">
<fieldset>
<fieldset class="diff-fieldset">
{% if versions|length >= 1 %}
<strong>Compare</strong>
<del class="change"><span>from</span></del>
Expand All @@ -33,7 +33,7 @@
</option>
{% endfor %}
</select>
<button type="submit" class="pure-button pure-button-primary">Go</button>
<button type="submit" class="pure-button pure-button-primary reset-margin">Go</button>
{% endif %}
</fieldset>
<fieldset>
Expand Down
2 changes: 1 addition & 1 deletion changedetectionio/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ <h4>Chrome Extension</h4>
<div class="pure-control-group">
{{ render_button(form.save_button) }}
<a href="{{url_for('index')}}" class="pure-button button-small button-cancel">Back</a>
<a href="{{url_for('clear_all_history')}}" class="pure-button button-small button-cancel">Clear Snapshot History</a>
<a href="{{url_for('clear_all_history')}}" class="pure-button button-small button-error">Clear Snapshot History</a>
</div>
</div>
</form>
Expand Down

0 comments on commit b0ff9d1

Please sign in to comment.