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

Modelo eventos #473

Merged
merged 2 commits into from
Feb 9, 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
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
62 changes: 62 additions & 0 deletions models/evento.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[model]
name = Evento
label = {{ this.title }}
hidden = no

[children]
enabled = False

[fields.title]
label = Nombre del evento
type = string

[fields.date_start]
label = Fecha de inicio
type = datetime
width = 1/2

[fields.date_end]
label = Fecha de finalizacion
type = datetime
width = 1/2

[fields.image]
label = Imagen del evento
type = select
source = record.attachments.images

[fields.information]
label = Informacion mas detallada del evento (Markdown)
type = markdown

[fields.link]
label = Sitio web del evento (meetup)
type = url
width = 1/2

[fields.featured_photo]
label = Fetured photo
type = url
width = 1/2

[fields.venue]
label = Lugar del evento
type = text
width = 1/2

[fields.address_1]
label = Dirección
type = text
width = 1/2

[fields.attach]
label = Attachments
type = markdown

[fields.youtube]
type = text

[fields.talks]
label = Talks
type = flow
flow_blocks = talk
13 changes: 13 additions & 0 deletions models/eventos.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[model]
name = Eventos
label = Eventos
hidden = no
inherits = page

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

[pagination]
enabled = yes
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>
54 changes: 54 additions & 0 deletions templates/evento.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% extends "page.html" %}

{% 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>
{% 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>
</div>
{% endblock %}
59 changes: 59 additions & 0 deletions templates/eventos.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% extends "page.html" %}

{% block main %}
<div class="container">
{{this.body}}

<div class="meetup-events">
{% for element in this.children %}
<div class="card mb-3">
<div class="row g-0">
<div class="col-md-3">
<img src='{{ element.featured_photo
if element.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='{{ element|url }}'>
{{ element.title }}
</a>
</h3>
<div class=event-details>
{% if element.venue %}
<div class="venue">
<strong>{{ element.venue }}</strong>
{% if element.address_1 %}
<span>{{ element.address_1 }}</span>
{% endif %}
</div>
{% endif %}
<div class="date">
{% 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">
{{ element.attach }}
</div>
</div>
</div>
</div>
</div>
</div>
{% else %}
<div class="panel panel-default">
<div class="panel-body">
{{ this.empty_message }}
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
Loading