diff --git a/src/digimarks/main.py b/src/digimarks/main.py index 819f845..768fb04 100644 --- a/src/digimarks/main.py +++ b/src/digimarks/main.py @@ -70,6 +70,7 @@ async def lifespan(the_app: FastAPI): app = FastAPI(lifespan=lifespan) app.mount('/static', StaticFiles(directory=settings.static_dir), name='static') +app.mount('/content/favicons', StaticFiles(directory=settings.favicons_dir), name='favicons') templates = Jinja2Templates(directory=settings.template_dir) logger = logging.getLogger('digimarks') diff --git a/src/digimarks/static/css/digimarks.css b/src/digimarks/static/css/digimarks.css index d48e33f..f79a63e 100644 --- a/src/digimarks/static/css/digimarks.css +++ b/src/digimarks/static/css/digimarks.css @@ -3,3 +3,13 @@ * * Overrides on the digui styling */ + +/* Star, error, note etc */ +.card .statuses { + display: flex; + flex-direction: column; +} + +.star { + color: #ffeb3b; +} \ No newline at end of file diff --git a/src/digimarks/static/css/digui.css b/src/digimarks/static/css/digui.css index 94f6f4f..f723160 100644 --- a/src/digimarks/static/css/digui.css +++ b/src/digimarks/static/css/digui.css @@ -20,9 +20,12 @@ --border-color: #d5d9d9; --border-width: 1px; --border-radius: 8px; - /*--shadow-color: rgba(213, 217, 217, .5);*/ - --shadow-color: rgba(3, 3, 3, .5); + --shadow-color: rgba(213, 217, 217, .5); --global-theme-toggle-content: ' 🌞'; + + --danger-color: #e03131; + --warning-color: orange; + --error-color: var(--danger-color); } html[data-theme='nebula'] { @@ -67,6 +70,9 @@ html[data-theme='bbs'] { --link-color: #543fd7; --highlight-color: #e03131; + /*--nav-background-color: #ccc;*/ + /*--nav-color: var(--text-color);*/ + --border-color: #333; --border-width: 2px; --border-radius: 0; @@ -234,7 +240,51 @@ button:focus { box-shadow: var(--shadow-color) 0 2px 5px 0; } +.card .card-header { + +} + +.card-body { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + gap: 1rem; +} + +.card-body > * { + /*padding-left: 1em;*/ +} + +.card .card-image { + width: 72px; + /*min-width: 60px;*/ + /*max-width: 100px;*/ + /*position: relative;*/ + /*box-sizing: inherit;*/ +} + +.card .card-image img { + width: 72px; +} + .card .meta { filter: brightness(80%); color: var(--text-color); } + +.card .card-footer { + display: flex; + flex-direction: row-reverse; + gap: 1rem; + align-items: center; +} + +/* +.card button { + border: none; + background: none; +} +*/ +.error { + color: var(--error-color); +} diff --git a/src/digimarks/static/js/digimarks.js b/src/digimarks/static/js/digimarks.js index 159057f..bf1dffc 100644 --- a/src/digimarks/static/js/digimarks.js +++ b/src/digimarks/static/js/digimarks.js @@ -9,6 +9,9 @@ document.addEventListener('alpine:init', () => { bookmarks: [], tags: [], + /* Bookmark that is being edited, used to fill the form etc */ + bookmark_to_edit: null, + /* nebula (dropshadows), bbs (monospace, right lines), silo (like bbs but dark) ?? */ themes: ['nebula', 'nebula-dark', 'bbs', 'silo'], theme: Alpine.$persist('nebula').as('theme'), @@ -148,6 +151,16 @@ document.addEventListener('alpine:init', () => { async toggleListOrGrid() { this.show_bookmarks_list = !this.show_bookmarks_list; this.show_bookmarks_cards = !this.show_bookmarks_list; + }, + + async startAddingBookmark() { + console.log('Start adding bookmark'); + this.bookmark_to_edit = { + 'url': '' + } + }, + async addBookmark() { + // } }) }); diff --git a/src/digimarks/templates/base.html b/src/digimarks/templates/base.html index 7e5ac4e..6f67350 100644 --- a/src/digimarks/templates/base.html +++ b/src/digimarks/templates/base.html @@ -4,6 +4,7 @@ {% block title %}{% endblock %} - digimarks + diff --git a/src/digimarks/templates/user_index.html b/src/digimarks/templates/user_index.html index 663869d..21de663 100644 --- a/src/digimarks/templates/user_index.html +++ b/src/digimarks/templates/user_index.html @@ -16,7 +16,7 @@
  • - +
  • @@ -28,7 +28,8 @@
    -
    +

    Bookmarks

    @@ -58,16 +59,32 @@

    -
    +

    Tags

      @@ -76,6 +93,34 @@
    + +
    +

    Add/Edit bookmark

    + {# +
    + + {% if bookmark.http_status == 404 %} + report_problem  URL not found (404), broken/outdated link? + {% elif bookmark.http_status == 301 %} + report_problem  HTTP status (301), moved permanently. Use button for new target + {% elif bookmark.http_status == 302 %} + report_problem  HTTP status (302), moved temporarily. Use button for new target + {% elif bookmark.http_status == bookmark.HTTP_CONNECTIONERROR %} + report_problem  Connection error, server might have been offline at the time of last edit + {% else %} + report_problem  HTTP status {{ bookmark.http_status }} + {% endif %} + +
    +#} +
    + + +
    +