Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e7da44c
Added Escape Button Functionality
4very Oct 2, 2019
e4d567e
added files to .gitignore
4very Oct 8, 2019
68efe24
added small note on how to change styles on readme and added webpack …
AbigailMedina Oct 15, 2019
7c80472
Merge branch 'master' of https://github.com/thepoly/pipeline into sty…
AbigailMedina Oct 15, 2019
3477fd1
Added lightbox2 to npm dependences
4very Oct 19, 2019
89a694a
lightbox2 galleries implemented
4very Oct 21, 2019
db6326a
Merge remote-tracking branch 'origin/stylingDocumentation' into galle…
4very Oct 21, 2019
f13c992
Cleaned up padding and increased opacity to the background of lightbox
4very Oct 21, 2019
583a304
changed lightbox shade to white and made gallery caption same styling…
4very Oct 21, 2019
3359228
changed the / to be inside of the <i> tags
4very Oct 22, 2019
b95be3e
Added lightbox expand to featured photo
4very Oct 22, 2019
841155e
added lightbox expand to inline photos as well as cleaned up code
4very Oct 22, 2019
c54f34f
Merge branch 'master' into gallery-changes
4very Nov 15, 2019
203f415
Moved js settings from html file to the js file itself
4very Nov 19, 2019
eeecd66
deleted some unused css that was messing with <i> tags
4very Nov 21, 2019
8fb6dd0
added a function to image that adds attribution paragraph tags
4very Nov 21, 2019
e6a91dc
removed lightbox2 from dependencies
4very Nov 21, 2019
fee0f97
removed photo_gallery_controller.js, so long
4very Nov 21, 2019
e1726e4
Merge branch 'master' into gallery-changes
4very Nov 21, 2019
12f093c
fix small attribution in inline images
4very Nov 21, 2019
f219715
applied black
4very Nov 21, 2019
192cf09
Merge branch 'master' into gallery-changes
4very Nov 21, 2019
4e379e9
Merge branch 'master' into gallery-changes
4very Dec 17, 2019
793cb1a
added lightbox2 back to npm
4very Dec 17, 2019
4b941e0
removed lightbox.js
4very Dec 17, 2019
fec858d
removed lightbox.js being called from article_page.html
4very Dec 17, 2019
2fecd2b
added importing of lightbox2 into pipeline.js
4very Dec 17, 2019
bf9f26d
removed unneeded static files
4very Dec 17, 2019
4d0c6ab
removed unneeded load static
4very Dec 17, 2019
9e50447
add .idea to gitignore
4very Dec 17, 2019
e9a14d3
added lightbox css to be imported into the webpack
4very Dec 17, 2019
d16783c
removed all lightbox css from pipeline.scss
4very Dec 17, 2019
f432110
added css overrides to make galleries following the styling of article
4very Dec 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@
.DS_Store
/pipeline-env/
**/__pycache__/**
<<<<<<< HEAD
pipeline\.code-workspace
\.build
Pipeline Session\.sql
run
.gitignore
=======

>>>>>>> stylingDocumentation

\.idea/
14 changes: 14 additions & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,20 @@ def get_attribution_html(self):

return self.photographer.name

def get_attribution_html_caption(self):
if self.photographer is None:
return ""

if hasattr(self.photographer, "staff_page"):
sp = self.photographer.staff_page
return format_html(
'<p class="small text-muted text-nowrap"><a href="{}">{}</a>/<i>The Polytechnic</i></p>',
sp.url,
sp.name,
)

return self.photographer.name


# Delete the source image file when an image is deleted
@receiver(pre_delete, sender=CustomImage)
Expand Down
51 changes: 25 additions & 26 deletions core/templates/core/article_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ <h4 class="article-subdeck mb-4">{{ page.subdeck|richtext_unwrapped }}</h4>
<div class="featured-photo mt-4 mb-4 d-flex flex-column align-items-center">
{% image page.featured_image width-1200 as photo %}
<div class="img-container">
<img class="" src="{{ photo.url }}">

<a class="" href="{{ photo.url }}" data-lightbox="featured"
data-title='{{ page.featured_caption|richtext_unwrapped }} {{ page.featured_image.get_attribution_html_caption }}'>
<img class="image" src="{{ photo.url }}"/>
</a>
</div>
{% if page.featured_caption or photo.image.photographer %}
<div class="meta container mt-1 mb-2">
Expand Down Expand Up @@ -73,7 +75,12 @@ <h4 class="article-subdeck mb-4">{{ page.subdeck|richtext_unwrapped }}</h4>
{% image block.value.image width-2000 as photo %}
{% endif %}

<img class="" src="{{ photo.url }}">
<a class="" href="{{ photo.url }}" data-lightbox={{block.id}}
data-title='{{ block.value.caption.source|richtext_unwrapped }} {{ photo.image.get_attribution_html_caption }}'>


<img class="image" src="{{ photo.url }}"/>
</a>
{% if block.value.caption or photo.image.photographer %}
<div class="meta container mt-1">
{% if block.value.caption %}
Expand All @@ -88,30 +95,20 @@ <h4 class="article-subdeck mb-4">{{ page.subdeck|richtext_unwrapped }}</h4>
{% endif %}
</div>
{% elif block.block_type == 'photo_gallery' %}
<div class="photo-gallery" data-controller="photo-gallery">
<div class="large-photo flex-column" data-target="photo-gallery.largePhoto" data-action="click->photo-gallery#dismissPhoto">
<div class="wrapper">
<div class="img-container d-flex align-items-center justify-content-center">
<img data-target="photo-gallery.largePhotoImg">
</div>
<p>
<span data-target="photo-gallery.largePhotoCaption" class="text-dark"></span>
<span data-target="photo-gallery.largePhotoPhotographer" class="small text-muted"></span>
</p>
</div>
</div>
<div class="container d-flex flex-row justify-content-center flex-wrap mb-n4">
{% for gallery_photo in block.value %}
<div class="photo col-6 col-lg-4 mb-4">
{% image gallery_photo.image fill-600x600 as small_photo %}
{% image gallery_photo.image max-2000x1500 as large_photo %}
<a data-action="photo-gallery#showPhoto mouseover->photo-gallery#hoverPhoto">
<img class="" src="{{ small_photo.url }}" data-target="photo-gallery.photo" data-large-src="{{ large_photo.url }}" data-caption="{{ gallery_photo.caption.source|richtext_unwrapped }}" data-photographer='{{ gallery_photo.image.get_attribution_html }}'>
</a>
</div>
{% endfor %}
<div class="photo-gallery container d-flex flex-row justify-content-center flex-wrap">
{% for gallery_photo in block.value %}
<div class="photo col-6 col-lg-4 mb-4">

{% image gallery_photo.image fill-600x600 as small_photo %}
{% image gallery_photo.image max-2000x1500 as large_photo %}

<a class="" href="{{ large_photo.url }}" data-lightbox={{block.id}}
data-title='{{ gallery_photo.caption.source|richtext_unwrapped }} {{ gallery_photo.image.get_attribution_html_caption }}'>
<img class="gallery" src="{{ small_photo.url }}"/>
</a>
</div>
</div>
{% endfor %}
</div>
{% elif block.block_type == 'embed' %}
{% if block.value.type == 'video' %}
<div class="container-fluid embed video embed-responsive embed-responsive-16by9">
Expand All @@ -128,7 +125,9 @@ <h4 class="article-subdeck mb-4">{{ page.subdeck|richtext_unwrapped }}</h4>
</div>
{% endif %}
{% endfor %}

</div>

</article>

{% if page.get_related_articles %}
Expand Down
Loading