Skip to content

Commit

Permalink
Modelos de eventos con charla en flowblock
Browse files Browse the repository at this point in the history
  • Loading branch information
Scot3004 committed Feb 8, 2024
1 parent a4434f1 commit c2a9a45
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 44 deletions.
32 changes: 32 additions & 0 deletions flowblocks/talk.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[block]
name = Charla

[fields.title]
label = Nombre
type = string
size = large

[fields.details]
label = Detalles
type = markdown
size = large

[fields.speaker]
label = Ponente
type = select
source = site.query('/nosotros')

[fields.speaker_name]
label = Ponente
addon_label = En caso que el ponente no tenga perfil
type = string

[fields.speaker_bio]
label = Resumen del ponente
type = markdown
size = large

[fields.attach]
label = Anexos
type = markdown
size = large
8 changes: 6 additions & 2 deletions models/evento.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@ label = Attachments
type = markdown

[fields.youtube]
label = youtube
type = url
type = text

[fields.talks]
label = Talks
type = flow
flow_blocks = talk
3 changes: 2 additions & 1 deletion models/eventos.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ hidden = no
inherits = page

[children]
model = evento
order_by = -date_start, title

[pagination]
enabled = yes
per_page = 30
per_page = 30
18 changes: 18 additions & 0 deletions templates/blocks/talk.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h2 class="title">{{ this.title }}</h2>
<div class="details">
{{this.details}}
</div>
<div class="attachments">
{{this.attach}}
</div>
<div class="speaker">
{% if this.speaker %}
{% set speaker = site.get('nosotros/' + this.speaker, alt) %}
<a href="{{ speaker|url }}">{{ speaker.name }}</a>
{% else %}
{{this.speaker_name}}
{% endif %}
</div>
<div class="speaker-bio">
{{this.speaker_bio}}
</div>
80 changes: 43 additions & 37 deletions templates/evento.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,52 @@
{% extends "page.html" %}

{% block main %}
<div class="container">
{{this.body}}
<div class="meetup-events">
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img src='{{ this.featured_photo
if this.featured_photo
else "/img/event-placeholder.jpg" }}'
class="img-fluid rounded-start" alt="...">
</div>
<div class="col-md-9">
<div class="card-body">
<h3 class="card-title">
<a class="text-decoration-none" href='{{ this|url }}'>
{{ this.title }}
</a>
</h3>
<div class=event-details>
{% if this.venue %}
<div class="venue">
<strong>{{ this.venue }}</strong>
{% if this.address_1 %}
<span>{{ this.address_1 }}</span>
{% endif %}
</div>
{% block body %}
<div class="d-flex justify-content-center">
<p><img src='{{ this.featured_photo
if this.featured_photo
else "/img/event-placeholder.jpg" }}'
class="img-fluid rounded-start" alt="..."></p>
</div>
<div class="d-flex justify-content-center">
<div class="blog-post">
<div class="post-meta blog_post-post_meta">
<h1 class="ctitle">{{ this.title }}</h1>
<div id="body-content" class="blog-post-body">
<div class=event-details>
{% if this.venue %}
<div class="venue">
<strong>{{ this.venue }}</strong>
{% if this.address_1 %}
<span>{{ this.address_1 }}</span>
{% endif %}
<div class="date">
{% if alt == 'en' %}
{{ this.date_start | datetimeformat("EEEE, MMMM d, y, H:mm") }}
{% else %}
{{ this.date_start | datetimeformat("EEEE, d 'de' MMMM 'de' y, h:mm a") }}
{% endif %}
</div>
<div class="attach">
{{ this.attach }}
</div>
</div>
{% endif %}
<div class="date">
{% if alt == 'en' %}
{{ this.date_start | datetimeformat("EEEE, MMMM d, y, H:mm") }}
{% else %}
{{ this.date_start | datetimeformat("EEEE, d 'de' MMMM 'de' y, h:mm a") }}
{% endif %}
</div>
<div class="attach">
{{ this.attach }}
</div>
{% if this.youtube %}
<div class="row">
<div class="ratio ratio-16x9">
<iframe src="https://www.youtube.com/embed/{{this.youtube}}?rel=0" allowfullscreen></iframe>
</div>
</div>
{% endif %}
<div class="talks">
{{ this.talks }}
</div>
<a href="{{this.link}}">Meetup</a>
<div class="details">
{{ this.information }}
</div>
</div>
<div class="comments">{{ render_disqus_comments() }}</div>
</div>
</div>
</div>
Expand Down
10 changes: 6 additions & 4 deletions templates/eventos.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ <h3 class="card-title">
</div>
{% endif %}
<div class="date">
{% if alt == 'en' %}
{{ element.date_start | datetimeformat("EEEE, MMMM d, y, H:mm") }}
{% else %}
{{ element.date_start | datetimeformat("EEEE, d 'de' MMMM 'de' y, h:mm a") }}
{% if element.date_start %}
{% if alt == 'en' %}
{{ element.date_start | datetimeformat("EEEE, MMMM d, y, H:mm") }}
{% else %}
{{ element.date_start | datetimeformat("EEEE, d 'de' MMMM 'de' y, h:mm a") }}
{% endif %}
{% endif %}
</div>
<div class="attach">
Expand Down

0 comments on commit c2a9a45

Please sign in to comment.