-
Notifications
You must be signed in to change notification settings - Fork 33
/
single-persona_pubblica.php
438 lines (417 loc) · 17.8 KB
/
single-persona_pubblica.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<?php
/**
* Persona pubblica template file
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Design_Comuni_Italia
*/
get_header();
?>
<main>
<?php
while ( have_posts() ) :
the_post();
$user_can_view_post = dci_members_can_user_view_post(get_current_user_id(), $post->ID);
$descrizione_breve = dci_get_meta("descrizione_breve", $prefix, $post->ID);
$incarico_id = dci_get_meta('incarichi', $prefix, $persona_id);
$organizzazioni = dci_get_meta("organizzazioni", $prefix, $post->ID);
$responsabile_di = dci_get_meta("responsabile_di", $prefix, $post->ID);
$data_conclusione_incarico = dci_get_meta("data_conclusione_incarico", $prefix, $post->ID);
$competenze = dci_get_meta("competenze", $prefix, $post->ID);
$deleghe = dci_get_meta("deleghe", $prefix, $post->ID);
$biografia = dci_get_meta("biografia", $prefix, $post->ID);
$gallery = dci_get_meta("gallery", $prefix, $post->ID);
$punti_contatto = dci_get_meta("punti_contatto", $prefix, $post->ID);
$curriculum_vitae = dci_get_meta("curriculum_vitae", $prefix, $post->ID);
$situazione_patrimoniale = dci_get_meta("situazione_patrimoniale", $prefix, $post->ID);
$dichiarazione_redditi = dci_get_meta("dichiarazione_redditi", $prefix, $post->ID);
$spese_elettorali = dci_get_meta("spese_elettorali", $prefix, $post->ID);
$variazione_situazione_patrimoniale = dci_get_meta("variazione_situazione_patrimoniale", $prefix, $post->ID);
$altre_cariche = dci_get_meta("altre_cariche", $prefix, $post->ID);
$more_info = dci_get_wysiwyg_field("ulteriori_informazioni", $prefix, $post->ID);
?>
<div class="container px-4 my-4" id="main-container">
<div class="row">
<div class="col px-lg-4">
<?php get_template_part("template-parts/common/breadcrumb"); ?>
</div>
</div>
<div class="row">
<div class="col-lg-8 px-lg-4 py-lg-2">
<h1 data-audio><?php the_title(); ?></h1>
<p data-audio>
<?php echo $descrizione_breve; ?>
</p>
</div>
<div class="col-lg-3 offset-lg-1">
<?php
$inline = true;
get_template_part('template-parts/single/actions');
?>
</div>
</div>
</div>
<?php get_template_part('template-parts/single/image-large'); ?>
<div class="container ">
<div class="row border-top border-light row-column-border row-column-menu-left">
<aside class="col-lg-4">
<div class="cmp-navscroll sticky-top" aria-labelledby="accordion-title-one">
<nav class="navbar it-navscroll-wrapper navbar-expand-lg" aria-label="Indice della pagina" data-bs-navscroll>
<div class="navbar-custom" id="navbarNavProgress">
<div class="menu-wrapper">
<div class="link-list-wrapper">
<div class="accordion">
<div class="accordion-item">
<span class="accordion-header" id="accordion-title-one">
<button
class="accordion-button pb-10 px-3 text-uppercase"
type="button"
aria-controls="collapse-one"
aria-expanded="true"
data-bs-toggle="collapse"
data-bs-target="#collapse-one"
>INDICE DELLA PAGINA
<svg class="icon icon-sm icon-primary align-top">
<use xlink:href="#it-expand"></use>
</svg>
</button>
</span>
<div class="progress">
<div class="progress-bar it-navscroll-progressbar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div id="collapse-one" class="accordion-collapse collapse show" role="region" aria-labelledby="accordion-title-one">
<div class="accordion-body">
<ul class="link-list" data-element="page-index">
<li class="nav-item">
<a class="nav-link" href="#incarico">
<span>Incarico</span>
</a>
</li>
<?php if( $organizzazioni){ ?>
<li class="nav-item">
<a class="nav-link" href="#organizzazioni">
<span>Organizzazioni</span>
</a>
</li>
<?php } ?>
<?php if( $competenze ) { ?>
<li class="nav-item">
<a class="nav-link" href="#competenze">
<span>Competenze</span>
</a>
</li>
<?php } ?>
<?php if( $deleghe ) { ?>
<li class="nav-item">
<a class="nav-link" href="#deleghe">
<span>Deleghe</span>
</a>
</li>
<?php } ?>
<?php if( $biografia ) { ?>
<li class="nav-item">
<a class="nav-link" href="#biografia">
<span>Biografia</span>
</a>
</li>
<?php } ?>
<?php if( $punti_contatto ) { ?>
<li class="nav-item">
<a class="nav-link" href="#contatti">
<span>Contatti</span>
</a>
</li>
<?php } ?>
<?php if( $curriculum_vitaerimuovere == 2 /*modificare per mostrare CV*/ ) { ?>
<li class="nav-item">
<a class="nav-link" href="#curriculum-vitae">
<span>Curriculum vitae</span>
</a>
</li>
<?php } ?>
<?php if( $situazione_patrimoniale ) { ?>
<li class="nav-item">
<a class="nav-link" href="#situazione-patrimoniale">
<span>Situazione patrimoniale</span>
</a>
</li>
<?php } ?>
<?php if( $dichiarazione_redditi ) { ?>
<li class="nav-item">
<a class="nav-link" href="#dichiarazione-redditi">
<span>Dichiarazione dei redditi</span>
</a>
</li>
<?php } ?>
<?php if( $spese_elettorali ) { ?>
<li class="nav-item">
<a class="nav-link" href="#spese-elettorali">
<span>Spese elettorali</span>
</a>
</li>
<?php } ?>
<?php if( $variazione_situazione_patrimoniale ) { ?>
<li class="nav-item">
<a class="nav-link" href="#variazione-situazione-patrimoniale">
<span>Variazione situazione patrimoniale</span>
</a>
</li>
<?php } ?>
<?php if( $altre_cariche ) { ?>
<li class="nav-item">
<a class="nav-link" href="#altre-cariche">
<span>Altre cariche</span>
</a>
</li>
<?php } ?>
<?php if ( $more_info ) { ?>
<li class="nav-item">
<a class="nav-link" href="#ulteriori-informazioni">
<span>Ulteriori informazioni</span>
</a>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
</div>
</aside>
<section class="col-lg-8 it-page-sections-container border-light">
<?php if( $incarico_id ) { ?>
<article class="it-page-section anchor-offset" data-audio>
<h4 id="incarico">Incarico</h4>
<div class="richtext-wrapper lora">
<?php
foreach ($incarico_id as $inc_id) {
$incarico = get_the_title($inc_id);
echo $incarico = get_the_title($inc_id);
}
?>
</div>
</article>
<?php } ?>
<?php
if( $incarico == "Sindaco" )
{ $tipo_incarico = "Politico";}
else
{ $tipo_incarico = "Amministrativo";}
?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="tipo-incarico">Tipo di incarico</h4>
<div class="richtext-wrapper lora">
<?php
echo $tipo_incarico;
?>
</div>
</article>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="organizzazioni">Organizzazioni</h4>
<div class="row">
<div class="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
<?php foreach ($organizzazioni as $uo_id) {
$with_border = true;
get_template_part("template-parts/unita-organizzativa/card");
} ?>
</div>
</div>
</article>
<?php if( $competenze ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="competenze">Competenze</h4>
<div class="richtext-wrapper lora">
<?php echo $competenze; ?>
</div>
</article>
<?php } ?>
<?php if( $deleghe ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="deleghe">Deleghe</h4>
<div class="richtext-wrapper lora">
<?php echo $deleghe; ?>
</div>
</article>
<?php } ?>
<?php if( $biografia ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="biografia">Biografia</h4>
<div class="richtext-wrapper lora">
<?php echo $biografia; ?>
</div>
</article>
<?php } ?>
<?php if( is_array($punti_contatto) && count($punti_contatto) ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="contatti" class="mb-3">Contatti</h4>
<?php foreach ($punti_contatto as $pc_id) {
get_template_part('template-parts/single/punto-contatto');
} ?>
</article>
<?php } ?>
<?php if( $curriculum_vitaerimuovere == 2 /*modificare per mostrare CV*/ ) { ?>
<article class="it-page-section anchor-offset mt-5">
<h4 id="curriculum-vitae">Curriculum vitae</h4>
<div class="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
<?php foreach ($curriculum_vitae as $all_url) {
$all_id = attachment_url_to_postid($all_url);
$allegato = get_post($all_id);
?>
<div class="card card-teaser shadow-sm p-4 mt-3 rounded border border-light flex-nowrap">
<svg class="icon" aria-hidden="true">
<use
xlink:href="#it-clip"
></use>
</svg>
<div class="card-body">
<h5 class="card-title">
<a class="text-decoration-none" href="<?php echo get_the_guid($allegato); ?>" aria-label="Scarica l'allegato <?php echo $allegato->post_title; ?>" title="Scarica l'allegato <?php echo $allegato->post_title; ?>">
<?php echo $allegato->post_title; ?>
</a>
</h5>
</div>
</div>
<?php } ?>
</div>
</article>
<?php } ?>
<?php if( $situazione_patrimoniale ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="situazione-patrimoniale">Situazione patrimoniale</h4>
<div class="richtext-wrapper lora">
<?php echo $situazione_patrimoniale; ?>
</div>
</article>
<?php } ?>
<?php if( is_array($dichiarazione_redditi) && count($dichiarazione_redditi) ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="dichiarazione-redditi">Dichiarazione dei redditi</h4>
<div class="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
<?php foreach ($dichiarazione_redditi as $all_url) {
$all_id = attachment_url_to_postid($all_url);
$dichiarazione = get_post($all_id);
?>
<div class="card card-teaser shadow-sm p-4 mt-3 rounded border border-light flex-nowrap">
<svg class="icon" aria-hidden="true">
<use
xlink:href="#it-clip"
></use>
</svg>
<div class="card-body">
<h5 class="card-title">
<a class="text-decoration-none" href="<?php echo get_the_guid($dichiarazione); ?>" aria-label="Scarica l'allegato <?php echo $dichiarazione->post_title; ?>" title="Scarica l'allegato <?php echo $dichiarazione->post_title; ?>">
<?php echo $dichiarazione->post_title; ?>
</a>
</h5>
</div>
</div>
<?php } ?>
</div>
</article>
<?php } ?>
<?php if( is_array($spese_elettorali) && count($spese_elettorali) ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="spese-elettorali">Spese elettorali</h4>
<div class="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
<?php foreach ($spese_elettorali as $all_url) {
$all_id = attachment_url_to_postid($all_url);
$spesa_elettorale = get_post($all_id);
?>
<div class="card card-teaser shadow-sm p-4 mt-3 rounded border border-light flex-nowrap">
<svg class="icon" aria-hidden="true">
<use
xlink:href="#it-clip"
></use>
</svg>
<div class="card-body">
<h5 class="card-title">
<a class="text-decoration-none" href="<?php echo get_the_guid($spesa_elettorale); ?>" aria-label="Scarica l'allegato <?php echo $spesa_elettorale->post_title; ?>" title="Scarica l'allegato <?php echo $spesa_elettorale->post_title; ?>">
<?php echo $spesa_elettorale->post_title; ?>
</a>
</h5>
</div>
</div>
<?php } ?>
</div>
</article>
<?php } ?>
<?php if( is_array($variazione_situazione_patrimoniale) && count($variazione_situazione_patrimoniale) ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="variazione-situazione-patrimoniale">Variazione situazione patrimoniale</h4>
<div class="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
<?php foreach ($variazione_situazione_patrimoniale as $all_url) {
$all_id = attachment_url_to_postid($all_url);
$variazione_sp = get_post($all_id);
?>
<div class="card card-teaser shadow-sm p-4 mt-3 rounded border border-light flex-nowrap">
<svg class="icon" aria-hidden="true">
<use
xlink:href="#it-clip"
></use>
</svg>
<div class="card-body">
<h5 class="card-title">
<a class="text-decoration-none" href="<?php echo get_the_guid($variazione_sp); ?>" aria-label="Scarica l'allegato <?php echo $variazione_sp->post_title; ?>" title="Scarica l'allegato <?php echo $variazione_sp->post_title; ?>">
<?php echo $variazione_sp->post_title; ?>
</a>
</h5>
</div>
</div>
<?php } ?>
</div>
</article>
<?php } ?>
<?php if( is_array($altre_cariche) && count($altre_cariche) ) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="altre-cariche">Altre cariche</h4>
<div class="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal">
<?php foreach ($altre_cariche as $all_url) {
$all_id = attachment_url_to_postid($all_url);
$altra_carica = get_post($all_id);
?>
<div class="card card-teaser shadow-sm p-4 mt-3 rounded border border-light flex-nowrap">
<svg class="icon" aria-hidden="true">
<use
xlink:href="#it-clip"
></use>
</svg>
<div class="card-body">
<h5 class="card-title">
<a class="text-decoration-none" href="<?php echo get_the_guid($altra_carica); ?>" aria-label="Scarica l'allegato <?php echo $altra_carica->post_title; ?>" title="Scarica l'allegato <?php echo $altra_carica->post_title; ?>">
<?php echo $altra_carica->post_title; ?>
</a>
</h5>
</div>
</div>
<?php } ?>
</div>
</article>
<?php } ?>
<?php if ($more_info) { ?>
<article class="it-page-section anchor-offset mt-5" data-audio>
<h4 id="ulteriori-informazioni">Ulteriori informazioni</h4>
<div class="richtext-wrapper lora">
<?php echo $more_info; ?>
</div>
</article>
<?php } ?>
<article class="article-wrapper" data-audio>
<div class="row">
<div class="col-lg-12">
<?php get_template_part( "template-parts/single/bottom" ); ?>
</div><!-- /col-lg-9 -->
</div><!-- /row -->
</article>
</div>
</div>
<?php get_template_part("template-parts/common/valuta-servizio"); ?>
<?php
endwhile; // End of the loop.
?>
</main>
<?php get_footer(); ?>