forked from django-cms/django-cms-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore the old hydroshare plugin and fix some style issues
- Loading branch information
romer8
committed
Mar 25, 2024
1 parent
be5c5f7
commit ba185bd
Showing
5 changed files
with
137 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 3.2 on 2024-03-25 18:36 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('cms', '0022_auto_20180620_1551'), | ||
('backend', '0030_zoterobibliographyresource_is_saving'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='zoterobibliographyresource', | ||
name='cmsplugin_ptr', | ||
), | ||
migrations.DeleteModel( | ||
name='HydroLearnModulesList', | ||
), | ||
migrations.DeleteModel( | ||
name='ZoteroBibliographyResource', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
from cms.models.pluginmodel import CMSPlugin | ||
from django.core.validators import MaxValueValidator, MinValueValidator | ||
from django.db import models | ||
|
||
import uuid | ||
|
||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class HydroShareResource(CMSPlugin): | ||
title = models.CharField(max_length=200, default="resource title") | ||
subtitle = models.CharField(max_length=200, default="resource subtitle") | ||
image = models.CharField(max_length=200, default="https://picsum.photos/200") | ||
width = models.PositiveIntegerField( | ||
default=200, validators=[MinValueValidator(150), MaxValueValidator(400)] | ||
class HydroShareResourceList(CMSPlugin): | ||
user = models.CharField(max_length=200, default="", blank=True) | ||
password = models.CharField(max_length=200, default="", blank=True) | ||
placeholder_image = models.CharField( | ||
max_length=200, default="https://picsum.photos/200" | ||
) | ||
height = models.PositiveIntegerField( | ||
default=200, validators=[MinValueValidator(150), MaxValueValidator(400)] | ||
) | ||
description = models.TextField(default="resource description") | ||
github_url = models.CharField(max_length=200, default="", blank=True) | ||
documentation_url = models.CharField(max_length=200, default="", blank=True) | ||
web_site_url = models.CharField(max_length=200, default="", blank=True) | ||
unique_identifier = models.UUIDField(default=uuid.uuid4, editable=False) | ||
tags = models.CharField(max_length=200, default="") | ||
updated_version = models.IntegerField(default=0, editable=False) | ||
resources = models.JSONField(editable=False, default=dict) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{% load cms_tags sekizai_tags %} | ||
|
||
{% addtoblock "css" %} | ||
<style> | ||
:root { | ||
--image-width: 200px; | ||
--image-height: 200px; | ||
} | ||
|
||
.img-tile{ | ||
object-fit: cover; | ||
} | ||
|
||
.name{ | ||
height: 150px; | ||
cursor: pointer; | ||
} | ||
|
||
/* Hide scrollbar for Chrome, Safari and Opera */ | ||
.name::-webkit-scrollbar { | ||
display: none; | ||
} | ||
|
||
/* Hide scrollbar for IE, Edge and Firefox */ | ||
.name { | ||
-ms-overflow-style: none; /* IE and Edge */ | ||
scrollbar-width: none; /* Firefox */ | ||
} | ||
|
||
.hydroshare_resource{ | ||
box-shadow: 0 1px 10px 0 rgba(0,0,0,0.125), inset 0 0 0 1px rgba(255,255,255,0.75); | ||
border-color: white; | ||
border-bottom: 3px solid #255f9c; | ||
} | ||
.hydroshare_resource:hover, | ||
.hydroshare_resource:focus { | ||
background: #f5f5f5; | ||
border-color: #bebebe; | ||
box-shadow: 0 1px 4px 0 rgba(0,117,180,0.4); | ||
} | ||
.cover-image { | ||
position: relative; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
overflow: hidden; | ||
cursor: pointer; | ||
} | ||
|
||
.cover-image img { | ||
display: block; | ||
width: 100%; | ||
transition: filter 0.5s ease; /* Smooth transition for the filter */ | ||
} | ||
|
||
.learn-more { | ||
position: absolute; | ||
color: white; | ||
padding: 5px 10px; | ||
visibility: hidden; | ||
transition: visibility 0s, opacity 0.5s linear; /* Smooth transition for visibility and opacity */ | ||
opacity: 0; | ||
border-color: #255f9c; | ||
border-radius: 3px; | ||
background: #255f9c; | ||
} | ||
|
||
.cover-image:hover .learn-more { | ||
visibility: visible; | ||
opacity: 1; /* Make it fully opaque on hover */ | ||
} | ||
|
||
.cover-image:hover img { | ||
filter: brightness(50%); /* Darken the image */ | ||
} | ||
.learn-more > a { | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
|
||
</style> | ||
{% endaddtoblock %} | ||
<div> | ||
|
||
</div> | ||
|
||
|
||
<div class="container-hydroshare-resource-list-plugin"> | ||
{% for key, values in instance.resources.items %} | ||
<div class="wrapper-publication-set"> | ||
|
||
|
||
</div> | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters