Skip to content

Commit

Permalink
Merge pull request #2 from Aquaveo/lazy_loading
Browse files Browse the repository at this point in the history
Lazy loading
  • Loading branch information
romer8 authored Mar 25, 2024
2 parents fdc39a2 + a899f3d commit 727bb74
Show file tree
Hide file tree
Showing 20 changed files with 999 additions and 85 deletions.
2 changes: 1 addition & 1 deletion backend/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def create_hydroshare_resources(instance):
try:
# let's call the resources
resources_api = hs.resources(subject=keywords)
# how about "nwm_portal_app" for "Tool Resources that are part of the apps page, and how about "nwm_portal_data" for Data Resources?

resources_model = instance.resources.get("list_resources", [])
# logging.warning(resources_model)

Expand Down
3 changes: 1 addition & 2 deletions backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ZoteroBibliographyResource(CMSPlugin):
is_saving = models.BooleanField(default=False, editable=False)


# @receiver(post_save, sender=ZoteroBibliographyResource)
@receiver(post_save, sender=ZoteroBibliographyResource)
def create_html_citations(sender, instance, *args, **kwargs):
logger.warning("creating_html_citations ")
params = {
Expand All @@ -80,7 +80,6 @@ def create_html_citations(sender, instance, *args, **kwargs):
"linkwrap": 1,
}
try:
time.sleep(5)

zot = zotero.Zotero(
instance.library_id, instance.library_type, instance.api_key
Expand Down
Binary file added backend/static/images/CIROH_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed backend/static/images/ciroh/black_water.jpeg
Binary file not shown.
Binary file removed backend/static/images/ciroh/datasets.jpeg
Binary file not shown.
Binary file removed backend/static/images/ciroh/hydroinformatics.jpeg
Binary file not shown.
Binary file removed backend/static/images/ciroh/water_data.jpeg
Binary file not shown.
Binary file added backend/static/images/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions backend/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<link rel="shortcut icon" type="image/png" href="{% static 'images/favicon.ico' %}"/>

{% block meta %}
<meta name="description" content="{% page_attribute meta_description %}"/>
<meta property="og:type" content="website"/>
Expand Down
12 changes: 1 addition & 11 deletions backend/templates/ciroh.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,7 @@ <h1 class="display-5 fw-bolder mb-2">A Bootstrap 5 template for Tethys</h1>
</div>
<div class="footer__bottom text--center">
<div class="footer__copyright">
<p>Copyright © 2023 2023 Cooperative Institute for Research to Operations in Hydrology</p>
<p class="small-text-footer">
This site is developed and maintained by the
<a href="https://hydroinformatics.byu.edu/" target="_blank" rel="noopener noreferrer" class="footer__link-item">
Brigham Young University Hydroinformatics Lab
</a>

contact us to add your content to this page.
</p>


<p>Copyright © 2024 Cooperative Institute for Research to Operations in Hydrology</p>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion zotero_publications_app/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ def render(self, context, instance, placeholder):
logging.warning("init rendering zotero plugin")
context = super().render(context, instance, placeholder)
logging.warning("finish rendering zotero plugin")

return context
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2 on 2024-03-22 01:25

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('zotero_publications_app', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='zoteropublications',
name='publications',
field=models.JSONField(default=dict, editable=False),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2 on 2024-03-24 21:30

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('zotero_publications_app', '0002_zoteropublications_publications'),
]

operations = [
migrations.AddField(
model_name='zoteropublications',
name='local_remote_version',
field=models.IntegerField(default=0, editable=False),
),
]
5 changes: 4 additions & 1 deletion zotero_publications_app/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from cms.models.pluginmodel import CMSPlugin
from django.db import models
from django.dispatch import receiver
import logging

logger = logging.getLogger(__name__)
Expand All @@ -13,3 +12,7 @@ class ZoteroPublications(CMSPlugin):
library_id = models.CharField(max_length=200, default="")
collection_id = models.CharField(max_length=200, default="", blank=True)
style = models.CharField(max_length=200, default="apa")
publications = models.JSONField(editable=False, default=dict)
local_remote_version = models.IntegerField(
editable=False, default=0
) # This field will be used to store the version of the remote library/collection locally
15 changes: 14 additions & 1 deletion zotero_publications_app/static/css/publications.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,17 @@
}
#placeholder-publications{
margin-top: 20px ;
}
}

@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

/* .fade-in {
animation: fadeIn 1s ease-out;
} */
Loading

0 comments on commit 727bb74

Please sign in to comment.