From 099e6d7ed7163013ebd9687b81f096cc1afe6295 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 15 Oct 2018 15:17:48 +0200 Subject: [PATCH] Started refactoring into digimarks package --- .../.notempty => digimarks/__init__.py | 0 digimarks/models.py | 0 digimarks/views.py | 0 static/css/digimarks.css | 67 ------- static/favicon.ico | Bin 91040 -> 0 bytes static/faviconfallback.png | Bin 254 -> 0 bytes static/js/init.js | 11 -- templates/404.html | 6 - templates/base.html | 126 ------------- templates/bookmarks.html | 113 ----------- templates/bookmarks.js | 11 -- templates/cards.html | 65 ------- templates/edit.html | 175 ------------------ templates/index.html | 17 -- templates/list.html | 62 ------- templates/publicbookmarks.html | 29 --- templates/redirect.html | 16 -- templates/tags.html | 65 ------- 18 files changed, 763 deletions(-) rename static/favicons/.notempty => digimarks/__init__.py (100%) create mode 100644 digimarks/models.py create mode 100644 digimarks/views.py delete mode 100644 static/css/digimarks.css delete mode 100644 static/favicon.ico delete mode 100644 static/faviconfallback.png delete mode 100644 static/js/init.js delete mode 100644 templates/404.html delete mode 100644 templates/base.html delete mode 100644 templates/bookmarks.html delete mode 100644 templates/bookmarks.js delete mode 100644 templates/cards.html delete mode 100644 templates/edit.html delete mode 100644 templates/index.html delete mode 100644 templates/list.html delete mode 100644 templates/publicbookmarks.html delete mode 100644 templates/redirect.html delete mode 100644 templates/tags.html diff --git a/static/favicons/.notempty b/digimarks/__init__.py similarity index 100% rename from static/favicons/.notempty rename to digimarks/__init__.py diff --git a/digimarks/models.py b/digimarks/models.py new file mode 100644 index 0000000..e69de29 diff --git a/digimarks/views.py b/digimarks/views.py new file mode 100644 index 0000000..e69de29 diff --git a/static/css/digimarks.css b/static/css/digimarks.css deleted file mode 100644 index 18722b0..0000000 --- a/static/css/digimarks.css +++ /dev/null @@ -1,67 +0,0 @@ -/** - * digimarks styling - */ - -/** Navigation **/ - -nav .sidenav-trigger -{ - /* Fix for misalignment of hamburger icon */ - margin: 0; -} - -nav .sidenav-trigger i -{ - /* Make the hamburger icon great again */ - font-size: 2.7rem; -} - -/** Cards and tags **/ - -.card .card-content, -.card .card-reveal -{ - padding: 12px; -} - -.card.tiny -{ - height: 140px; - overflow: hidden; -} - -.card.tiny .card-title -{ - font-size: 18px; -} - -.card .card-reveal .digimark-card-header, -.card .digimark-card-header.activator, -.chip.clickable -{ - cursor: pointer; - /*display: block;*/ -} - -.card .digimark-card-header-tags -{ - padding-top: 10px; -} - -.card-image -{ - min-width: 60px; -} - -.card-image i, -.list-image i -{ - padding: 5px 0 0 15px; -} - -.card.horizontal .card-image img.favicon, -.list-image img.favicon -{ - height: 60px; - width: 60px; -} diff --git a/static/favicon.ico b/static/favicon.ico deleted file mode 100644 index 3c1273e59ee984468761ac89407470f1cf270425..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 91040 zcmeI5UuauZ9LImjO=_r&1w|$@Y>j zL`2?wMk{DC^)EOg!|NlmSl6|xmbm4*5YhKJa;uw*>-tnE6hh6hh*K!frahYOEH5*! zwalDO(p&Cbr+&Eo=ZLc=F3tvTT(tZ-lfC7(uZOKaBR7*1DlWgQo2H~vJu}XvG-ouM z@u!$nsUIwGvs)1UI1_$9hda)Oeg4&SUf#aA#P6@Rzp|Pt)ltT#_(iq)-tDFLGE0t6 z|9koHuEQVtD~%b9Ka9WL@nNRxC6>bSA1CVUDrIf^XVuytk2-rx`|ImH)%Ium&41_8 zAM}S!43v*=yteXhK@IzjBxjl=a4ua`sIa_oB=?oMPLa`^)BN9c3N2WacC!{2lkOer z^-zva|HA+bzyJ)uK>Zo0aZWx_DQ5rox!8=4C$VS{U=JA>NAM-ySk754D{IBNmh56rf=DB|RF#q)# zo0$JvG5`HjJ!qL(C73y48Q;kz(5@t&_e}JB9kIL=2il>EZzGiG|F@E$hkGm zeIjz^WFlqviO`kyPAO)y$t2yIOdr4i48Q;kzyJ)u01UtY48Q;kzyJ)u01UtY48Q;k zzyJ)u01UtY48Xt~U_ieInFul8Qp@Mh+U}+h+g|FoSkQCOwmS{be!t(q*Q5Mu(7rSE zwC@gUu17m79pn9==b&xh+yL#bbZ)b~jrfPp?`+4o()$yC;vaY($@m|-_f^vNbhe>? z^pF1SWdQx#8++pq#Gm*x{@cp{`nNasjQ?E!L;vU>|F@R`^lxwM@qhdu{iA>U-(CjL zzrC@?|M7qHkN)w0dl^9g_QoFn$N$kk`p5t6WdQx#8+-g8|40AmAOE+P0rYQg?D2p6 zAN`|${NG*%(7(O0$N%wv^pF1We|s4~|Mtcn|HuE)Kl;c2?PUP{+Z%iQAOA=H=pX;L zmjU!|Z|w1Z{2%?JfBfHG2GGB~vB&@MfAo+3@qc?6K>zl}9{_dSq|@7db?_T#su+BbeN+;w=< zPse-HJ3qZ}sDJzNquU}+^q-IC9*WAw*?5e-I=23ke(8GQ&P< zr}wp-$?oV~IG%5L_!TV~80uNw(t2cp{21d=uO1k_IGpcDFFDt}aD2RP4nJ zh))7xMyEA#2Z4g@C7!;n?2nk`c-0Lb|ILmB3iW%sIEF+VPEMI|(mdVyOsRn=Hu5TB_t#wZmLcRI6D9S&(E_P8#^PT zdfmj{Tbwy?;DCbio6fY4A1~+I8ykEmZe7`X?Bj}~i^ck*Y_fn1=bK5#E>7HwYSY#k b?-&@QfAgQ7aF$CL=rjgTS3j3^P6 - - - {% block title %}{% endblock %} - digimarks - - - - - - - - - - - - - - - - - - - - - -{% if not sortmethod %} - {% set sortmethod = None %} -{% endif %} -{% if not show_as %} - {% set show_as = None %} -{% endif %} - - - -
-
-
-

{% block pageheader %}Bookmarks{% endblock %}

-
-
-
-
-
- {% block pagecontent %} - {% endblock %} -
-
- - - - - - {% block extrajs %}{% endblock %} - - diff --git a/templates/bookmarks.html b/templates/bookmarks.html deleted file mode 100644 index 3412819..0000000 --- a/templates/bookmarks.html +++ /dev/null @@ -1,113 +0,0 @@ -{% extends "base.html" %} -{% if not action %} -{% set action = 'Bookmarks' %} -{% endif %} -{% block title %}{{ action }}{% endblock %} -{% block pageheader %}{{ action }}{% endblock %} -{% block pagecontent %} - -{% if tag and not publictag %} - -{% endif %} - -{% if tag and publictag %} - -{% endif %} - -{% if message %} -
-
-
- - {{ message|safe }} - -
-
-
-{% endif %} - -
-
-
- -
- -
-

- {% if show_as and show_as == 'list' %} - apps - {% else %} - reorder - {% endif %} -

-
-
-
- -{% if tags %} -
-
- -
-
-{% endif %} - -{% if show_as and show_as == 'list' %} - {% include 'list.html' %} -{% else %} - {% include 'cards.html' %} -{% endif %} - - -{% endblock %} -{% block extrajs %} - - -{% endblock %} diff --git a/templates/bookmarks.js b/templates/bookmarks.js deleted file mode 100644 index dd92d5e..0000000 --- a/templates/bookmarks.js +++ /dev/null @@ -1,11 +0,0 @@ -var elem = document.querySelector('.autocomplete'); -var instance = M.Autocomplete.getInstance(elem); -instance.updateData({ - {% for bookmark in bookmarks %} - {% if bookmark.favicon %} - "{{ bookmark.title | replace('"', '\\"') | replace('\n', '') | replace('\r', '') }}": "{{ url_for('static', filename='favicons/' + bookmark.favicon) }}", - {% else %} - "{{ bookmark.title | replace('"', '\\"') | replace('\n', '') | replace('\r', '') }}": null, - {% endif %} - {% endfor %} -}); diff --git a/templates/cards.html b/templates/cards.html deleted file mode 100644 index 9fb774f..0000000 --- a/templates/cards.html +++ /dev/null @@ -1,65 +0,0 @@ -
- {% for bookmark in bookmarks %} -
-
-
- {% if bookmark.favicon %} -
- {% else %} -
- {% endif %} - {% if bookmark.http_status != 200 and bookmark.http_status != 304 %} -
report_problem
- {% endif %} - {% if bookmark.starred == True %} -
star
- {% endif %} - {% if bookmark.note %} -
comment
- {% endif %} -
- -
- Added @ {{ bookmark.created_date.strftime('%Y-%m-%d %H:%M') }}close - {% if editable %} - - {% endif %} - {% if showtags %} -
- {% for tag in bookmark.tags_list %} -
- {{ tag }} -
- {% endfor %} -
- {% endif %} -
-
-
- {% endfor %} - - {# - - #} -
diff --git a/templates/edit.html b/templates/edit.html deleted file mode 100644 index 999db6f..0000000 --- a/templates/edit.html +++ /dev/null @@ -1,175 +0,0 @@ -{% extends "base.html" %} -{% block title %}{{ action }}{% endblock %} -{% block pageheader %}{{ action }}{% endblock %} -{% block pagecontent %} - -{% if bookmark.http_status != 200 and bookmark.http_status != 202 and bookmark.http_status != 304 %} -
-
-
- - {% 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 %} - -
-
-
-{% endif %} - -{% if message %} -
-
-
- - {{ message }} - -
-
-
-{% endif %} - -{% if formaction and formaction == 'edit' %} -
-{% else %} - -{% endif %} - -
-
- description - - -{# Leave title empty for autofetching from the page#} -
- -
- turned_in - - - {% if bookmark.get_redirect_uri() %} - - - {% endif %} -
- -
- comment - - -
- -
- label - - -
-
- {% if tags %} -
-
-
    -
  • -
    labelExisting tags
    -
    - {% for tag in tags %} -
    - {{ tag }} -
    - {% endfor %} -
    -
  • -
-
-
- {% endif %} -
- -
- {#star#} - -
- -
- -
- - {% if bookmark.url_hash %} -
-
-
- - - - - - {% if bookmark.modified_date %} - - - - - {% endif %} - {% if bookmark.deleted_date %} - - - - - {% endif %} -
Added{{ bookmark.created_date.strftime('%Y-%m-%d %H:%M') }}
Modified{{ bookmark.modified_date.strftime('%Y-%m-%d %H:%M') }}
Deleted{{ bookmark.deleted_date.strftime('%Y-%m-%d %H:%M') }}
-
-
-
- {% endif %} - -
-

-
- {% if bookmark.url_hash %} - -
-
-

-
-
-
- {% else %} - - - {% endif %} - - -{% endblock %} diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index b9bd526..0000000 --- a/templates/index.html +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "base.html" %} -{% block title %}digimarks{% endblock %} -{% block pageheader %}digimarks{% endblock %} -{% block pagecontent %} -

Please visit your personal url, or see the digimarks project page.

- -
-
-
- - If you forgot/lost your personal url, contact your digimarks administrator. On startup, the personal codes are printed to the standard output (so should be findable in a log). Of course, bookmarks.db contains the user information too. - -
-
-
- -{% endblock %} diff --git a/templates/list.html b/templates/list.html deleted file mode 100644 index 63671ec..0000000 --- a/templates/list.html +++ /dev/null @@ -1,62 +0,0 @@ -
- - - - - - - {% if showtags %} - - {% endif %} - - - - - {% for bookmark in bookmarks %} - - - - - {% if showtags %} - - {% endif %} - - - {% endfor %} - -
 BookmarkAddedTags 
- {% if bookmark.favicon %} - - {% else %} - - {% endif %} - {% if bookmark.http_status != 200 and bookmark.http_status != 304 %} - report_problem - {% endif %} - {% if bookmark.starred == True %} - star - {% endif %} - {% if bookmark.note %} - comment - {% endif %} - - - {% if bookmark.title %} - {{ bookmark.title }} - {% else %} - {{ bookmark.get_uri_domain() }} (no title) - {% endif %} - - {{ bookmark.created_date.strftime('%Y-%m-%d %H:%M') }} - {% for tag in bookmark.tags_list %} -
- {{ tag }} -
- {% endfor %} -
- {% if editable %} - mode_edit - delete - {% endif %} -
-
diff --git a/templates/publicbookmarks.html b/templates/publicbookmarks.html deleted file mode 100644 index 8bcb0e2..0000000 --- a/templates/publicbookmarks.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "base.html" %} -{% if not action %} -{% set action = 'Bookmarks' %} -{% endif %} -{% block title %}{{ action }}{% endblock %} -{% block pageheader %}{{ action }}{% endblock %} -{% block pagecontent %} - -{% if message %} -
-
-
- - {{ message }} - -
-
-
-{% endif %} - -
- -
- -{% include 'cards.html' %} - -{% endblock %} diff --git a/templates/redirect.html b/templates/redirect.html deleted file mode 100644 index 400bc80..0000000 --- a/templates/redirect.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - Redirecting - digimarks - - - - - - -

You're being redirected. If nothing happens, click here instead.

- - diff --git a/templates/tags.html b/templates/tags.html deleted file mode 100644 index 4342570..0000000 --- a/templates/tags.html +++ /dev/null @@ -1,65 +0,0 @@ -{% extends "base.html" %} -{% block title %}Tags{% endblock %} -{% block pageheader %}Tags{% endblock %} -{% block pagecontent %} -
- -
- - - - - - - - - - - - - - - - - - - - - - - -
labelpresent_to_allturned_incommentstarwarningdelete
{{ totaltags }}{{ totalpublic }}{{ totalbookmarks }}{{ totalnotes }}{{ totalstarred }}{{ totalhttperrorstatus }}{{ totaldeleted }}
- -

- - - - - - - - - - - {% for tag in tags %} - - - - - - {% endfor %} - -
TagPublic linkNumber of bookmarks
- {{ tag['tag'] }} - - {% if tag['publictag'] %} - Public link (Delete warning) - {% else %} - Create - {% endif %} - - {{ tag['total'] }} -
-
-
-{% endblock %}