Browse Source

add tab options

Kevin 4 years ago
parent
commit
bf03d86d95

+ 10 - 4
web/app/themes/la_mine/accueil.php

@@ -2,9 +2,15 @@
 /**
  * template name: Accueil
  */
+use Timber\Post;
+use Timber\Timber;
 
-$context = Timber::context();
+$context         = Timber::get_context();
+$post            = new Post();
+$context['post'] = $post;
 
-$timber_post     = new Timber\Post();
-$context['post'] = $timber_post;
-Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'accueil.twig' ), $context );
+$args = 'post_type=post&numberposts=3&orderby=date';
+
+$context['posts'] = Timber::get_posts( $args );
+
+Timber::render(['accueil.twig'], $context);

+ 21 - 0
web/app/themes/la_mine/functions.php

@@ -19,6 +19,27 @@ if ( file_exists( $composer_autoload ) ) {
 	$timber = new Timber\Timber();
 }
 
+
+if( function_exists('acf_add_options_page') ) {
+
+   acf_add_options_page(array(
+      'page_title'   => 'Information',
+      'menu_title'   => 'Information',
+      'icon_url'    => 'dashicons-buddicons-activity',
+      'capability' => 'edit_posts',
+      'redirect'     => false
+   ));
+
+  acf_add_options_page(array(
+     'page_title'   => 'Partenaires',
+     'menu_title'   => 'Partenaires',
+     'icon_url'    => 'dashicons-buddicons-activity',
+     'capability' => 'edit_posts',
+     'redirect'     => false
+  ));
+}
+
+
 /**
  * This ensures that Timber is loaded and available as a PHP class.
  * If not, it gives an error message to help direct developers on where to activate

+ 103 - 37
web/app/themes/la_mine/templates/accueil.twig

@@ -3,46 +3,112 @@
 {% block content %}
 {% include 'components/title_page.twig' %}
 
-<div class="content">
-			<section class="hero">
-				<h1 class="titre">{{ post.meta('titre') }}</h1>
-				<div class="sous_titre">
-     			<h2 class="texte_chapeau">{{ post.meta('sous_titre') }}</h2>
- 				</div>
-				<div class="slide_image">
-					{% for item in post.meta('slide_image') %}
-						<div class="images"><img src="{{ Image(item.image).src }}" /></div>
-					{% endfor %}
+<section>
+	<div class="hero">
+		<div class="__head">
+			<h1 class="__titre">{{ post.meta('titre') }}</h1>
+			<div class="__sous_titre">
+				<h2>{{ post.meta('sous_titre') }}</h2>
+			</div>
+		</div>
+		<div class="slide">
+			{% for item in post.meta('slide_image') %}
+				<div class="image">
+					<img src="{{ Image(item.image).src }}" />
 				</div>
-			</section>
-			<section class="prochainement"></section>
-			<section class="association">
-				<section class="article-content">
-						<h2 class="texte_chapeau">{{ post.meta('texte_chapeau_asso') }}</h2>
-						<div class="image_sectionasso">
-							<img src="{{ Image(post.meta('image')).src }}" />
-						</div>
-						<div class="article-body">
-							{{ post.meta('paragraphe_descriptif') }}
-							{{ post.meta('paragraphe_descriptif_2') }}
+			{% endfor %}
+		</div>
+	</div>
+</section>
+
+<section>
+	<div class="coming_soon">
+	{% for item in posts %}
+		{% include 'components/thumbnails/thumbnails.twig' %}
+	{% endfor %}
+	</div>
+</section>
+
+<section>
+	<div class="association">
+
+		<div class="__header">
+			<h2>{{ post.meta('texte_chapeau_asso') }}</h2>
+		</div>
+
+		<div class="__body">
+			<div class="image_sectionasso">
+				<img src="{{ Image(post.meta('image')).src }}" />
+			</div>
+			<div class="content">
+			<div class="col-1">
+				{{ post.meta('paragraphe_descriptif') }}
+			</div>
+			<div class="col-2">
+				{{ post.meta('paragraphe_descriptif_2') }}
+				<div class="btn redirection_page">
+				{% include 'components/buttons/bouton_ensavoir.html.twig' %}
+				</div>
+			</div>
+			</div>
+		</div>
+
+	</div>
+</section>
+
+<section>
+	<div class="projet">
+		<div class="__header">
+			<h2 class="texte_chapeau">{{ post.meta('texte_chapeau_projet') }}</h2>
+		</div>
+		<div class="__body">
+			<div class="wrapper__content">
+				{% for item in seq %}
+				    <div class="__head">
+
+				    </div>
+						<div class="__content">
+
 						</div>
-						<div class="redirection_page">
-						{% include 'components/buttons/bouton_ensavoir.html.twig' %}
+				{% endfor %}
+			</div>
+		</div>
+	</div>
+</section>
+
+
+<section>
+	<div class="projet">
+		<div class="__header">
+			<h2 class="texte_chapeau">{{ post.meta('texte_chapeau_projet') }}</h2>
+		</div>
+		<div class="__body">
+			<div class="wrapper__content">
+				{% for item in seq %}
+				    <div class="__head">
+
+				    </div>
+						<div class="__content">
+
 						</div>
-				</section>
-			</section>
-			<section class="section_projet">
-				<section class="article-content">
-					<h2 class="texte_chapeau">{{ post.meta('texte_chapeau_projet') }}</h2>
-				</section>
-				<section class="section_temps_forts"></section>
-				<section class="mine_en_video">
-					<section class="article-content">
-							<div class="video_lamine">
-								{{video_la_mine}}
-							</div>
-					</section>
-				</section>
+				{% endfor %}
+			</div>
+		</div>
+	</div>
+</section>
+
+
+<section>
+	<div class="video">
+		<div class="__header">
+			<h2 class="texte_chapeau">{{ post.meta('texte_chapeau_projet') }}</h2>
+		</div>
+		<div class="__body">
+			<div class="wrapper__content">
+				{{video_la_mine}}
+			</div>
+		</div>
 	</div>
+</section>
 
 {% endblock %}

+ 1 - 33
web/app/themes/la_mine/templates/agenda.twig

@@ -4,39 +4,7 @@
 	<section>
 		<div>
 		{% for item in posts %}
-			<div class="item thumbnails">
-				<div class="__cat">
-					<div class="img__cat">
-						<img src="" alt="">
-					</div>
-				</div>
-
-				<div class="__images">
-					<div class="__img">
-						<img src="" alt="">
-					</div>
-				</div>
-
-				<div class="wrap__content">
-					<div class="__title">{{posts.title}}</div>
-					<div class="__content">
-						<div class="__date">
-							<div class="__day">
-								<time>{{item.date_de_levenement}}</time>
-							</div>
-							<div class="__hour">
-								<span class="start">
-									<time>{{item.horaires_horaire_de_debut}}</time>
-								</span>
-								<span class="end">
-									<time>{{item.horaires_horaire_de_fin}}</time>
-								</span>
-							</div>
-						</div>
-						<div class="lieu">{{item.lieu}}</div>
-					</div>
-				</div>
-			</div>
+			{% include 'components/thumbnails/thumbnails.twig' %}
 		{% endfor %}
 		</div>
 	</section>

+ 34 - 0
web/app/themes/la_mine/templates/components/thumbnails/thumbnails.twig

@@ -0,0 +1,34 @@
+<div class="item thumbnails">
+  <div class="__cat">
+    <div class="img__cat">
+      <img src="" alt="">
+    </div>
+  </div>
+
+  <div class="__images">
+    <div class="__img">
+      <img src="" alt="">
+    </div>
+  </div>
+
+  <div class="wrap__content">
+    <div class="__title">{{posts.title}}</div>
+    <div class="__content">
+      <div class="__date">
+        <div class="__day">
+          <time>{{item.date_de_levenement}}</time>
+        </div>
+        <div class="__hour">
+          <span class="start">
+            <time>{{item.horaires_horaire_de_debut}}</time>
+          </span>
+          <span class="end">
+            <time>{{item.horaires_horaire_de_fin}}</time>
+          </span>
+        </div>
+      </div>
+      <div class="lieu">{{item.lieu}}</div>
+    </div>
+  </div>
+
+</div>