Skip to content

Commit

Permalink
Merge branch 'release/1.2.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
GregLeBarbar committed Oct 16, 2018
2 parents 6ae860f + 332bf7a commit 6f34329
Show file tree
Hide file tree
Showing 31 changed files with 265 additions and 121 deletions.
10 changes: 9 additions & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<div id="primary" class="content-area">
<main id="main" class="site-main">

<section class="error-404 not-found">
<div class="page-content container">
<h1 class="h3 text-center"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'epfl' ); ?></h1>
</div><!-- .page-content -->
</section><!-- .error-404 -->

<?php /* keep it as referenced of the default theme design
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'epfl' ); ?></h1>
Expand Down Expand Up @@ -42,7 +49,7 @@
</div><!-- .widget -->
<?php
/* translators: %1$s: smiley */
// translators: %1$s: smiley
$epfl_archive_content = '<p>' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'epfl' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', 'dropdown=1', "after_title=</h2>$epfl_archive_content" );
Expand All @@ -51,6 +58,7 @@
</div><!-- .page-content -->
</section><!-- .error-404 -->
*/?>

</main><!-- #main -->
</div><!-- #primary -->
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@

# CHANGELOG

*1.2.11* (2018-10-16)
- Fix infoscience search warnings (#116)
- Allow to set multiple columns on people render (#110)
- Move from a clickable card to a static card with links (#115)
- Simplify the 404 page (#113)
- Add shortcode preview translations (#112)
- Add contact render (#108)
- Print image from id, not form an url (#107)
- Add and change containers margin to my-3 (#106)
- Allow to print multiple cards (#105)

*1.2.10* (2018-10-04)
- fix epfl-cover: check if description exists
- epfl-social: render HTML
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.10
1.2.11
Binary file modified languages/fr_FR.mo
Binary file not shown.
14 changes: 10 additions & 4 deletions languages/fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: epfl\n"
"POT-Creation-Date: 2018-10-04 13:01+0200\n"
"PO-Revision-Date: 2018-10-04 13:02+0200\n"
"PO-Revision-Date: 2018-10-09 17:53+0200\n"
"Last-Translator: Charmier Grégory <[email protected]>\n"
"Language-Team: \n"
"Language: fr_FR\n"
Expand Down Expand Up @@ -275,6 +275,15 @@ msgstr ""
msgid "School"
msgstr ""

msgid "Map"
msgstr "Plan"

msgid "Social feed"
msgstr "Réseaux sociaux"

msgid "Infoscience search"
msgstr "Recherche Infoscience"

#~ msgid "at publisher"
#~ msgstr "Consulter chez l'éditeur"

Expand Down Expand Up @@ -329,9 +338,6 @@ msgstr ""
#~ msgid "Datasets"
#~ msgstr "Echantillons de données"

#~ msgid "Social feed"
#~ msgstr "Réseaux sociaux"

#, fuzzy
#~ msgid "Faculty"
#~ msgstr "Template pour les sites de facultés (avec 4 actualités)"
2 changes: 1 addition & 1 deletion shortcodes/custom_highlight/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
?>

<div class="container-full">
<div class="fullwidth-teaser mt-5 <?php echo $classes; ?>">
<div class="fullwidth-teaser my-3 <?php echo $classes; ?>">
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject" class="cover">
<!-- <picture> -->
<?php // get/slice image informations
Expand Down
13 changes: 3 additions & 10 deletions shortcodes/epfl_card/controller.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@
* 4rth argument is number of arguments the function can accept
**/

add_action('epfl_card_action', 'renderCard', 10, 4);
add_action('epfl_card_action', 'renderCard', 10, 1);

function renderCard ($title, $text, $link, $image) {
function renderCard ($atts) {

if (is_admin()) {

// render placeholder for backend editor
set_query_var('epfl_placeholder_title', 'Card');
get_template_part('shortcodes/placeholder');

} else {

set_query_var('epfl_card_title', $title);
set_query_var('epfl_card_text', $text);
set_query_var('epfl_card_link', $link);
set_query_var('epfl_card_image', $image);
set_query_var('epfl_cards', $atts);
get_template_part('shortcodes/epfl_card/view');

}
}
62 changes: 47 additions & 15 deletions shortcodes/epfl_card/view.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
<?php
$title = get_query_var('epfl_card_title');
$text = get_query_var('epfl_card_text');
$link = get_query_var('epfl_card_link');
$image = get_query_var('epfl_card_image');
?>
$data = get_query_var('epfl_cards');

if (!$data) return true;

<a href="<?php echo esc_url($link) ?>" class="card link-trapeze-horizontal">
<?php if ($image): ?>
<picture class="card-img-top">
<img src="<?php echo esc_url($image) ?>" class="img-fluid" title="<?php echo esc_attr($title) ?>" alt="<?php echo esc_attr($title) ?>" />
</picture>
<?php endif ?>
<div class="card-body">
<h3 class="card-title"><?php echo esc_html($title) ?></h3>
<p><?php echo esc_html($text) ?></p>
$elementCount = 0;
for($i = 1; $i < 4; $i++){
if (strlen(sanitize_text_field($data['title'.$i])) > 0) {
$elementCount++;
}
}
?>
<?php if ($elementCount > 1): ?>
<div class="container my-3">
<div class="card-deck <?php echo ($elementCount < 3) && ($elementCount > 1) ? ' card-deck-line' : '' ?>">
<?php endif ?>
<?php
for($i = 1; $i < 4; $i++):
if ($data['title'.$i]) :
$image = get_post($data['image'.$i]);
?>
<div class="card">
<?php if ($data['image'.$i]): ?>
<a href="<?php echo esc_url($data['url'.$i]) ?: '#' ?>" class="card-img-top">
<picture class="card-img-top">
<?php echo wp_get_attachment_image(
$data['image'.$i],
'thumbnail_16_9_crop', // see functions.php
'',
[
'class' => 'img-fluid',
'title' => $image->post_excerpt
]
) ?>
</picture>
</a>
<?php endif; ?>
<div class="card-body">
<div class="card-title"><a href="<?php echo esc_url($data['url'.$i]) ?: '#' ?>" class="h3"><?php echo esc_html($data['title'.$i]) ?: '' ?></a></div>
<p><?php echo wp_kses_post(urldecode($data['content'.$i])) ?: '' ?></p>
</div>
</div>
<?php
endif;
endfor;
?>
<?php if ($elementCount > 1): ?>
</div>
</a>
</div>
<?php endif ?>
19 changes: 19 additions & 0 deletions shortcodes/epfl_contact/controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* 3rd argument is the priority, higher means executed first
* 4rth argument is number of arguments the function can accept
**/

add_action('epfl_contact_action', 'renderContact', 10, 1);

function renderContact($args) {
if (is_admin()) {
// render placeholder for backend editor
set_query_var('epfl_placeholder_title', 'Contact');
get_template_part('shortcodes/placeholder');
} else {
set_query_var('epfl_contact-data', $args);
get_template_part('shortcodes/epfl_contact/view');
}
}
41 changes: 41 additions & 0 deletions shortcodes/epfl_contact/view.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
$data = get_query_var('epfl_contact-data');
$gray_wrapper = $data['gray_wrapper'];
?>

<div class="container-full <?php echo ($gray_wrapper) ? 'bg-gray-100 py-2 my-5' : 'my-3'; ?>">
<?php if ($gray_wrapper): ?>
<div class="bg-white p-4 p-md-5">
<?php endif; ?>
<div class="row">
<div class="col-md-6">
<h3>Contact</h3>
<p><?php esc_html_e($data['introduction']) ?></p>

<?php for ($i=1; $i < 5; $i++): ?>
<?php if ($data['timetable'.$i]): ?>
<div class="card card-body card-sm mb-2 flex-row flex-wrap justify-content-between justify-content-sm-start">
<div class="mr-3 w-sm-50"><?php echo $data['timetable'.$i] ?: '' ?></div>
</div>
<?php
endif;
endfor;
?>
<?php for ($i=1; $i < 4; $i++): ?>
<?php if ($data['information'.$i]): ?>
<p><?php echo wp_kses_post(urldecode($data['information'.$i])) ?: '' ?></p>
<?php if ($data['information'.($i+1)]): ?>
<hr>
<?php endif; ?>
<?php
endif;
endfor;
?>
</div>
<?php if ($data['map_query']): ?>
<div class="col-md-6 d-flex flex-column">
<?php echo do_shortcode( '[epfl_map lang="' .pll_current_language(). '" query="'. $data['map_query'] .'"]' ); ?>
<?php endif; ?>
</div>
<?php if ($gray_wrapper): ?></div><?php endif; ?>
</div>
14 changes: 11 additions & 3 deletions shortcodes/epfl_cover/view.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
$image = get_query_var('epfl_cover_image');
?>

<div class="container">
<div class="container my-3">
<figure class="cover">
<picture>
<img src="<?php echo esc_url($image) ?>" class="img-fluid" alt="<?php echo esc_attr($description) ?>">
</picture>
<?php echo wp_get_attachment_image(
$image,
'thumbnail_16_9_crop', // see functions.php
'',
[
'class' => 'img-fluid',
'alt' => esc_attr($description)
]
) ?>
</picture>
<?php if (!empty($description)): ?>
<figcaption>
<button
Expand Down
2 changes: 1 addition & 1 deletion shortcodes/epfl_map/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$map_url = 'https://plan.epfl.ch/iframe/?q=' . $query . '&amp;lang=' . $lang . '&amp;map_zoom=10';

?>
<div class="container">
<div class="container my-3">
<div class="embed-responsive embed-responsive-16by9">
<iframe
frameborder="0"
Expand Down
4 changes: 2 additions & 2 deletions shortcodes/epfl_memento/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<?php if ("1" === $template or "2" === $template): // TEMPLATE SLIDER ?>

<div class="container-full overflow-hidden">
<div class="container-full overflow-hidden my-3">
<div class="container">
<div class="card-slider-wrapper">
<div class="card-slider">
Expand Down Expand Up @@ -125,7 +125,7 @@

<?php elseif ("3" === $template): // TEMPLATE LISTING ?>

<div class="container">
<div class="container my-3">
<div class="row align-items-center">
<div class="col-md-6">
<h2><?php echo esc_html_e('Next events') ?></h2>
Expand Down
4 changes: 2 additions & 2 deletions shortcodes/epfl_news/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
?>

<?php if ("1" == $template): ?>
<div class="container">
<div class="container my-3">
<?php else: ?>
<div class="container-full">
<div class="container-full my-3">
<?php endif ?>
<div class="list-group">
<?php
Expand Down
5 changes: 3 additions & 2 deletions shortcodes/epfl_people/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* 4rth argument is number of arguments the function can accept
**/

add_action('epfl_people_action', 'renderPeople', 10, 1);
add_action('epfl_people_action', 'renderPeople', 10, 2);

function renderPeople ($persons) {
function renderPeople ($persons, $nb_columns) {

if (is_admin()) {

Expand All @@ -18,6 +18,7 @@ function renderPeople ($persons) {
} else {

set_query_var('epfl_people_persons', $persons);
set_query_var('epfl_people_nb_columns', $nb_columns);
get_template_part('shortcodes/epfl_people/view');

}
Expand Down
Loading

0 comments on commit 6f34329

Please sign in to comment.