Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update blog #565

Merged
merged 10 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
496 changes: 277 additions & 219 deletions locale/pt_BR/LC_MESSAGES/django.po

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions src/blog/jinja2/blog/clipping.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@
{% endblock %}

{% block content %}
<div id="blog-area">
<div id="clipping-area">
{% block button %}
{% endblock %}
{% block page_title %}
<h2>{{ _("Clippings") }}</h2>
<h2>{{ _("Clipping") }}</h2>
{% endblock page_title %}
<small id="warning">{{_( "The content below is in the original languages.")}}</small>
{% for clipping in clippings %}
<div class="post">
<div class="clipping">
<h3>{{ clipping.title }}</h3>
<p>{{ clipping.created.date() }} </p>
<small>{{ clipping.created.date().strftime('%d %B %Y') }}</small>
<p>{{ clipping.description }}</p>
<a href="{{ clipping.link }}">{{ clipping.link }}</a>
<br />
<br />
<a href="{{ clipping.file.url }}">{{ _("Download File")}}</a>
<small><a href="{{ clipping.link }}">{{ clipping.link }}</a></small>
{%if clipping.file.url[-3:] == "pdf" %}
<a href="{{ clipping.file.url }}">{{ _("View as PDF")}}</a>
{% elif clipping.file.url[-3:] in ["png","jpg"] %}
<a href="{{ clipping.file.url }}">{{ _("View as JPG")}}</a>
{% else %}
<a href="{{ clipping.file.url }}">{{ _("View File")}}</a>
{% endif %}
</div>
{% endfor %}
</div>
Expand Down
13 changes: 1 addition & 12 deletions src/blog/jinja2/blog/detail.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,13 @@
{% block page_title %}
<h2>{{ post.title }}</h2>
{% endblock page_title %}
<small>
{{ post.created.date() }}
{% if post.categories.count() > 0 %}
| {{ _("Categories:") }}
{% for category in post.categories.all() %}
<a href="{{ url('blog_category',args=[category.name])}}">
{{ category.name }}
</a>
{% endfor %}
{% endif%}
</small>
<div id=post>
<p>{{ post.body |safe }}</p>
{% for image in images %}
<div class="post-image">
<img class="post-image" src="{{ image.file.url }}" />
{% if image.description %}
<h5>{{ image.description }}</h5>
<small>{{ image.description }}</small>
{% endif %}
</div>
{% endfor %}
Expand Down
12 changes: 1 addition & 11 deletions src/blog/jinja2/blog/index.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@
{% block button %}
{% endblock %}
{% block page_title %}
<h2>{{ _("Blog Posts") }}</h2>
<h2>{{ _("Memories") }}</h2>
{% endblock page_title %}
<div id="category-header">
<small>
{{_("Categories:")}}
{% for category in blog_categories %}
<a href="{{ url('blog_category',args=[category.name])}}">
{{ category.name }}
</a>
{% endfor %}
</small>
</div>
<div id="posts-area">
{% include "/blog/post_preview.jinja2" %}
</div>
Expand Down
11 changes: 0 additions & 11 deletions src/blog/jinja2/blog/post_preview.jinja2
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
{% for post in posts %}
<div class="post">
<h3><a href="{{ url('blog_detail', args=[post.pk])}}">{{ post.title }}</a></h3>
<small>
{{ post.created.date() }}
{% if post.categories.count() > 0 %}
| {{ _("Categories:") }}
{% for category in post.categories.all() %}
<a href="{{ url('blog_category', args=[category.name])}}">
{{ category.name }}
</a>
{% endfor %}
{% endif%}
</small>
<p>{{ post.body[:PREVIEW_SIZE] | safe }}... <a href="{{ url('blog_detail', args=[post.pk])}}">{{ _("Read More") }}</a></p>
</div>
{% endfor %}
Expand Down
483 changes: 27 additions & 456 deletions src/blog/migrations/0002_legacy_posts.py

Large diffs are not rendered by default.

193 changes: 103 additions & 90 deletions src/blog/migrations/0005_legacy_clippings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,105 +2,116 @@
import datetime
from zoneinfo import ZoneInfo


def create_initial_clippings(apps, schema_editor):
Clipping = apps.get_model("blog", "Clipping")


timezone = ZoneInfo("America/Sao_Paulo")
initial_clippings = [
{
"id": 1,
"title": "Jandig #CulturaDigitalBR",
"description": "Revista Select",
"created": datetime.datetime(2011,12,12,tzinfo=timezone),
"link":"https://www.select.art.br/jandig-culturadigitalbr/",
"file":"7.-Jandig-CulturaDigitalBR.pdf",
"description": "Select Magazine",
"created": datetime.datetime(2011, 12, 12, tzinfo=timezone),
"link": "https://www.select.art.br/jandig-culturadigitalbr/",
"file": "7.-Jandig-CulturaDigitalBR.pdf",
},
{
{
"id": 2,
"title": "Uma parceria inusitada: MARTE + JANDIG + Escola de Design/UEMG",
"description": "Site Universidade do Estado de Minas Gerais",
"created": datetime.datetime(2019, 7, 22, tzinfo=timezone),
"link": "http://ed.uemg.br/uma-parceria-inusitada-marte-jandig-escola-de-design-uemg/",
"file": "Jandig-UEMG.jpg"
},
{"id": 3,
"title": "Programação formativa do X-Reality contou com workshops de realidade virtual e aumentada",
"description": "Site LabArteMídia",
"created": datetime.datetime(2019, 7, 1, tzinfo=timezone),
"link": "https://sites.usp.br/labartemidia/programacao-formativa-do-x-reality-contou-com-workshops-de-realidade-virtual-e-aumentada/",
"file": "Jandig-LabArteMidia.pdf"
},
{"id": 4,
"title": "Create Art with Augmented Reality",
"description": "Blog Mozilla Open Leaders",
"created": datetime.datetime(2019, 5, 31, tzinfo=timezone),
"link": "https://medium.com/read-write-participate/create-art-with-augmented-reality-e26572524021",
"file": "Jandig-MozOL.pdf"
},
{"id": 5,
"title": "Programação Cultural / Abril de 2017",
"description": "Site Coletivo Digital",
"created": datetime.datetime(2017, 4, 10, tzinfo=timezone),
"link": "http://portalnovo.coletivodigital.org.br/2017/04/",
"file": "1-programacao-cultural-abril-de-2017.pdf"
},
{"id": 6,
"title": "Sesc Sorocaba abre as portas em 1º de setembro com visão sustentável",
"description": "Jornal Diário de Sorocaba",
"created": datetime.datetime(2012, 8, 21, tzinfo=timezone),
"link": "http://www.diariodesorocaba.com.br/noticia/222472",
"file": "2-sesc-Sorocaba-abre-as-portas.pdf"
},
{"id": 7,
"title": "Do artista ao articulador",
"description": "Revista Select",
"created": datetime.datetime(2012, 7, 30, tzinfo=timezone),
"link": "https://www.select.art.br/do-artista-ao-articulador/",
"file": "3.-Do-artista-ao-articulador.pdf"
},
{"id": 8,
"title": "Ráfagas de software libre",
"description": "Jornal 20 Minutos",
"created": datetime.datetime(2012, 7, 30, tzinfo=timezone),
"link": "https://blogs.20minutos.es/codigo-abierto/category/software-libre/",
"file": "9.-Rafagas-de-software-livre.pdf"
},
{"id": 9,
"title": "Conheça o Jandig",
"description": "Site Labmóvel",
"created": datetime.datetime(2012, 3, 31, tzinfo=timezone),
"link": "https://labmovel.net/2012/03/31/conheca-o-jandig/",
"file": "4-conheca-o-Jandig.pdf"
},
{"id": 10,
"title": "Entrevista com Pixel",
"description": "Site Labmóvel",
"created": datetime.datetime(2012, 3, 21, tzinfo=timezone),
"link": "https://labmovel.net/2012/03/21/entrevista-com-pixel/",
"file": "5.-Entrevista-com-Pixel.pdf"
},
{"id": 11,
"title": "Campus Party: hackers, multinacionales y activistas",
"description": "Jornal 20 Minutos",
"created": datetime.datetime(2012, 2, 12, tzinfo=timezone),
"link": "https://blogs.20minutos.es/codigo-abierto/2012/02/12/campus-party-hackers-multinacionales-y-activistas/",
"file": "10.-Campus-Party-hackers-multinacionales-y-activistas.pdf"
},
{"id": 12,
"title": "New artist in residence projects mobile media art",
"description": "Site NIMk",
"created": datetime.datetime(2012, 2, 1, tzinfo=timezone),
"link": "http://www.nimk.nl/eng/new-artist-in-residence-projects-mobile-media-art",
"file": "8.-New-artist-in-residence-projects-mobile-media-art.pdf"
},
{"id": 13,
"title": "Residência artística Labmovel + NimK",
"description": "Site Labmóvel",
"created": datetime.datetime(2012, 2, 1, tzinfo=timezone),
"link": "https://labmovel.net/2012/02/01/residencia-artistica-labmovel-nimk/",
"file": "6-residencia-artistica-labmovel-NimK.pdf"
}
"title": "Uma parceria inusitada: MARTE + JANDIG + Escola de Design/UEMG",
"description": "Estado de Minas Gerais University Website",
"created": datetime.datetime(2019, 7, 22, tzinfo=timezone),
"link": "http://ed.uemg.br/uma-parceria-inusitada-marte-jandig-escola-de-design-uemg/",
"file": "Jandig-UEMG.jpg",
},
{
"id": 3,
"title": "Programação formativa do X-Reality contou com workshops de realidade virtual e aumentada",
"description": "LabArteMídia Website",
"created": datetime.datetime(2019, 7, 1, tzinfo=timezone),
"link": "https://sites.usp.br/labartemidia/programacao-formativa-do-x-reality-contou-com-workshops-de-realidade-virtual-e-aumentada/",
"file": "Jandig-LabArteMidia.pdf",
},
{
"id": 4,
"title": "Create Art with Augmented Reality",
"description": "Mozilla Open Leaders Blog",
"created": datetime.datetime(2019, 5, 31, tzinfo=timezone),
"link": "https://medium.com/read-write-participate/create-art-with-augmented-reality-e26572524021",
"file": "Jandig-MozOL.pdf",
},
{
"id": 5,
"title": "Programação Cultural / Abril de 2017",
"description": "Coletivo Digital Website",
"created": datetime.datetime(2017, 4, 10, tzinfo=timezone),
"link": "http://portalnovo.coletivodigital.org.br/2017/04/",
"file": "1-programacao-cultural-abril-de-2017.pdf",
},
{
"id": 6,
"title": "Sesc Sorocaba abre as portas em 1º de setembro com visão sustentável",
"description": "Sorocaba's Newspaper",
"created": datetime.datetime(2012, 8, 21, tzinfo=timezone),
"link": "http://www.diariodesorocaba.com.br/noticia/222472",
"file": "2-sesc-Sorocaba-abre-as-portas.pdf",
},
{
"id": 7,
"title": "Do artista ao articulador",
"description": "Select Magazine",
"created": datetime.datetime(2012, 7, 30, tzinfo=timezone),
"link": "https://www.select.art.br/do-artista-ao-articulador/",
"file": "3.-Do-artista-ao-articulador.pdf",
},
{
"id": 8,
"title": "Ráfagas de software libre",
"description": "20 Minutos Newspaper",
"created": datetime.datetime(2012, 7, 30, tzinfo=timezone),
"link": "https://blogs.20minutos.es/codigo-abierto/category/software-libre/",
"file": "9.-Rafagas-de-software-livre.pdf",
},
{
"id": 9,
"title": "Conheça o Jandig",
"description": "Labmóvel Website",
"created": datetime.datetime(2012, 3, 31, tzinfo=timezone),
"link": "https://labmovel.net/2012/03/31/conheca-o-jandig/",
"file": "4-conheca-o-Jandig.pdf",
},
{
"id": 10,
"title": "Entrevista com Pixel",
"description": "Labmóvel Website",
"created": datetime.datetime(2012, 3, 21, tzinfo=timezone),
"link": "https://labmovel.net/2012/03/21/entrevista-com-pixel/",
"file": "5.-Entrevista-com-Pixel.pdf",
},
{
"id": 11,
"title": "Campus Party: hackers, multinacionales y activistas",
"description": "20 Minutos Newspaper",
"created": datetime.datetime(2012, 2, 12, tzinfo=timezone),
"link": "https://blogs.20minutos.es/codigo-abierto/2012/02/12/campus-party-hackers-multinacionales-y-activistas/",
"file": "10.-Campus-Party-hackers-multinacionales-y-activistas.pdf",
},
{
"id": 12,
"title": "New artist in residence projects mobile media art",
"description": "NIMk Website",
"created": datetime.datetime(2012, 2, 1, tzinfo=timezone),
"link": "http://www.nimk.nl/eng/new-artist-in-residence-projects-mobile-media-art",
"file": "8.-New-artist-in-residence-projects-mobile-media-art.pdf",
},
{
"id": 13,
"title": "Residência artística Labmovel + NimK",
"description": "Site Labmóvel",
"created": datetime.datetime(2012, 2, 1, tzinfo=timezone),
"link": "https://labmovel.net/2012/02/01/residencia-artistica-labmovel-nimk/",
"file": "6-residencia-artistica-labmovel-NimK.pdf",
},
]

for clipping_data in initial_clippings:
Expand All @@ -121,5 +132,7 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunPython(create_initial_clippings, reverse_code=remove_initial_clippings),
migrations.RunPython(
create_initial_clippings, reverse_code=remove_initial_clippings
),
]
2 changes: 1 addition & 1 deletion src/blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ def __str__(self):
return self.title

def get_absolute_url(self):
return f"/blog/{self.slug}/"
return f"/memories/{self.slug}/"
39 changes: 36 additions & 3 deletions src/blog/static/css/blog.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* General Blog Pages */
#blog-area,
#clipping-area,
#posts-area{
max-width: 600px;
margin: 0 auto;
}
.post{
margin-bottom: 30px;
margin: 0px 1.5em 3em 1.5em;
}
.post a,
#category-header a{

transition: all 0.2s ease-in;
background-image: linear-gradient( to top, #05f7ae, #05f7ae 50%, transparent 50%, transparent );
background-position: 100% 0%;
Expand All @@ -21,9 +22,13 @@
background-position: 0 100%;
}

#blog-area p {
text-align: justify;
margin-left: 1.5em;
}

/* Detail Page */

/* Post Detail Page */
#post,
#post-area{
max-width: 600px;
Expand All @@ -34,6 +39,7 @@
}
#post p{
text-align: justify;
margin: 1.5em 1.5em 0 1.5em;
}
#back-button{
float: left;
Expand All @@ -45,4 +51,31 @@
}
.post-image h5{
margin-top: 10px;
}
.post-image small{
display: block;
}


/* Clipping page */
.clipping{
text-align: left;
margin: 1.5em 1.5em 0 1.5em;
}
.clipping p{
margin: 0;
}
.clipping h3{
margin: 0;
}
.clipping a{
display: inline-block;
margin-bottom: 8px;
}


@media all and (min-width: 800px) {
#blog-area p {
text-align: left;
}
}
Loading
Loading