Skip to content

Commit

Permalink
Use icon font
Browse files Browse the repository at this point in the history
  • Loading branch information
svera authored Jan 10, 2025
1 parent b94cf83 commit 67d474c
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 73 deletions.
5 changes: 5 additions & 0 deletions internal/webserver/embedded/css/bootstrap-icons.min.css

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
38 changes: 12 additions & 26 deletions internal/webserver/embedded/views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/display.css" rel="stylesheet">
<link href="/css/bootstrap-icons.min.css" rel="stylesheet">
<!-- Favicons -->
<meta name="theme-color" content="#000">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
Expand All @@ -36,9 +37,7 @@
<div class="input-group input-group-sm">
<label for="search" class="visually-hidden">{{t .Lang "search"}}</label>
<input type="search" name="search" id="searchbox" class="form-control" placeholder={{t .Lang "Title, authors, subjects, etc."}} maxlength="255" required autofocus value="{{.Keywords}}">
<button class="btn btn-outline-secondary" type="submit"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/>
</svg></button>
<button class="btn btn-outline-secondary" type="submit"><i class="bi-search"></i></button>
</div>
</form>
{{end}}
Expand All @@ -63,38 +62,30 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">Coreander</h5>
<li>
{{if eq .Session.Role 2}}
<a class="dropdown-item" href="/users">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" class="bi bi-people-fill" viewBox="0 0 16 16">
<path
d="M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H7Zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm-5.784 6A2.238 2.238 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.325 6.325 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1h4.216ZM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" />
</svg>
<i class="bi-person-fill"></i>

{{t .Lang "Users"}}
</a>
{{else}}
<a class="dropdown-item" href="/users/{{.Session.Username}}">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">
<path
d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" />
</svg>
<i class="bi-person-fill"></i>

{{t .Lang "Update your profile"}}
</a>
{{end}}
</li>
<li>
<a class="dropdown-item" href="/highlights">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
<i class="bi-star-fill"></i>

{{t .Lang "Highlights"}}
</a>
</li>
{{if eq .Session.Role 2}}
<li>
<a class="dropdown-item" href="/upload">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-upload-fill" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 0a5.53 5.53 0 0 0-3.594 1.342c-.766.66-1.321 1.52-1.464 2.383C1.266 4.095 0 5.555 0 7.318 0 9.366 1.708 11 3.781 11H7.5V5.707L5.354 7.854a.5.5 0 1 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 5.707V11h4.188C14.502 11 16 9.57 16 7.773c0-1.636-1.242-2.969-2.834-3.194C12.923 1.999 10.69 0 8 0m-.5 14.5V11h1v3.5a.5.5 0 0 1-1 0"/>
</svg>
<i class="bi-cloud-upload-fill"></i>

{{t .Lang "Upload document"}}
</a>
</li>
Expand All @@ -104,13 +95,8 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">Coreander</h5>
</li>
<li>
<a class="dropdown-item" href="/sessions" hx-delete="/sessions">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z" />
<path fill-rule="evenodd"
d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z" />
</svg>
<i class="bi-box-arrow-right"></i>

{{t .Lang "Logout"}}
</a>
</li>
Expand Down
32 changes: 7 additions & 25 deletions internal/webserver/embedded/views/partials/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,22 @@
{{if eq .Document.Format "EPUB"}}
<div class="btn-group mb-1 flex-sm-fill" role="group" aria-label="Button group with nested dropdown">
<a href="/documents/{{.Document.Slug}}/download" class="btn btn-sm btn-outline-secondary w-100" download title='{{t .Lang "Download"}}'>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-download" viewBox="0 0 16 16">
<path d="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z"/>
<path d="M7.646 15.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 14.293V5.5a.5.5 0 0 0-1 0v8.793l-2.146-2.147a.5.5 0 0 0-.708.708l3 3z"/>
</svg>
&nbsp;
<i class="bi-cloud-download"></i>
<span class='badge text-bg-{{if eq .Document.Format "EPUB"}}primary{{else}}danger{{end}}'>{{.Document.Format}}</span>
</a>
<button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"></button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="/documents/{{.Document.Slug}}/download?format=kepub" class="dropdown-item" download title='{{t .Lang "Download"}}'>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-download" viewBox="0 0 16 16">
<path d="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z"/>
<path d="M7.646 15.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 14.293V5.5a.5.5 0 0 0-1 0v8.793l-2.146-2.147a.5.5 0 0 0-.708.708l3 3z"/>
</svg>
&nbsp;
<i class="bi-cloud-download"></i>
<span class='badge text-bg-primary'>KEPUB</span>
</a>
</li>
</ul>
</div>
{{else}}
<a href="/documents/{{.Document.Slug}}/download" class="btn btn-sm btn-outline-secondary mb-1 flex-sm-fill" download title='{{t .Lang "Download"}}'>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-download" viewBox="0 0 16 16">
<path d="M4.406 1.342A5.53 5.53 0 0 1 8 0c2.69 0 4.923 2 5.166 4.579C14.758 4.804 16 6.137 16 7.773 16 9.569 14.502 11 12.687 11H10a.5.5 0 0 1 0-1h2.688C13.979 10 15 8.988 15 7.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 2.825 10.328 1 8 1a4.53 4.53 0 0 0-2.941 1.1c-.757.652-1.153 1.438-1.153 2.055v.448l-.445.049C2.064 4.805 1 5.952 1 7.318 1 8.785 2.23 10 3.781 10H6a.5.5 0 0 1 0 1H3.781C1.708 11 0 9.366 0 7.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z"/>
<path d="M7.646 15.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 14.293V5.5a.5.5 0 0 0-1 0v8.793l-2.146-2.147a.5.5 0 0 0-.708.708l3 3z"/>
</svg>
&nbsp;
<i class="bi-cloud-download"></i>
<span class='badge text-bg-danger'>{{.Document.Format}}</span>
</a>
{{end}}
Expand All @@ -41,9 +29,7 @@
{{if not $sendToEmail}}{{$disabled = true}}{{end}}
<div class="btn-group mb-1 flex-sm-fill" role="group" aria-label="Button group with nested dropdown">
<button hx-post="/documents/{{.Document.Slug}}/send" hx-swap="none" hx-include="[id='quick-email-{{.Document.Slug}}'], [id='slug-{{.Document.Slug}}']" hx-indicator="#hx-spinner-{{.Document.Slug}}" class="btn btn-sm btn-outline-secondary w-100" {{if $disabled}}disabled{{end}} {{if $sendToEmail}}title='{{t .Lang "Send to %s" $sendToEmail}}'{{end}} data-error-message='{{t .Lang "There was an error sending %s to ${email}, please try again later" .Document.Title}}' data-success-message='{{t .Lang "%s sent to ${email}" .Document.Title}}'>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-fill" viewBox="0 0 16 16">
<path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z"/>
</svg>
<i class="bi-envelope-fill"></i>
<span id="hx-spinner-{{.Document.Slug}}" class="spinner-border spinner-border-sm htmx-indicator" aria-hidden="true"></span>
</button>
<input type="hidden" name="email" id="quick-email-{{.Document.Slug}}" value="{{$sendToEmail}}" />
Expand All @@ -53,20 +39,16 @@
<li>
<form hx-post="/documents/{{.Document.Slug}}/send" hx-swap="none" hx-indicator="#hx-spinner-{{.Document.Slug}}" data-error-message='{{t .Lang "There was an error sending %s to ${email}, please try again later" .Document.Title }}' data-success-message='{{t .Lang "%s sent to ${email}" .Document.Title }}' class="send-email mt-3">
<label for="email" class="form-label text-start text-nowrap">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-fill" viewBox="0 0 16 16">
<path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z"/>
</svg>
&nbsp;&nbsp;{{t .Lang "Send to email"}}
<i class="bi-envelope-fill"></i>
{{t .Lang "Send to email"}}
</label>

<div class="input-group">
<input type="email" class="form-control" name="email"
placeholder="[email protected]" value="{{$sendToEmail}}" required="required">
<input type="hidden" name="slug" value="{{.Document.Slug}}">
<button type="submit" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-send-fill" viewBox="0 0 16 16">
<path d="M15.964.686a.5.5 0 0 0-.65-.65L.767 5.855H.766l-.452.18a.5.5 0 0 0-.082.887l.41.26.001.002 4.995 3.178 3.178 4.995.002.002.26.41a.5.5 0 0 0 .886-.083l6-15Zm-1.833 1.89L6.637 10.07l-.215-.338a.5.5 0 0 0-.154-.154l-.338-.215 7.494-7.494 1.178-.471-.47 1.178Z"/>
</svg>
<i class="bi-send-fill"></i>
&nbsp;&nbsp;{{t .Lang "Send"}}</button>
</div>
<p class="text-end">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
<use href="#sun-fill"></use>
</svg>
{{t .Lang "Light"}}
<svg class="bi ms-auto d-none">
<use href="#check2"></use>
</svg>
</button>
</li>
<li>
Expand All @@ -45,9 +42,6 @@
<use href="#moon-stars-fill"></use>
</svg>
{{t .Lang "Dark"}}
<svg class="bi ms-auto d-none">
<use href="#check2"></use>
</svg>
</button>
</li>
<li>
Expand All @@ -57,9 +51,6 @@
<use href="#circle-half"></use>
</svg>
{{t .Lang "Auto"}}
<svg class="bi ms-auto d-none">
<use href="#check2"></use>
</svg>
</button>
</li>
</ul>
Expand Down
5 changes: 0 additions & 5 deletions internal/webserver/embedded/views/partials/delete-button.html

This file was deleted.

4 changes: 3 additions & 1 deletion internal/webserver/embedded/views/partials/docs-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ <h4 class="text-start">
</div>
{{if and $session (eq $session.Role 2)}}
<div class="col-5 text-end">
{{ template "partials/delete-button" dict "Lang" $lang "Document" $document }}
<button href="#" data-bs-toggle="modal" data-bs-target="#delete-modal" data-id="{{$document.Slug}}" class="btn btn-sm btn-danger" title="{{$document.ID}}">
<i class="bi-trash3-fill"></i>
</button>
</div>
{{end}}
</div>
Expand Down
9 changes: 2 additions & 7 deletions internal/webserver/embedded/views/user/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ <h2>{{t $lang "Users"}}</h2>
</div>
<div class="col text-end">
<a href="/users/new" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-plus-fill" viewBox="0 0 16 16">
<path d="M1 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>
<path fill-rule="evenodd" d="M13.5 5a.5.5 0 0 1 .5.5V7h1.5a.5.5 0 0 1 0 1H14v1.5a.5.5 0 0 1-1 0V8h-1.5a.5.5 0 0 1 0-1H13V5.5a.5.5 0 0 1 .5-.5z"/>
</svg>
<i class="bi-person-plus-fill"></i>
{{t $lang "Add user"}}
</a>
</div>
Expand Down Expand Up @@ -42,9 +39,7 @@ <h2>{{t $lang "Users"}}</h2>
<td class="text-end">
{{ if not (and (eq $admins 1) (eq $user.Role 2)) }}
<a href="#" data-bs-toggle="modal" data-bs-target="#delete-modal" data-id="{{$user.Username}}">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash3-fill" viewBox="0 0 16 16">
<path d="M11 1.5v1h3.5a.5.5 0 0 1 0 1h-.538l-.853 10.66A2 2 0 0 1 11.115 16h-6.23a2 2 0 0 1-1.994-1.84L2.038 3.5H1.5a.5.5 0 0 1 0-1H5v-1A1.5 1.5 0 0 1 6.5 0h3A1.5 1.5 0 0 1 11 1.5Zm-5 0v1h4v-1a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5ZM4.5 5.029l.5 8.5a.5.5 0 1 0 .998-.06l-.5-8.5a.5.5 0 1 0-.998.06Zm6.53-.528a.5.5 0 0 0-.528.47l-.5 8.5a.5.5 0 0 0 .998.058l.5-8.5a.5.5 0 0 0-.47-.528ZM8 4.5a.5.5 0 0 0-.5.5v8.5a.5.5 0 0 0 1 0V5a.5.5 0 0 0-.5-.5Z"/>
</svg>
<i class="bi-trash3-fill"></i>
</a>
{{end}}
</td>
Expand Down

0 comments on commit 67d474c

Please sign in to comment.