Compare commits
No commits in common. "905c0c329736358b5554bec005fe438e2968c496" and "6140c1903658b0f88537bbc9ce11bb4031d96cd3" have entirely different histories.
905c0c3297
...
6140c19036
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -10,6 +10,5 @@ init_script.sh
|
|||
.env
|
||||
.env-sample
|
||||
.env-dev
|
||||
.env_dev
|
||||
.env-prod
|
||||
Makefile
|
||||
1294
css/app.css
Normal file
1294
css/app.css
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,6 @@ require_once(__DIR__ . '/includes/errorlog.php');
|
|||
require_once(__DIR__ . '/includes/init.php');
|
||||
require_once(__DIR__ . '/includes/post_types.php');
|
||||
require_once(__DIR__ . '/includes/columns.php');
|
||||
require_once(__DIR__ . '/includes/revue.php');
|
||||
// require_once(__DIR__ . '/includes/taxonomy.php');
|
||||
// require_once(__DIR__ . '/includes/admin.php');
|
||||
// require_once(__DIR__ . '/includes/logos.php');
|
||||
|
|
|
|||
|
|
@ -33,12 +33,10 @@ function carhop_articles_handle_posts_custom_columns($column)
|
|||
|
||||
if ($column == 'revue') {
|
||||
$revue_id = get_field('related_revue', $post_id);
|
||||
if (!isset($revue_id)) {
|
||||
echo '—';
|
||||
} else {
|
||||
$revue_title = get_the_title($revue_id);
|
||||
echo $revue_title;
|
||||
}
|
||||
if (!isset($revue_id)) return;
|
||||
|
||||
$revue_title = get_the_title($revue_id);
|
||||
echo $revue_title;
|
||||
}
|
||||
}
|
||||
add_action('manage_articles_posts_custom_column', 'carhop_articles_handle_posts_custom_columns', 10, 2);
|
||||
|
|
|
|||
|
|
@ -83,12 +83,7 @@ function dynamiques_enqueue_scripts()
|
|||
|
||||
function dynamiques_enqueue_gutenberg_back_styles()
|
||||
{
|
||||
$theme = wp_get_theme();
|
||||
$parent_style = get_template_directory_uri() . '/css/app.css';
|
||||
if (file_exists(get_template_directory() . '/css/app.css')) {
|
||||
wp_enqueue_style('parent-style', $parent_style, array(), $theme->get('Version'));
|
||||
}
|
||||
wp_enqueue_style('tailpress_back', dynamiques_asset('css/app.css'), array('parent-style'));
|
||||
wp_enqueue_style('tailpress_back', dynamiques_asset('css/app.css'), array());
|
||||
}
|
||||
add_action('enqueue_block_editor_assets', 'dynamiques_enqueue_gutenberg_back_styles');
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function dynamiques_create_posttype()
|
|||
'menu_position' => 4,
|
||||
'supports' => array(
|
||||
'title',
|
||||
// 'editor',
|
||||
'editor',
|
||||
'thumbnail',
|
||||
'excerpt',
|
||||
'custom-fields',
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
function dynamiques_revue_save_post($post_id)
|
||||
{
|
||||
$current_revue_ID = $post_id;
|
||||
$post_type = get_post_type($post_id);
|
||||
if ($post_type !== 'revues') return;
|
||||
|
||||
// DE-LINK ARTICLES NOT USED IN THE ACF CHAPTER HANDLER IN REVUE POST ('articles' field)
|
||||
dynamiques_revue_empty_unmapped_articles($current_revue_ID);
|
||||
dynamiques_revue_link_mapped_articles($current_revue_ID);
|
||||
}
|
||||
add_action('acf/save_post', 'dynamiques_revue_save_post', 20);
|
||||
|
||||
|
||||
function dynamiques_revue_empty_unmapped_articles($current_revue_ID)
|
||||
{
|
||||
$articles = get_field('articles', $current_revue_ID);
|
||||
|
||||
// GET ALL ARTICLES RELATED TO THE REVUE AND CHECK IF THEY ARE HANDLED BY THE PARENT REVUE IN THE ARTICLE FIELD
|
||||
|
||||
$articles_related_to_revue = new WP_Query(array(
|
||||
'post_type' => 'articles',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'related_revue',
|
||||
'value' => $current_revue_ID,
|
||||
'compare' => '=',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
$articles_related_to_revue_posts = $articles_related_to_revue->posts;
|
||||
|
||||
|
||||
$articles_related_to_revue_ids = array_map(function ($post) {
|
||||
return $post->ID;
|
||||
}, $articles_related_to_revue_posts);
|
||||
|
||||
$articles_ids = array_map(function ($article) {
|
||||
return $article->ID;
|
||||
}, $articles);
|
||||
|
||||
// GET THE ARTICLES THAT ARE NOT HANDLED BY THE PARENT REVUE IN THE ARTICLE FIELD
|
||||
$unmapped_articles_ids = array_diff($articles_related_to_revue_ids, $articles_ids);
|
||||
|
||||
|
||||
// EMPTY THE ARTICLE FIELD BECAUSE NOT USED BY THE PARENT REVUE
|
||||
|
||||
foreach ($unmapped_articles_ids as $article_id) {
|
||||
update_field('related_revue', null, $article_id);
|
||||
}
|
||||
}
|
||||
|
||||
function dynamiques_revue_link_mapped_articles($current_revue_ID)
|
||||
{
|
||||
$articles = get_field('articles', $current_revue_ID);
|
||||
|
||||
foreach ($articles as $article) {
|
||||
$article_id = $article->ID;
|
||||
$related_revue = get_field('related_revue', $article_id);
|
||||
update_field('related_revue', $current_revue_ID, $article_id);
|
||||
}
|
||||
}
|
||||
|
|
@ -13,9 +13,7 @@
|
|||
@import './components/post-card-dbmod.css';
|
||||
@import './components/news-card.css';
|
||||
|
||||
/* ########### PAGES ############ */
|
||||
@import './pages/single-revues.css';
|
||||
|
||||
/* @import './components/tag-list.css'; */
|
||||
/* ########### LAYOUT ############ */
|
||||
/* @import './layout/nav.css';
|
||||
@import './layout/footer.css';
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
@apply flex gap-16 xl:gap-32;
|
||||
}
|
||||
|
||||
/* &__title {
|
||||
&__title {
|
||||
@apply text-base mb-6 font-bold tracking-wider uppercase nunito;
|
||||
}
|
||||
|
||||
&__subtitle {
|
||||
@apply text-5xl font-normal uppercase;
|
||||
} */
|
||||
}
|
||||
|
||||
.tag-list {
|
||||
@apply flex gap-8 flex-wrap;
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
.page--single-revue {
|
||||
.single-revue__header {
|
||||
@apply bg-carhop-green-700 text-white py-32;
|
||||
|
||||
h1 {
|
||||
@apply text-white uppercase font-medium text-7xl;
|
||||
line-height: 1.2;
|
||||
}
|
||||
&__inner {
|
||||
@apply container mx-auto grid grid-cols-1 md:grid-cols-2 gap-4;
|
||||
}
|
||||
|
||||
.thumbnail-wrapper {
|
||||
img {
|
||||
max-height: 800px;
|
||||
@apply object-contain;
|
||||
}
|
||||
}
|
||||
|
||||
.revue-meta {
|
||||
@apply flex gap-28 mt-12;
|
||||
|
||||
&__label {
|
||||
@apply uppercase font-bold text-lg;
|
||||
letter-spacing: 0.2em;
|
||||
}
|
||||
}
|
||||
|
||||
.revue-issue {
|
||||
@apply flex items-center gap-2;
|
||||
.revue-issue-number {
|
||||
@apply bg-white text-carhop-green-700 px-4 py-2 font-normal h-fit;
|
||||
}
|
||||
}
|
||||
}
|
||||
article {
|
||||
@apply py-12 my-12;
|
||||
.article-title {
|
||||
@apply mb-8;
|
||||
}
|
||||
.article-tags {
|
||||
@apply mb-12;
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 682 KiB |
|
|
@ -1,127 +0,0 @@
|
|||
<?php get_header(); ?>
|
||||
|
||||
<?php
|
||||
|
||||
$current_issue = get_queried_object();
|
||||
|
||||
$issue_related_articles = new WP_Query(array(
|
||||
'post_type' => 'articles',
|
||||
'posts_per_page' => 3,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'related_revue',
|
||||
'value' => $current_issue->ID,
|
||||
'compare' => '=',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
$articles = get_field('articles', $current_issue->ID);
|
||||
|
||||
write_log($articles);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="page--single-revue">
|
||||
<?php if (have_posts()) : ?>
|
||||
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
|
||||
<section class="single-revue__header ">
|
||||
<div class="single-revue__header__inner ">
|
||||
<div class="content">
|
||||
<div class="content-meta">
|
||||
<span class="content-meta__type content-meta__type--revue">Revue</span>
|
||||
</div>
|
||||
<h1> <?php the_title(); ?></h1>
|
||||
<div class="revue-meta">
|
||||
<p class="revue-issue">
|
||||
<span class="revue-issue-label revue-meta__label">Numéro</span>
|
||||
<span class="revue-issue-number revue-meta__value">25</span>
|
||||
</p>
|
||||
<div class="revue-date-info">
|
||||
<p class="revue-date-label revue-meta__label">Publication</p>
|
||||
<time class="revue-publish-date revue-meta__value" datetime="<?php echo get_the_date('Y-m-d'); ?>"><?php echo get_the_date('d F Y'); ?></time>
|
||||
</div>
|
||||
<div class="revue-date-info">
|
||||
<p class="revue-date-label revue-meta__label">Mis à jour</p>
|
||||
<time class="revue-update-date revue-meta__value" datetime="<?php echo get_the_modified_date('Y-m-d'); ?>"><?php echo get_the_modified_date('d F Y'); ?></time>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumbnail-wrapper">
|
||||
<?php the_post_thumbnail('full', ['class' => 'thumbnail']); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<?php if ($issue_related_articles->have_posts()) : ?>
|
||||
<?php while ($issue_related_articles->have_posts()) : $issue_related_articles->the_post(); ?>
|
||||
<?php $terms = get_the_terms($post->ID, 'etiquettes'); ?>
|
||||
|
||||
<article class="single-revue__articles">
|
||||
<h2 class="single-revue__articles__title article-title"> <?php echo get_the_title($article); ?></h2>
|
||||
<ul class="single-revue__articles__tags article-tags">
|
||||
<?php foreach ($terms as $term) : ?>
|
||||
<li class="single-revue__articles__tag article-tag"> <?php echo $term->name; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<p class="single-revue__articles__excerpt"> <?php the_content(); ?></p>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
<!-- <section class="block-dernieres-dynamiques">
|
||||
<div class="block-dernieres-dynamiques__inner">
|
||||
|
||||
|
||||
|
||||
<div class="content-meta">
|
||||
<span class="content-meta__type content-meta__type--revue">Revue</span>
|
||||
</div>
|
||||
|
||||
<div class="block-dernieres-dynamiques__issue-content-wrapper">
|
||||
<div class="block-dernieres-dynamiques__issue-content">
|
||||
|
||||
<h3 class="block-dernieres-dynamiques__issue-title">
|
||||
<?php echo $last_issue->post_title; ?>
|
||||
</h3>
|
||||
<h4 class="block-dernieres-dynamiques__issue-description-title">Édito</h4>
|
||||
<p class="block-dernieres-dynamiques__issue-description">
|
||||
<?php echo $last_issue->post_excerpt; ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="block-dernieres-dynamiques__issue-thumbnail-wrapper">
|
||||
<div class="block-dernieres-dynamiques__issue-thumbnail">
|
||||
<?php echo get_the_post_thumbnail($last_issue->ID, 'full'); ?>
|
||||
</div>
|
||||
<div class="card-background"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</section> -->
|
||||
|
||||
<?php endwhile; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
|
|
@ -30,19 +30,6 @@ module.exports = {
|
|||
...tailpress.colorMapper(
|
||||
tailpress.theme('settings.color.palette', theme)
|
||||
),
|
||||
'carhop-green': {
|
||||
50: '#f1fcf9',
|
||||
100: '#cef9ee',
|
||||
200: '#9df2de',
|
||||
300: '#64e4c9',
|
||||
400: '#34cdb2',
|
||||
500: '#1bb198',
|
||||
600: '#138e7d',
|
||||
700: getBaseColor('carhop-green'), // Base Color
|
||||
800: '#145b52',
|
||||
900: '#164b45',
|
||||
950: '#062d2a',
|
||||
},
|
||||
'carhop-orange': {
|
||||
50: '#fff8eb',
|
||||
100: '#ffebc6',
|
||||
|
|
|
|||
|
|
@ -14,11 +14,6 @@
|
|||
"slug": "primary",
|
||||
"color": "#136F63"
|
||||
},
|
||||
{
|
||||
"name": "Carhop Green",
|
||||
"slug": "carhop-green",
|
||||
"color": "#136f63"
|
||||
},
|
||||
{
|
||||
"name": "Carhop Orange",
|
||||
"slug": "carhop-orange",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user