Skip to content

Commit

Permalink
feat(ui): unify input styles on different pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ozangulle committed Jan 13, 2025
1 parent 87f597d commit a8c6a64
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 47 deletions.
27 changes: 2 additions & 25 deletions resources/public/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.nav-button {
border-bottom: solid;
border-bottom-color: rgb(59 7 100);
border-bottom-color: black;
border-bottom-width: thick;
text-transform: uppercase;
}

.sub-nav-button {
border-bottom: solid;
border-bottom-color: rgb(59 7 100);
border-bottom-color: black;
border-bottom-width: thick;
text-transform: uppercase;
font-size: 0.9em;
Expand All @@ -16,26 +16,3 @@
.flex-container {
display: flex;
}

/* Pagination links */
/*.pagination a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
transition: background-color .3s;
}*/

/* Style the active/current link */
/*.pagination a.active {
background-color: dodgerblue;
color: white;
}*/

/* Add a grey background color on mouse-over */
/*.pagination a:hover:not(.active) {background-color: #ddd;}
.html-email {
width: 100%;
height: 100%;
}*/
6 changes: 3 additions & 3 deletions resources/templates/admin-categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h3 class="uppercase text-lg my-8">Manage Categories</h3>
<td>
<form action="/admin/categories/{{category.id}}" id="{{category.id}}" method="DELETE">
<input name="method" type="hidden" value="DELETE">
<button class="rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">X</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit">X</button>
</form>
</td>

Expand All @@ -27,7 +27,7 @@ <h3 class="uppercase text-lg my-8">Manage Categories</h3>
</table>
<h3 class="uppercase text-lg my-8">New Category</h3>
<form action="/admin/categories" method="POST">
<input class="pr-4" name="name" value="">
<button class="rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">Add category</button></form>
<input class="mr-4 border-2 ring-1 text-gray-700 focus:text-gray-700 focus:border-gray-200 focus:ring-gray-200" name="name" value="">
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit">Add category</button></form>

{% endblock %}
4 changes: 2 additions & 2 deletions resources/templates/admin-languages.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h3 class="uppercase text-lg my-8">Language Detection</h3>

<form action="/metadata/languages" id="detect" method="post">
<input type="hidden" name="redirect-url" value="/admin/languages"</input>
<button class="rounded-none ml-3 px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit" form="detect">Detect Languages</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit" form="detect">Detect Languages</button>
</form>

<h3 class="uppercase text-lg my-8">Language Preferences</h3>
Expand All @@ -25,7 +25,7 @@ <h3 class="uppercase text-lg my-8">Language Preferences</h3>
{% for preference in language-preferences %}
<tr><td>{{preference.language}}</td><td><input {% if preference.use_in_training = 1 %}checked{% endif %} form="preferences" name="use" type="checkbox" value="{{preference.language}}"></td></tr>
{% endfor %}
<tr><th><button class="rounded-none ml-3 px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" form="preferences">Send</button></th></tr>
<tr><th><button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" form="preferences">Send</button></th></tr>
</tbody></table>

</form>
Expand Down
6 changes: 3 additions & 3 deletions resources/templates/admin-preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ <h3 class="uppercase text-lg my-10">Preferences</h3>
<input type="hidden" name="redirect-url" value="/admin/preferences"</input>
<div>
<label class="block mb-2 text-sm font-medium text-gray-900" for="language-detection-threshold">Language Detection Threshold</label>
<input class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-900 focus:border-purple-900 block p-2.5" name="language-detection-threshold" value="{{language-detection-threshold}}">
<input class="mr-4 text-gray-700 focus:text-gray-700 focus:border-gray-200 focus:ring-gray-200" name="language-detection-threshold" value="{{language-detection-threshold}}">
</div>
<div>
<label class="block mb-2 text-sm font-medium text-gray-900" for="categorization-threshold">Categorization Threshold</label>
<input class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-900 focus:border-purple-900 block p-2.5" name="categorization-threshold" value="{{categorization-threshold}}">
<input class="mr-4 text-gray-700 focus:text-gray-700 focus:border-gray-200 focus:ring-gray-200" name="categorization-threshold" value="{{categorization-threshold}}">
</div>
</div>
<button class="rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="send">Save</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium rounded-lg text-sm" type="send">Save</button>
</form>
{% endblock %}
12 changes: 6 additions & 6 deletions resources/templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ <h4 class="text-l mt-16 mb-2">Parse E-Mails</h4>
<form action="emails/parse" enctype="multipart/form-data" method="POST">
<input name="redirect-url" type="hidden" value="/admin" />
<input name="filename" type="file" />
<button class="rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">Parse Mbox</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit">Parse Mbox</button>
</form>
</div>
</div>

<h4 class="text-l mt-16 mb-2">Danger Zone</h4>
<div class="flex-container">
<div class="flex-wrap flex gap-4">
<form action="/admin/database" id="db-delete" method="DELETE">
<input name="method" type="hidden" value="DELETE" />
<button class="rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">Delete Database</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit">Delete Database</button>
</form>
<form action="/admin/database" method="POST" value="post">
<button class="rounded-none mx-3 px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">Create Database</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit">Create Database</button>
</form>
<form action="/admin/training" id="training-delete" method="DELETE">
<input name="method" type="hidden" value="DELETE" />
<button class="rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">Delete Training Data</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit">Delete Training Data</button>
</form>
<form action="/admin/models" id="models-delete" method="DELETE">
<input name="method" type="hidden" value="DELETE" />
<button class="rounded-none ml-3 px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">Delete Models</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm rounded-lg" type="submit">Delete Models</button>
</form>
</div>

Expand Down
6 changes: 3 additions & 3 deletions resources/templates/statistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ <h3 class="uppercase text-lg my-8 mx-16">Filter</h3>
<form action="{{interval-filter.url}}" method="GET">
<div class="flex flex-row justify-start content-center">
<div class="w-32 mx-16">
<select class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-900 focus:border-purple-900 block w-full p-2.5" name="interval" autocomplete="off">
<select class="block mr-4 bg-gray-50 border border-gray-200 text-gray-700 focus:bg-gray-700 focus:ring-gray-200 focus:border-gray-200 focus:text-white text-sm rounded-lg block w-full p-2.5 w-full" name="interval" autocomplete="off">
<option value="yearly" {% if interval-filter.selected-interval = yearly %}selected{% endif %}>yearly</option>
<option value="monthly" {% if interval-filter.selected-interval = monthly %}selected{% endif %}>monthly</option>
</select>
</div>
<div class="mx-4">
<select class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-900 focus:border-purple-900 block w-full p-2.5" name="year" autocomplete="off">
<select class="block mr-4 bg-gray-50 border border-gray-200 text-gray-700 focus:bg-gray-700 focus:ring-gray-200 focus:border-gray-200 focus:text-white text-sm rounded-lg block w-full p-2.5 w-full" name="year" autocomplete="off">
{% for year in interval-filter.years %}
<option {% if interval-filter.selected-year = year %}selected{% endif %} value="{{year}}">{{year}}</option>
{% endfor %}
</select>
</div>
<button class="rounded-none ml-3 px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white" type="submit">Apply</button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium text-sm" type="submit">Apply</button>
</div>
</form>

Expand Down
6 changes: 3 additions & 3 deletions resources/templates/watcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ <h3 class="uppercase text-lg my-8">Imap Watcher for {{host}} - {{user}}</h3>
<div class="flex flex-nowrap">
<form id="parse" action="/watchers/{{id}}" method="POST">
<label for="move">Move e-mails after categorization</label>
<input name="move" type="checkbox">
<select class="my-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5" name="folder">
<input class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-200 rounded focus:ring-blue-500 focus:ring-2" name="move" type="checkbox">
<select class="block mr-4 my-2 bg-gray-50 border border-gray-200 text-gray-700 focus:bg-gray-700 focus:ring-gray-200 focus:border-gray-200 focus:text-white text-sm rounded-lg block w-full p-2.5 w-full" name="folder">
{% for folder in folders %}
<option value="{{folder}}">{{folder}}</option>
{% endfor %}
</select>
<button form="parse" class="my-2 rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white">Parse E-mails</button>
<button form="parse" class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium rounded-lg text-sm">Parse E-mails</button>
</form>
</div>

Expand Down
4 changes: 2 additions & 2 deletions resources/templates/watchers.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ <h3 class="uppercase text-lg my-8">IMAP Clients</h3>
{% for watcher in watchers %}
<tr class="border-btext-slate-700">
<td class="text-left">
<a class="border-b-2 rounded-none px-4 py-2 border-purple-900 hover:bg-purple-900 hover:text-white" href="/watchers/{{watcher.id}}">{{watcher.string}}</a>
<a class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium rounded-lg text-sm" href="/watchers/{{watcher.id}}">{{watcher.string}}</a>
</td>
<td class="text-center">{{watcher.logged-in}}</td>
<td class="text-center">{{watcher.folder-open}}</td>
<td class="text-center">
<button class="rounded-none px-4 py-2 ring-2 ring-purple-900 hover:bg-purple-900 hover:text-white"><a href="/watchers/{{watcher.id}}/restart">Restart</a></button>
<button class="px-4 py-2 text-white bg-gray-700 hover:bg-gray-900 font-medium rounded-lg text-sm"><a href="/watchers/{{watcher.id}}/restart">Restart</a></button>
</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit a8c6a64

Please sign in to comment.