From 7da0d7b90cbe6fdc1d119b35a0a5e861af993210 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 24 Feb 2021 15:57:16 -0800 Subject: update homepage stats --- python/fatcat_web/templates/home.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/home.html b/python/fatcat_web/templates/home.html index 4288017e..4feef153 100644 --- a/python/fatcat_web/templates/home.html +++ b/python/fatcat_web/templates/home.html @@ -32,17 +32,17 @@
-- cgit v1.2.3 From 3a3ed1e3b3c148b6da1041837eb09bf905cf7c1f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 24 Feb 2021 16:04:27 -0800 Subject: entity metadata template: show 'extra' at the bottom --- python/fatcat_web/templates/entity_view_metadata.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/entity_view_metadata.html b/python/fatcat_web/templates/entity_view_metadata.html index 5ce97d10..7ccdc5bb 100644 --- a/python/fatcat_web/templates/entity_view_metadata.html +++ b/python/fatcat_web/templates/entity_view_metadata.html @@ -4,13 +4,13 @@ {% block entity_main %} +

Entity Metadata (schema)

+{{ entity_macros.extra_metadata(entity._metadata) }} + {% if entity.extra %}

Extra Metadata (raw JSON)

{{ entity_macros.extra_metadata(entity.extra) }} {% endif %} -

Entity Metadata (schema)

-{{ entity_macros.extra_metadata(entity._metadata) }} - {% endblock %} -- cgit v1.2.3 From 295e6b16eb7ac90fd8d6e3272827c592903b62e7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 25 Feb 2021 18:49:59 -0800 Subject: web: format search result counts --- python/fatcat_web/templates/search_macros.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/search_macros.html b/python/fatcat_web/templates/search_macros.html index a207bfbc..cb917c5f 100644 --- a/python/fatcat_web/templates/search_macros.html +++ b/python/fatcat_web/templates/search_macros.html @@ -9,7 +9,7 @@ {% endif %} {{ found.offset + found.count_returned }} - out of {{ found.count_found }} results + out of {{ '{0:,}'.format(found.count_found) }} results {%- endmacro %} @@ -28,7 +28,7 @@ {% endif %}   Showing results {{ found.offset }} — {{ found.offset + -found.count_returned }} out of {{ found.count_found }} results   +found.count_returned }} out of {{ '{0:,}'.format(found.count_found) }} results   {% if found.offset + found.limit < found.count_found and found.offset + found.limit < found.deep_page_limit %} Next » -- cgit v1.2.3 From 24cbb62b682bfe795da5b568b4ad04348ba69254 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 25 Feb 2021 21:23:47 -0800 Subject: web: updates to homepage Not sure all of these will stick --- .../static/fatcat_oa_preservation_jan2021.svg | 4 ++ .../static/scholar-vaporwave-logo-small.png | Bin 0 -> 7789 bytes python/fatcat_web/templates/home.html | 61 +++++++++++++++++---- 3 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 python/fatcat_web/static/fatcat_oa_preservation_jan2021.svg create mode 100644 python/fatcat_web/static/scholar-vaporwave-logo-small.png (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/static/fatcat_oa_preservation_jan2021.svg b/python/fatcat_web/static/fatcat_oa_preservation_jan2021.svg new file mode 100644 index 00000000..730a5efa --- /dev/null +++ b/python/fatcat_web/static/fatcat_oa_preservation_jan2021.svg @@ -0,0 +1,4 @@ + +Pygal0020000020000040000040000060000060000080000080000010000001000000120000012000001400000140000016000001600000180000018000001996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820191957432.707789645797895403.890059505986219962146966.08308520273451403.6820681985609619972185999.45838075967114403.6392625996714199823758132.83367631660775403.4308322604627199926800166.20897187354439403.09694858912366200028508199.58426743048102402.9094820175763200129941232.95956298741766402.7521988811434200233943266.3348585443543402.3129475817684200335488299.7101541012909402.14337155539795200439403333.08544965822756401.7136691973137200543263366.4607452151642401.29000352625235200647430399.8360407721008400.8326421658087200752875433.2113363290374400.2350101505421200854954466.586631885974400.00682338107663200966311499.9619274429107398.7603023898218201066099533.3372229998473398.7835710743464201176952566.7125185567838397.5923680878104201274013600.0878141137206397.91494669072482013232144633.4631096706572380.55881295222662014132977666.8384052275937391.44317917039792015134921700.2137007845305391.229809723625072016155483733.588996341467388.97296684062932017179782766.9642918984036386.305958513914332018207007800.3395874553403383.3177984375813620194643032.707789645797895396.6455960467287719964640966.08308520273451396.2319183487416619974893699.45838075967114395.86894882174687199847295132.83367631660775395.6322009325035199950270166.20897187354439394.6379037008598200048581199.58426743048102394.44835172834087200149865232.95956298741766393.992856252977200250947266.3348585443543392.99559555679474200354524299.7101541012909392.26383933167403200456313333.08544965822756391.2080776503426200556281366.4607452151642390.36425856248775200669033399.8360407721008388.0499025158557200769948433.2113363290374386.75420996485076200879938466.586631885974385.2013545466704200990340499.9619274429107381.5666104112124201088258533.3372229998473381.8416638235647201196463566.7125185567838378.55869390462272012121519600.0878141137206376.453756018712172013134145633.4631096706572340.35568471715092014147421666.8384052275937360.66727066411262015162520700.2137007845305358.58329654586342016195935733.588996341467350.40204901859852017233065766.9642918984036340.99271983498512018306449800.3395874553403326.961922582535120194920232.707789645797895386.149224167210819965370366.08308520273451385.243830871722419975842799.45838075967114384.08500647921835199864997132.83367631660775383.30726167477775199975072166.20897187354439380.8806232495199200087289199.58426743048102379.535539622873200197398232.95956298741766377.829571870202872002111752266.3348585443543375.138087521558652003130264299.7101541012909371.98188803009752004149095333.08544965822756368.662917504909842005176156366.4607452151642364.85245089811272006208130399.8360407721008357.62906096446252007311187433.2113363290374344.92161526537692008379183466.586631885974334.809176680515072009440731499.9619274429107323.27734833965182010523998533.3372229998473314.64170291648182011636696566.7125185567838298.08866806792042012749319600.0878141137206280.87236595246172013866903633.4631096706572230.48271251906132014990895666.8384052275937235.7280447522276520151092248700.2137007845305220.8625383214300720161176562733.588996341467199.7595975847398220171214865766.9642918984036182.0708972702530820181299975800.3395874553403150.64412414495382019Year1957421469218592375826800285082994133943354883940343263474305287554954663116609976952740132321441329771349211554831797822070074643046409489364729550270485814986550947545245631356281690336994879938903408825896463121519134145147421162520195935233065306449492025370358427649977507287289973981117521302641490951761562081303111873791834407315239986366967493198669039908951092248117656212148651299975NoneDarkBright \ No newline at end of file diff --git a/python/fatcat_web/static/scholar-vaporwave-logo-small.png b/python/fatcat_web/static/scholar-vaporwave-logo-small.png new file mode 100644 index 00000000..c40f7ec5 Binary files /dev/null and b/python/fatcat_web/static/scholar-vaporwave-logo-small.png differ diff --git a/python/fatcat_web/templates/home.html b/python/fatcat_web/templates/home.html index 4feef153..54dbe573 100644 --- a/python/fatcat_web/templates/home.html +++ b/python/fatcat_web/templates/home.html @@ -37,7 +37,7 @@
@@ -59,14 +59,13 @@ confused paper man
-

Fatcat is a versioned, user-editable catalog of research +

Fatcat is a versioned, user-editable catalog of research publications including journal articles, conference proceedings, and - datasets + datasets.

Features include archival file-level metadata (verified digests and - long-term copies), an - open, documented API, - and work/release indexing (eg, distinguishing between and linking - pre-prints, manuscripts, and version-of-record). + long-term copies), work/edition grouping, an + open API, + and public metadata dumps.  Read more...

@@ -74,6 +73,25 @@ +
+
+
+
+
+

Our goal is to ensure long-term access to research content on the + "scholarly web" by tracking holes in preservation coverage across + digital preservation efforts +

+
+ + + +
+
+
+
+
+
@@ -83,9 +101,9 @@ href="https://archive.org">Internet Archive, a US non-profit digital library dedicated to providing Universal Access to All Knowledge. Donations welcome! -

Development funding comes from - The Andrew Mellon Foundation - to improve preservation and access to "long-tail" open access works on +

Development for this project funding comes from + The Andrew Mellon Foundation, + specifically to capture "long-tail" open access works on the public web which might otherwise be lost.

@@ -96,6 +114,26 @@
+
+
+
+
+
+ + IA scholar logo + +
+
+

Internet Archive Scholar + is a sibling service, built on the Fatcat catalog, providing end-user + access to and full-text search over research content across the + Internet Archive's various holdings. +

+
+
+
+
+
@@ -110,6 +148,8 @@
+
+

@@ -118,7 +158,6 @@
- {# this div makes the table scrollable on mobile #}
-- cgit v1.2.3 From 42e8f882ae0ad604657346a21b36d07b0729d5d3 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 10:03:23 -0800 Subject: update SPN text --- python/fatcat_web/templates/release_save.html | 31 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/release_save.html b/python/fatcat_web/templates/release_save.html index 29875d3d..7dd01fc0 100644 --- a/python/fatcat_web/templates/release_save.html +++ b/python/fatcat_web/templates/release_save.html @@ -13,14 +13,14 @@ {% if spn_status == "not-configured" %} -
-
Error
+
+
Not Available

Save Paper Now feature isn't configured, sorry about that.

{% elif spn_status == "kafka-error" %} -
+
Error

Whoops, something went wrong and we couldn't enqueue your request. This didn't have anything to do with the URL you supplied; please try again later. @@ -28,7 +28,7 @@ {% elif spn_status == "success" %} -

+
Success

URL has been submitted to the bot queue for crawling. If fulltext content is found, it will be imported into the catalog for review. Keep an eye on the @@ -40,15 +40,24 @@
-
-

Know of a legit fulltext copy of this publication on the public web? - Tell us the URL and we will crawl it and provide free perpetual access. +

If you know of a legitimate public web access option for this work, you + can help us preserve it by filling out the form below. Using the Wayback + Machine's "Save Page Now" feature, + we will attempt to crawl, process, and verify the content and add it to the + catalog. - {{ edit_macros.form_field_basic(form.base_url) }} +

If you are the author of this + work, and the published version is not publicly available, another option is + to upload an version to an institutional or discipline repository. The + Share Your Paper tool can help with + this process. -

Important: check the publication stage of the file you are - submitting. We distinguish between pre-prints, manuscripts, and the - published version of record (if applicable). +

Important: + double-check the publication stage of the file you are submitting. We + distinguish between pre-prints, manuscripts, and the published version of + record (if applicable). + + {{ edit_macros.form_field_basic(form.base_url) }}

{{ edit_macros.form_field_basic(form.release_stage) }} -- cgit v1.2.3 From 96db9d510a6891594271af7c284c46335b4d7502 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 10:28:06 -0800 Subject: web: tweak display of files, webcapture, fileset --- python/fatcat_web/templates/file_view.html | 35 ++++++++++++------------ python/fatcat_web/templates/fileset_view.html | 18 ++++++------ python/fatcat_web/templates/webcapture_view.html | 15 +++++----- 3 files changed, 34 insertions(+), 34 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/file_view.html b/python/fatcat_web/templates/file_view.html index 02f47a91..608a2a0a 100644 --- a/python/fatcat_web/templates/file_view.html +++ b/python/fatcat_web/templates/file_view.html @@ -8,23 +8,23 @@
-

Releases

+

Associated Releases

{% if entity.releases != [] %} {{ entity_macros.release_list(entity.releases) }} {% else %}

- This file is not associated with any fatcat release. + This file is not associated with any release entity! This makes a is a stub entry in the catalog. {% endif %} -

URLs

+

Public Access URLs

{% if file.urls != None %} {{ entity_macros.url_list(file.urls) }} {% else %} -No known public URL, mirror, or archive for this file. +No known archives or mirrors of this file. {% endif %} -

Checksums

+

Data Integrity Checksums

{% if file.sha1 != None %} @@ -45,22 +45,23 @@ No known public URL, mirror, or archive for this file.
{% if file._es and file._es.best_url %} -Download File + {# TODO: this currently shows *any* file, though prefers archive.org #} + + View Archived File + {% else %} -No Download Available + No Public URL {% endif %} +
-{% if file.size != None %} -
-

Size  {{ file.size|filesizeformat }} +

+ {% if file.size != None %} + Size  {{ file.size|filesizeformat }}
+ {% endif %} + {% if file.mimetype != None %} + MIME Type  {{ file.mimetype }}
+ {% endif %}
-{% endif %} - -{% if file.mimetype != None %} -
-

File Type  {{ file.mimetype }} -

-{% endif %} {{ entity_macros.fatcat_bits(entity, "file", "", editgroup) }} diff --git a/python/fatcat_web/templates/fileset_view.html b/python/fatcat_web/templates/fileset_view.html index 27d5b6da..4e8bfbad 100644 --- a/python/fatcat_web/templates/fileset_view.html +++ b/python/fatcat_web/templates/fileset_view.html @@ -8,14 +8,20 @@
-

Releases

+

Associated Releases

{% if entity.releases != [] %} {{ entity_macros.release_list(entity.releases) }} {% else %}

This File Set is not associated with any fatcat release. {% endif %} - + +

Public Access URLs

+{% if entity.urls %} + {{ entity_macros.url_list(entity.urls) }} +{% else %} +No known public URL, mirror, or archive for this File Set. +{% endif %}

File Manifest ({{ fileset.manifest|count }})

{% if fileset.manifest %} @@ -40,14 +46,6 @@ This File Set is empty (contains no files). {% endif %} -
-

Base URLs

-{% if entity.urls %} - {{ entity_macros.url_list(entity.urls) }} -{% else %} -No known public URL, mirror, or archive for this File Set. -{% endif %} -
diff --git a/python/fatcat_web/templates/webcapture_view.html b/python/fatcat_web/templates/webcapture_view.html index f2f689f3..b35ee0e2 100644 --- a/python/fatcat_web/templates/webcapture_view.html +++ b/python/fatcat_web/templates/webcapture_view.html @@ -8,7 +8,7 @@
-

Releases

+

Associated Releases

{% if entity.releases != [] %} {{ entity_macros.release_list(entity.releases) }} {% else %} @@ -16,8 +16,7 @@ This Web Capture is not associated with any fatcat release. {% endif %} -
-

Archive URLs

+

Public Archive URLs

{% if webcapture.archive_urls != None %}
@@ -42,7 +41,7 @@ No known public archive for this webcapture. {% endif %} -

CDX Rows ({{ webcapture.cdx|count }})

+

Captured Resources ({{ webcapture.cdx|count }})

{% if webcapture.cdx %}
{% for row in webcapture.cdx %} @@ -53,7 +52,7 @@ No known public archive for this webcapture.
{{ row.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} - {% if row.mimetype %}| {{ row.mimetype }} {% endif %} + {% if row.mimetype %}| {{ row.mimetype }} {% endif %} {% if row.size %}| {{ row.size|filesizeformat }} {% endif %}
@@ -73,11 +72,13 @@ This web capture is empty (contains no resources).
{% if webcapture.state == 'active' and webcapture.archive_urls != [] and webcapture.archive_urls[0].rel == "wayback" %} -View Web Archive + + View Web Archive + {% endif %} {% if webcapture.timestamp != None %} -
+

Capture Time  {{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }}

{% endif %} -- cgit v1.2.3 From d280b1b4fdc57bfd4c0c9cb56fd836d2ae80dbb5 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 10:29:57 -0800 Subject: web: generic view improvements (entities, lists) --- python/fatcat_web/templates/changelog.html | 14 +++- .../fatcat_web/templates/editgroup_reviewable.html | 2 +- python/fatcat_web/templates/editgroup_view.html | 90 ++++++++++++++-------- .../fatcat_web/templates/editor_annotations.html | 12 +-- python/fatcat_web/templates/editor_editgroups.html | 12 +-- python/fatcat_web/templates/editor_view.html | 15 +++- python/fatcat_web/templates/entity_history.html | 10 ++- python/fatcat_web/templates/entity_macros.html | 24 +++--- .../fatcat_web/templates/entity_view_metadata.html | 3 + 9 files changed, 113 insertions(+), 69 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/changelog.html b/python/fatcat_web/templates/changelog.html index 8b899d38..322f3e3b 100644 --- a/python/fatcat_web/templates/changelog.html +++ b/python/fatcat_web/templates/changelog.html @@ -7,9 +7,11 @@

Recent Changes
changelog

-Limited to the most recent entries. +

This is a feed of all the changes to the catalog, in the order that they are +accepted. Only the most recent entries are shown, but the API can be used to +inspect every change all the way back to the start. -

+
Changelog
Index
Editgroup Description @@ -19,7 +21,7 @@ Limited to the most recent entries.
{{ entry.timestamp.strftime("%Y-%m-%d %H:%M:%S") }}
{% if entry.editgroup.editor.is_bot %} - + {% else %} {% endif %} @@ -28,10 +30,14 @@ Limited to the most recent entries.
- {{ entry.editgroup.editgroup_id }} + editgroup_{{ entry.editgroup.editgroup_id }}
{% if entry.editgroup.description != None %}{{ entry.editgroup.description }}{% endif %} {% endfor %}
+ + {% endblock %} diff --git a/python/fatcat_web/templates/editgroup_reviewable.html b/python/fatcat_web/templates/editgroup_reviewable.html index 4cfea697..ec1fc1f5 100644 --- a/python/fatcat_web/templates/editgroup_reviewable.html +++ b/python/fatcat_web/templates/editgroup_reviewable.html @@ -16,7 +16,7 @@ Limited to the most recent entries. {% for editgroup in entries %} {% if editgroup.editor.is_bot %} - + {% else %} {% endif %} diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index a36dc3e5..dc18f9d3 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -12,9 +12,20 @@
{% for edit in edits %}
-
+
+
+ [view] + {% if auth_to.edit and not editgroup.changelog_index and not editgroup.submitted %} +
[re-edit] +
+ + + + + {% endif %} +
- {{ entity_type }}/{{ edit.ident }} + {{ entity_type }}_{{ edit.ident }} {% if edit.redirect_ident %} => redirect to {{ entity_type }}/{{ edit.redirect_ident }} {% elif not edit.revision %} @@ -24,14 +35,6 @@ {% else %} updated {% endif %} - [view edit] - {% if auth_to.edit and not editgroup.changelog_index and not editgroup.submitted %} - [re-edit] -
- - -
- {% endif %}
{% if edit.revision %} Revision: {{ edit.revision }} @@ -77,36 +80,54 @@ {% endif %}

Editgroup -editgroup {{ editgroup.editgroup_id }}

+editgroup_{{ editgroup.editgroup_id }} {% endblock %} -

What is an editgroup? -An editgroup is a set of entity edits, bundled together into a coherent, -reviewable bundle. -
+

+
+ What is an editgroup? +
+

An editgroup is a set of entity edits, bundled together into a coherent, reviewable bundle. +

-
Status: -{% if editgroup.changelog_index %} - Merged (Changelog #{{ editgroup.changelog_index }}) -{% elif editgroup.submitted %} - Submitted ({{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }}) -{% else %} - Not Submitted -{% endif %} + + + + + + + + + + + + + + +
Status + {% if editgroup.changelog_index %} + Merged (Changelog #{{ editgroup.changelog_index }}) + {% elif editgroup.submitted %} + Submitted ({{ editgroup.submitted.strftime("%Y-%m-%d %H:%M:%S") }}) + {% else %} + Not Submitted + {% endif %} +
Editor + {{ editgroup.editor.username }} +
Description + {% if editgroup.description %} + {{ editgroup.description }} + {% else %} + none + {% endif %} +
-
Editor: {{ editgroup.editor.username }} -
Description: -{% if editgroup.description %} - {{ editgroup.description }} -{% else %} - none -{% endif %} {% if editgroup.extra %}

Extra Metadata (raw JSON)

{{ entity_macros.extra_metadata(editgroup.extra) }} {% endif %} -

+

All Entity Changes

{{ edit_list(auth_to, editgroup, editgroup.edits.releases, "release", "Release") }} {{ edit_list(auth_to, editgroup, editgroup.edits.works, "work", "Work") }} @@ -116,14 +137,17 @@ reviewable bundle. {{ edit_list(auth_to, editgroup, editgroup.edits.filesets, "fileset", "File Set") }} {{ edit_list(auth_to, editgroup, editgroup.edits.webcaptures, "webcapture", "Web Capture") }}
+
-

Comments and Annotations

+

Comments and Annotations

{% for annotation in editgroup.annotations|reverse %}
{% if annotation.editor.is_bot %} - + {% else %} {% endif %} diff --git a/python/fatcat_web/templates/editor_annotations.html b/python/fatcat_web/templates/editor_annotations.html index c46039f5..7a8b53cf 100644 --- a/python/fatcat_web/templates/editor_annotations.html +++ b/python/fatcat_web/templates/editor_annotations.html @@ -1,15 +1,15 @@ {% extends "base.html" %} {% block body %} -

Comments and Annotations +

{{ editor.username }}: Comments and Annotations
- editor - {{ editor.username }} - - + editor_{{ editor.editor_id }}

+Edit History - +Comments and Annotation History +

{% for annotation in annotations %}
@@ -29,7 +29,7 @@
{% else %} - None! + No comments or annotations for this editor! {% endfor %} {% endblock %} diff --git a/python/fatcat_web/templates/editor_editgroups.html b/python/fatcat_web/templates/editor_editgroups.html index 3c3dd20d..756b3a02 100644 --- a/python/fatcat_web/templates/editor_editgroups.html +++ b/python/fatcat_web/templates/editor_editgroups.html @@ -1,15 +1,15 @@ {% extends "base.html" %} {% block body %} -

Edit History +

{{ editor.username }}: Edit History
- editor - {{ editor.username }} - - + editor_{{editor.editor_id}}

+Edit History - +Comments and Annotation History +
{#
Created (UTC) #} Status @@ -28,7 +28,7 @@ Work in Progress {% endif %} - {{ editgroup.editgroup_id }} + editgroup_{{ editgroup.editgroup_id }} {% if editgroup.description != None %}{{ editgroup.description }}{% endif %} {% endfor %} diff --git a/python/fatcat_web/templates/editor_view.html b/python/fatcat_web/templates/editor_view.html index 6ac58e3d..5906af75 100644 --- a/python/fatcat_web/templates/editor_view.html +++ b/python/fatcat_web/templates/editor_view.html @@ -6,11 +6,20 @@

{{ editor.username }}
- editor {{ editor.editor_id }} + editor_{{ editor.editor_id }}

-

Edit History -

Comments and Annotation History +Edit History - +Comments and Annotation History + +
+
+

+
+ This page is intentionally bare +
+

We don't have much to share about individual editors. +

{% endblock %} diff --git a/python/fatcat_web/templates/entity_history.html b/python/fatcat_web/templates/entity_history.html index c9f45d84..0115b845 100644 --- a/python/fatcat_web/templates/entity_history.html +++ b/python/fatcat_web/templates/entity_history.html @@ -3,9 +3,9 @@ {% block entity_main %} -

Edit History

+

Entity Edit History

-This table only shows merged edits, not work-in-progress. +This table only shows accepted edits included in the catalog, not any work-in-progress.
Changelog @@ -17,7 +17,7 @@ This table only shows merged edits, not work-in-progress.
{{ entry.changelog_entry.timestamp.strftime("%Y-%m-%d %H:%M") }}
{% if entry.editgroup.editor.is_bot %} - + {% else %} {% endif %} @@ -34,5 +34,9 @@ This table only shows merged edits, not work-in-progress. {% if entry.editgroup.description != None %}{{ entry.editgroup.description }}{% endif %} {% endfor %}
+ + {% endblock %} diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index e8a763d2..e68254de 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -5,15 +5,15 @@
{% if editgroup.changelog_index %} Accepted Edit Version -

This is the version of the entity as of a specific merged editgroup: +

This is the version of the entity as of a specific point in time: {% elif editgroup.submitted %} Submitted Edit Version -

This is a version of the entity that has been submitted for approval as part of an editgroup: +

This is a version of the entity that has been submitted for approval as part of: {% else %} Edit In Progress -

This is a version of the entity that has not yet been submitted for approval, part of an editgroup: +

This is a version of the entity that has not yet been submitted for approval. Part of: {% endif %} - {{ editgroup.editgroup_id }} + editgroup_{{ editgroup.editgroup_id }}

{% elif entity.state == None and entity.ident == None %}
@@ -27,17 +27,15 @@
{% endif %} -
- Fatcat Bits -

- {% if entity.state %} - State is "{{ entity.state }}". +

+ Catalog Record + {% if entity.state and entity.state != "active" %} +
State: {{ entity.state }} {% endif %} {% if entity.revision %} - Revision: -
{{ entity.revision }} +
Revision: {{ entity.revision }} {% endif %} -
- As JSON object via API + JSON
diff --git a/python/fatcat_web/templates/entity_view_metadata.html b/python/fatcat_web/templates/entity_view_metadata.html index 7ccdc5bb..90ce25d9 100644 --- a/python/fatcat_web/templates/entity_view_metadata.html +++ b/python/fatcat_web/templates/entity_view_metadata.html @@ -6,6 +6,9 @@

Entity Metadata (schema)

{{ entity_macros.extra_metadata(entity._metadata) }} + {% if entity.extra %}

Extra Metadata (raw JSON)

-- cgit v1.2.3 From a9e135af76362b27b39e0c33a308332188b41d70 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 10:30:25 -0800 Subject: web: container bar improvements (eg, kbart holdings) --- python/fatcat_web/templates/container_view.html | 35 +++++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/container_view.html b/python/fatcat_web/templates/container_view.html index bdde6715..128741e5 100644 --- a/python/fatcat_web/templates/container_view.html +++ b/python/fatcat_web/templates/container_view.html @@ -46,14 +46,8 @@
-{% if container._es and container._es.is_oa == True %} -
- Open Access Publication -
-{% endif %} - {% if container._stats %} -
+
{{ "{:,}".format(container._stats.total) }}
@@ -61,6 +55,13 @@
+ +{% if container._es and container._es.is_oa == True %} +
+ Open Access Publication +
+ +{% endif %} {% if container._stats.total >= 1 %}
Preservation Status
@@ -122,7 +123,8 @@ {% endif %} {% if container._es.any_kbart == True %} - In Keepers Registery
+ In Keepers Registery +
{% elif container._es.any_kbart == False %} Not in Keepers Registry
{% endif %} @@ -133,6 +135,23 @@
{% endif %} +
+Preservation Holdings
+{%- if container.extra and container.extra.kbart %} + {% for k, v in container.extra.kbart.items() %} +

{{ k }}: + {% for span in v.year_spans %} + {% if span|length >= 2 %} + {{ span[0] }}-{{ span[1] }} + {% elif span|length == 1 %} + {{ span[0] }} + {% endif %} + {{ ", " if not loop.last }} + {% endfor %} + {% endfor %} +{% endif %} +

+
Lookup Links
-- cgit v1.2.3 From 6e059f1bbd9753df279e1d4c1f1f98d9099e6984 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 10:30:53 -0800 Subject: web: release view improvements --- python/fatcat_web/templates/release_view.html | 190 +++++++++++--------------- 1 file changed, 79 insertions(+), 111 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index cc9cf5fe..9464fda2 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -79,23 +79,16 @@
-{% if release.abstracts != [] %} -

Abstract

-

{{ release.abstracts[0].content }} -
In {{ release.abstracts[0].mimetype }} format -{% endif %} - -

{% if release.release_stage == 'published' %} - Published + Published {% if release.container.ident %} in {{ release.container.name }} {% elif release.extra and release.extra.container_name %} in {{ release.extra.container_name }} {% endif %} {% else %} - Released + Released {% if release.release_type %} as a {{ release.release_type }} {% endif %} @@ -105,84 +98,41 @@ {% endif %} {% if release.publisher %} by {{ release.publisher }} - {% endif %} -
- - - {% if release.number != None %} - - - - - - - - - - - - - - - -
Number{{ release.number }} - {% endif %} - {% if release.version != None %} -
Version{{ release.version }} - {% endif %} - {% if release.container != None and release.container.issnl != None %} -
ISSN-L{{ release.container.issnl }} - {% endif %} - {% if release.volume != None %} -
Volume{{ release.volume }} - {% endif %} - {% if release.issue != None %} -
Issue{{ release.issue }} - {% endif %} - {% if release.pages != None %} -
Page(s){{ release.pages }} - {% endif %} - {% if release.release_date != None %} -
Release Date{{ release.release_date }} - {% elif release.release_year != None %} -
Release Year{{ release.release_year }} - {% endif %} - {% if release.container != None and release.container.container_type != None %} -
Container Type{{ release.container.container_type }} - {% endif %} - {% if release.publisher != None %} -
Publisher{{ release.publisher }} - {% endif %} - {% if release.language != None %} -
Primary Language{{ release.language }} - (lookup) - {% endif %} + {% endif %}. -
-
+

+ {% if release.volume != None %} + Volume {{ release.volume }} + {%- if release.issue != None %}, {% endif %} + {% endif %} + {% if release.issue != None %} + Issue {{ release.issue}} + {% endif %} + {% if release.pages != None %} + {% if release.pages[0].isdigit() %}p{% endif -%} + {{ release.pages }} + {% endif %} + {% if release.release_year != None %} + ({{ release.release_year }}) + {% endif %}

+{% if release.abstracts != [] %} +

Abstract

+

{{ release.abstracts[0].content }} +
In {{ release.abstracts[0].mimetype }} format +{% endif %} + {% if entity.state == 'active' %} -

Known Files and URLs

+

Archived Files and Locations

{% if entity.files != [] %} - {% for file in entity.files %} {% for fileset in entity.filesets %}
{% if file.mimetype != None %}{{ file.mimetype }}  {% endif %} {% if file.size != None %}{{ file.size|filesizeformat }}{% endif %}
- {% if file.sha1 != None %}sha1:{{ file.sha1[:20] + "..." }} - {% elif file.sha256!= None %}sha256:{{ file.md5[:20] + "..." }} - {% elif file.md5 != None %}md5:{{ file.md5[:20] + "..." }} - {% endif %} + file_{{ file.ident }}
{% for url in file.urls[:5] %} @@ -208,7 +158,7 @@ accessible version.
{{ fileset.manifest|count }} files  {{ fileset._total_size|filesizeformat }} -
fileset:{{ fileset.ident }} +
fileset_{{ fileset.ident }}
{% for url in fileset.urls[:5] %} {% if url.rel == "dweb" %} @@ -234,7 +184,7 @@ accessible version. {% for webcapture in entity.webcaptures %}
{{ webcapture.original_url }}
{{ webcapture.timestamp.strftime("%Y-%m-%d %H:%M:%S") }} | {{ webcapture.cdx|count }} resources -
webcapture:{{ webcapture.ident }} +
webcapture_{{ webcapture.ident }}
{% for url in webcapture.archive_urls[:5] %} {{ url.url.split('/')[2] }} ({{ url.rel }})
@@ -247,41 +197,42 @@ accessible version.
{% endif %} {% endif %} +
-
-{% if entity.state == 'active' and entity._es and entity._es.best_pdf_url %} -Read Full Text +{% if entity.state == 'active' and entity._es and entity._es.ia_pdf_url %} + + Read Archived PDF + {% elif entity.state == 'active' and entity.webcaptures != [] and entity.webcaptures[0].archive_urls != [] and entity.webcaptures[0].archive_urls[0].rel == "wayback" %} -View Web Archive -{% elif entity.state == 'active' %} -No Full Text Available - - - "Save Paper Now" -
- Know of a fulltext copy of on the public web? Submit a URL and we will archive it -
-
- -{# alternative SPN -
-
- Save Paper Now -
-

Know of a fulltext copy on the public web? Submit a URL and we'll archive it -

-#} + + Visit Web Archive + +{% endif %} -{# alternative SPN -
- Save Paper Now -
know of a fulltext copy on the public web? submit a URL and we'll archive it -
-#} +{% if entity.state == 'active' and entity._es %} + {% if entity._es.preservation == 'bright' %} +
+ Archived +
+ {% elif entity._es.preservation == 'dark' %} +
+ "Dark" Archived +
+ {% else %} +
+ Not Preserved +
+
+ + Save Paper Now! + +

Know of a fulltext copy of on the public web? Submit a URL and we will archive it +

+ {% endif %} {% endif %} {% if release.release_type or release.release_stage or release.release_year %} @@ -305,6 +256,10 @@ accessible version. {% if release.version %} Version   {{ release.version }}
{% endif %} + {% if release.language != None %} + Language   {{ release.language}} + ? + {% endif %}
{% endif %} @@ -357,7 +312,19 @@ accessible version. {% if release.container != None and release.container._es %}
-Container Metadata
+ +{% if release.container.container_type == "journal" %} + Journal Metadata +{% elif release.container.container_type == "proceedings" %} + Proceedings Metadata +{% elif release.container.container_type == "book-series" %} + Book Series Metadata +{% elif release.container.container_type == "blog" %} + Blog Metadata +{% else %} + Container Metadata +{% endif %} +
{% if release.container._es.is_oa == True %} Open Access Publication
{% endif %} @@ -370,7 +337,9 @@ accessible version. {% if release.container._es.in_road == True %} In ISSN ROAD
{% elif release.container._es.in_road == False %} + {# skip 'not in ROAD' display, to reduce UI clutter Not in ISSN ROAD
+ #} {% endif %} {% if release.container._es.any_kbart == True %} In Keepers Registery
@@ -380,19 +349,18 @@ accessible version. {% if release.container.issnl != None %} ISSN-L:  {{ release.container.issnl }}
{% endif %} - Fatcat Entry
{% endif %} -
+
Work Entity -
grouping other versions (eg, pre-print) and variants of this release +
access all versions, variants, and formats of this works (eg, pre-prints)
{% if release.state == "active" and release._can_citeproc %}
- Cite This Release + Cite This
BibTeX -- cgit v1.2.3 From 8274a975d2db3697eb1d69dd22ddcc33592bbbf7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 10:31:08 -0800 Subject: web: release search (SERP) changes - show preservation status instead of fulltext tag - more external identifiers --- python/fatcat_web/templates/entity_macros.html | 29 ++++++++++++++++++++----- python/fatcat_web/templates/release_search.html | 2 +- 2 files changed, 24 insertions(+), 7 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index e68254de..204347cd 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -178,11 +178,20 @@ - {% if paper.best_pdf_url %}
-   fulltext +    + {% if paper.preservation == "bright" %} + {% if paper.best_pdf_url %} + bright archive + {% else %} + bright archive + {% endif %} + {% elif paper.preservation == "dark" %} + dark archive + {% else %} + no archive + {% endif %}
- {% endif %} {# ### AUTHOR ROW #} {% if paper.contrib_names %} @@ -230,15 +239,23 @@ {% if paper.doi %} doi:{{ paper.doi }}   {% endif %} - {% if paper.pmid %} - pmid:{{ paper.pmid }}   - {% endif %} {% if paper.pmcid %} pmcid:{{ paper.pmcid }}   + {% elif paper.pmid %} + pmid:{{ paper.pmid }}   {% endif %} {% if paper.arxiv_id %} arXiv:{{ paper.arxiv_id }}   {% endif %} + {% if paper.jstor_id %} + jstor:{{ paper.jstor_id }}   + {% endif %} + {% if paper.doaj_id %} + doaj:{{ paper.doaj_id }}   + {% endif %} + {% if paper.doaj_id %} + dblp:{{ paper.dblp_id }}   + {% endif %} {# WIP: elastic release work grouping searches
diff --git a/python/fatcat_web/templates/release_search.html b/python/fatcat_web/templates/release_search.html index b1021322..4de56fa2 100644 --- a/python/fatcat_web/templates/release_search.html +++ b/python/fatcat_web/templates/release_search.html @@ -24,7 +24,7 @@
- +

Can also lookup by identifier or search for containers (eg, journals).
-- cgit v1.2.3 From 7b5a8c3ae5d9f868a3ba8fae75554c02a2d9f30e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 11:04:39 -0800 Subject: web: fix editgrouop action/help overlap --- python/fatcat_web/templates/editgroup_view.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index dc18f9d3..c4f23066 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -20,7 +20,7 @@
- +
{% endif %}
@@ -81,14 +81,17 @@

Editgroup editgroup_{{ editgroup.editgroup_id }}

-{% endblock %} +{% if not auth_to.submit %} +
What is an editgroup?

An editgroup is a set of entity edits, bundled together into a coherent, reviewable bundle.

+{% endif %} +{% endblock %} -- cgit v1.2.3 From 901e4f4c23398e19e2595c374f2fa45e4773e992 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 11:04:55 -0800 Subject: web: restyle account settings page a bit --- python/fatcat_web/templates/auth_account.html | 30 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/auth_account.html b/python/fatcat_web/templates/auth_account.html index 4a51241a..86b60b25 100644 --- a/python/fatcat_web/templates/auth_account.html +++ b/python/fatcat_web/templates/auth_account.html @@ -8,17 +8,23 @@ Account Settings +

+ editor_{{ current_user.editor_id }}

+ -

Username: {{ current_user.username }} -

Editor Id: {{ current_user.editor_id }} +Edit History - +Comments and Annotation History
+ +

+
-

Change Username

+

Change Username

-
+
@@ -27,7 +33,7 @@
-

Create API Token

+

Create API Token

@@ -40,10 +46,14 @@
-
-

In the future, you will be able to... -

    -
  • Create and manage bot accounts -
+
+
+
+ In the future, you will be able to... +
+
    +
  • Create and manage bot accounts +
+
{% endblock %} -- cgit v1.2.3 From fc9edfb1b65260f41f204d11bf130ceb35cb84e0 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 11:30:18 -0800 Subject: web: reduce flash() usage; have logins redirect --- python/fatcat_web/auth.py | 19 ++++++++++--------- python/fatcat_web/editing_routes.py | 6 +----- python/fatcat_web/routes.py | 5 ++--- python/fatcat_web/templates/base.html | 17 ++++++++++------- python/fatcat_web/web_config.py | 3 +++ 5 files changed, 26 insertions(+), 24 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py index ed9f2252..74b8e2d6 100644 --- a/python/fatcat_web/auth.py +++ b/python/fatcat_web/auth.py @@ -40,7 +40,11 @@ def handle_token_login(token): session['api_token'] = token session['editor'] = editor.to_dict() login_user(load_user(editor.editor_id)) - return redirect("/auth/account") + rp = "/auth/account" + if session.get('next'): + rp = session['next'] + session.pop('next') + return redirect(rp) # This will need to login/signup via fatcatd API, then set token in session def handle_oauth(remote, token, user_info): @@ -71,13 +75,6 @@ def handle_oauth(remote, token, user_info): editor = resp.editor api_token = resp.token - if http_status == 201: - flash("Welcome to Fatcat! An account has been created for you with a temporary username; you may wish to change it under account settings") - flash("You must use the same mechanism ({}) to login in the future".format(remote.name)) - flash("Check out 'The Guide' (linked above) for an editing quickstart tutorial") - else: - flash("Welcome back {}!".format(editor.username)) - # write token and username to session session.permanent = True session['api_token'] = api_token @@ -85,7 +82,11 @@ def handle_oauth(remote, token, user_info): # call login_user(load_user(editor_id)) login_user(load_user(editor.editor_id)) - return redirect("/auth/account") + rp = "/auth/account" + if session.get('next'): + rp = session['next'] + session.pop('next') + return redirect(rp) # XXX: what should this actually be? raise Exception("didn't receive OAuth user_info") diff --git a/python/fatcat_web/editing_routes.py b/python/fatcat_web/editing_routes.py index 8e3b03b0..61aade72 100644 --- a/python/fatcat_web/editing_routes.py +++ b/python/fatcat_web/editing_routes.py @@ -137,11 +137,7 @@ def form_editgroup_get_or_create(api, edit_form): except ApiException as ae: app.log.warning(ae) raise ae - # set this session editgroup_id - flash('Started new editgroup {}'.format( - eg.editgroup_id, - eg.editgroup_id, - )) + # set this session editgroup_id (TODO) return eg def generic_entity_edit(editgroup_id, entity_type, existing_ident, edit_template): diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index 02b5258a..eda947cd 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -3,7 +3,7 @@ import os import json import citeproc_styles from flask import render_template, make_response, send_from_directory, \ - request, url_for, abort, redirect, jsonify, session, flash, Response + request, url_for, abort, redirect, jsonify, session, Response from flask_login import login_required from flask_wtf.csrf import CSRFError @@ -986,7 +986,7 @@ def health_json(): def login(): # show the user a list of login options if not priv_api: - flash("This web interface not configured with credentials to actually allow login (other than via token)") + app.log.warn("This web interface not configured with credentials to actually allow login (other than via token)") return render_template('auth_login.html') @app.route('/auth/ia/login', methods=['GET', 'POST']) @@ -1026,7 +1026,6 @@ def change_username(): # update our session session['editor'] = editor.to_dict() load_user(editor.editor_id) - flash("Username updated successfully") return redirect('/auth/account') @app.route('/auth/create_token', methods=['POST']) diff --git a/python/fatcat_web/templates/base.html b/python/fatcat_web/templates/base.html index 8cdc3fbf..73f33d0d 100644 --- a/python/fatcat_web/templates/base.html +++ b/python/fatcat_web/templates/base.html @@ -101,14 +101,17 @@
{% with messages = get_flashed_messages() %} {% if messages %} -
+
{# Needs more javascript: #} -
Flash Message!
-
    - {% for message in messages %} -
  • {{ message|safe }} - {% endfor %} -
+ {% if messages|length == 1 %} +
{{ messages[0]|safe }}
+ {% else %} +
    + {% for message in messages %} +
  • {{ message|safe }} + {% endfor %} +
+ {% endif %}
{% endif %} {% endwith %} diff --git a/python/fatcat_web/web_config.py b/python/fatcat_web/web_config.py index 22a704d9..5d2da830 100644 --- a/python/fatcat_web/web_config.py +++ b/python/fatcat_web/web_config.py @@ -60,6 +60,9 @@ class Config(object): WTF_CSRF_CHECK_DEFAULT = False WTF_CSRF_TIME_LIMIT = None + # for login redirects + USE_SESSION_FOR_NEXT = True + if FATCAT_DOMAIN == "dev.fatcat.wiki": # "Even more verbose" debug options #SQLALCHEMY_ECHO = True -- cgit v1.2.3 From 0880e0ecca4e65fd00a4ffafec948873be45193e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 12:02:08 -0800 Subject: web: refactor container SERP rows into macro --- python/fatcat_web/templates/container_search.html | 1 + python/fatcat_web/templates/entity_macros.html | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/container_search.html b/python/fatcat_web/templates/container_search.html index bd92dc2b..0c7823b1 100644 --- a/python/fatcat_web/templates/container_search.html +++ b/python/fatcat_web/templates/container_search.html @@ -35,6 +35,7 @@ {{ search_macros.top_results(query, found) }} {% for entity in found.results %} + {{ entity_macros.container_search_result_row(entity) }}

{{ entity['name'] }} diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 204347cd..45f00362 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -265,6 +265,26 @@

{% endmacro %} + +{% macro container_search_result_row(entity) -%} +
+

+ {{ entity['name'] }} + {% if entity.is_oa %}{% endif %} +

+ {% if entity.publisher %} +
{{ entity.publisher }}
+ {% endif %} + {% if entity.issnl %} + issn:{{ entity.issnl }} + {% endif %} + {% if entity.container_type %} +  {{ entity.container_type }} + {% endif %} +
+{% endmacro %} + + {% macro progress_color(frac) -%} {% if frac >= 1 %} green -- cgit v1.2.3 From 7850ce229de7c817c04509ddc8339a7934774c06 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 12:02:49 -0800 Subject: web: try container search along with release for generic queries --- python/fatcat_web/routes.py | 15 ++++++++++++--- python/fatcat_web/templates/release_search.html | 10 ++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index eda947cd..7cf1f854 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -685,7 +685,7 @@ def generic_search(): if len(query.split()) != 1: # multi-term? must be a real search - return redirect(url_for('release_search', q=query)) + return redirect(url_for('release_search', q=query, generic=1)) if clean_doi(query): return redirect(url_for('release_lookup', doi=clean_doi(query))) @@ -704,7 +704,7 @@ def generic_search(): if clean_orcid(query): return redirect(url_for('creator_lookup', orcid=clean_orcid(query))) - return redirect(url_for('release_search', q=query)) + return redirect(url_for('release_search', q=query, generic=1)) @app.route('/release/search', methods=['GET', 'POST']) def release_search(): @@ -712,12 +712,21 @@ def release_search(): if 'q' not in request.args.keys(): return render_template('release_search.html', query=ReleaseQuery(), found=None) + container_found = None + if request.args.get('generic'): + container_query = GenericQuery.from_args(request.args) + container_query.limit = 1 + try: + container_found = do_container_search(container_query) + except Exception: + pass + query = ReleaseQuery.from_args(request.args) try: found = do_release_search(query) except FatcatSearchError as fse: return render_template('release_search.html', query=query, es_error=fse), fse.status_code - return render_template('release_search.html', query=query, found=found) + return render_template('release_search.html', query=query, found=found, container_found=container_found) @app.route('/container/search', methods=['GET', 'POST']) def container_search(): diff --git a/python/fatcat_web/templates/release_search.html b/python/fatcat_web/templates/release_search.html index 4de56fa2..59a234c0 100644 --- a/python/fatcat_web/templates/release_search.html +++ b/python/fatcat_web/templates/release_search.html @@ -35,6 +35,16 @@

+{% if container_found and container_found.results %} +
+
Were you looking for this journal, instead of publications?
+
+ {{ entity_macros.container_search_result_row(container_found.results[0]) }} +
+
+
+{% endif %} + {% if found %} {% if found.results %} -- cgit v1.2.3 From b56f69e94c899761c144cdbb78170f3622af7d0b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 12:15:40 -0800 Subject: web: fix container search --- python/fatcat_web/templates/container_search.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/container_search.html b/python/fatcat_web/templates/container_search.html index 0c7823b1..ec25fa8d 100644 --- a/python/fatcat_web/templates/container_search.html +++ b/python/fatcat_web/templates/container_search.html @@ -1,3 +1,4 @@ +{% import "entity_macros.html" as entity_macros %} {% import "search_macros.html" as search_macros %} {% extends "base.html" %} @@ -18,7 +19,7 @@
- +

Can also lookup by identifier or search releases.
-- cgit v1.2.3 From 5c88e4a883bfda83394bd9b6982c2f7bdaaad8c2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 13:35:15 -0800 Subject: web: improve editgroup display/form/submit --- python/fatcat_web/templates/editgroup_view.html | 96 +++++++++++++++++-------- 1 file changed, 68 insertions(+), 28 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index c4f23066..6a9793f7 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -51,33 +51,6 @@ {# extended by changelog_entry #} {% block editgroupheader %} -{% if not editgroup.changelog_index %} -
- {% if auth_to.accept %} - - - -
- {% endif %} - {% if auth_to.submit %} - {% if editgroup.submitted %} -
- - -
-
- - - - {% else %} -
- - - - {% endif %} - {% endif %} -
-{% endif %}

Editgroup editgroup_{{ editgroup.editgroup_id }}

@@ -91,6 +64,73 @@

An editgroup is a set of entity edits, bundled together into a coherent, reviewable bundle.

{% endif %} + +
+ + {% if editgroup.changelog_index %} + {% set editing_status = "completed" %} + {% set submit_status = "completed" %} + {% set accept_status = "completed" %} + {% elif editgroup.submitted %} + {% set editing_status = "completed" %} + {% set submit_status = "completed" %} + {% set accept_status = "active" %} + {% else %} + {% set editing_status = "completed" %} + {% set submit_status = "active" %} + {% set accept_status = "" %} + {% endif %} + +
+
+
+ {% if not editgroup.changelog_index and auth_to.submit and editgroup.submitted %} +
+ + + + {% else %} + Edit + {% endif %} +
+
Make changes to entities
+
+
+ +
+
+
+ {% if not editgroup.changelog_index and auth_to.submit and not editgroup.submitted %} +
+ + + + {% else %} + Submitted + {% endif %} +
+
For review and feedback from others
+
+
+ +
+
+
+ {% if not editgroup.changelog_index and auth_to.accept %} +
+ + + + {% else %} + Accepted + {% endif %} +
+
Changes added to catalog
+
+
+ +
+ {% endblock %}
@@ -195,7 +235,7 @@ Markdown is allowed

-- cgit v1.2.3 From 61e8e3f308c908b526270648a74823cbcb361308 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 26 Feb 2021 13:58:18 -0800 Subject: web: improve edit form navigation --- python/fatcat_web/templates/container_edit.html | 9 ++------- python/fatcat_web/templates/edit_macros.html | 15 ++++++++++++++- python/fatcat_web/templates/entity_delete.html | 3 +++ python/fatcat_web/templates/entity_edit_toml.html | 7 +++---- python/fatcat_web/templates/file_edit.html | 9 ++------- python/fatcat_web/templates/release_edit.html | 2 ++ 6 files changed, 26 insertions(+), 19 deletions(-) (limited to 'python/fatcat_web/templates') diff --git a/python/fatcat_web/templates/container_edit.html b/python/fatcat_web/templates/container_edit.html index 99f77d53..1885197c 100644 --- a/python/fatcat_web/templates/container_edit.html +++ b/python/fatcat_web/templates/container_edit.html @@ -2,19 +2,14 @@ {% extends "base.html" %} {% block body %} + {% block edit_form_prefix %} +{{ edit_macros.edit_link_bar('container', existing_ident, 'form') }}

Edit Container Entity

-

Experienced users can also use the TOML editing form to access all metadata - fields in a raw format. - {% if not editgroup %} - You can also delete this entity. - {% endif %} {% endblock %}

See the catalog diff --git a/python/fatcat_web/templates/edit_macros.html b/python/fatcat_web/templates/edit_macros.html index d4839373..a7cf725b 100644 --- a/python/fatcat_web/templates/edit_macros.html +++ b/python/fatcat_web/templates/edit_macros.html @@ -1,4 +1,17 @@ +{% macro edit_link_bar(entity_type, existing_ident, view) -%} + {% set has_form = entity_type in ['release', 'file', 'container'] %} +

+{% endmacro %} + + {% macro form_field_errors(field) -%} {% if field.errors %}
@@ -71,7 +84,7 @@