Skip to content

Commit

Permalink
Merge pull request #30 from repair-cafe/po-review-fixes
Browse files Browse the repository at this point in the history
Possibility to define default content in theme options
  • Loading branch information
stefina authored Aug 10, 2017
2 parents 7483428 + d520836 commit ac389b6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
6 changes: 5 additions & 1 deletion plugins/liip/repaircafe/components/eventlist/default.htm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ <h3 class="h5">{{ event.title ? event.title : event.cafe.title }}</h3>
</div>
{% else %}
<div class="col-md-6 media mb-3">
<img class="d-flex mr-3 w-25" src="{{ event.cafe.logo.path }}" alt="{{ event.cafe.title }}">
{% if event.cafe.logo is not empty %}
<img class="d-flex mr-3 w-25" src="{{ event.cafe.logo.path }}" alt="{{ event.cafe.title }}">
{% elseif this.theme.repair_cafe_default_logo is not empty %}
<img class="d-flex mr-3 w-25" src="{{ this.theme.repair_cafe_default_logo|media }}" alt="{{ event.cafe.title }}">
{% endif%}
<div class="media-body">
<h3 class="h5"><a href="{{ 'cafe'|page({ slug: event.cafe.slug }) }}">{{ event.cafe.title }}{{ event.title ? ': ' ~ event.title }}</a></h3>
{% partial __SELF__ ~ '::date' start=event.start end=event.end %}
Expand Down
3 changes: 3 additions & 0 deletions plugins/liip/repaircafe/lang/de/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,15 @@
'fields' => [
'site_title' => 'Seitentitel',
'contact_email' => 'Kontakt Email-Adresse',
'repair_cafe_default_image' => 'Standard Repair Café Bild',
'repair_cafe_default_logo' => 'Standard Repair Café Logo',
'social_facebook' => 'Facebook Page',
'social_twitter' => 'Twitter Page',
'social_googleplus' => 'Google+ Page',
'tab' => [
'general' => 'Allgemein',
'social_media' => 'Social Media',
'default_content' => 'Standardcontent',
],
],
],
Expand Down
12 changes: 12 additions & 0 deletions themes/repair-cafe/config/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ tabs:
span: full
type: text
tab: 'liip.repaircafe::lang.theme.fields.tab.general'
repair_cafe_default_image:
label: 'liip.repaircafe::lang.theme.fields.repair_cafe_default_image'
span: left
type: mediafinder
mode: image
tab: 'liip.repaircafe::lang.theme.fields.tab.default_content'
repair_cafe_default_logo:
label: 'liip.repaircafe::lang.theme.fields.repair_cafe_default_logo'
span: right
type: mediafinder
mode: image
tab: 'liip.repaircafe::lang.theme.fields.tab.default_content'
social_facebook:
label: 'liip.repaircafe::lang.theme.fields.social_facebook'
span: full
Expand Down
15 changes: 13 additions & 2 deletions themes/repair-cafe/pages/cafe.htm
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,23 @@
==
{% put page %}
<div class="events">
{% partial 'components/page-header' title=cafeDetail.cafe.title header_image_url=cafeDetail.cafe.image.path %}
{% if cafeDetail.cafe.image is not empty %}
{% set header_image_url = cafeDetail.cafe.image.path %}
{% elseif this.theme.repair_cafe_default_image is not empty %}
{% set header_image_url = this.theme.repair_cafe_default_image|media %}
{% else %}
{% set header_image_url = null %}
{% endif%}
{% partial 'components/page-header' title=cafeDetail.cafe.title header_image_url=header_image_url %}
<div class="page-content">
<div class="container">
<div class="row">
<div class="col-md-3 mb-3">
<img class="img-fluid" src="{{ cafeDetail.cafe.logo.path }}" alt="{{ cafeDetail.cafe.title }}">
{% if cafeDetail.cafe.logo is not empty %}
<img class="img-fluid" src="{{ cafeDetail.cafe.logo.path }}" alt="{{ cafeDetail.cafe.title }}">
{% elseif this.theme.repair_cafe_default_logo is not empty %}
<img class="img-fluid" src="{{ this.theme.repair_cafe_default_logo|media }}" alt="{{ cafeDetail.cafe.title }}">
{% endif%}
</div>
<div class="col-md-9">
{{ cafeDetail.cafe.description|raw }}
Expand Down

0 comments on commit ac389b6

Please sign in to comment.