Commit 11c151b4 authored by okhin's avatar okhin

Let's get group types

parent a2c99ff6
Pipeline #739 failed with stage
...@@ -47,6 +47,12 @@ class Api { ...@@ -47,6 +47,12 @@ class Api {
return json_decode($json, true); return json_decode($json, true);
} }
// //Asking for complete list of group types
static function get_group_types() {
$json = Api::get("campaigns/" . CAMPAIGN_ID . "/grouptypes");
return json_decode($json, true);
}
// Asking for complete list of feedback categories // Asking for complete list of feedback categories
static function get_feedback_categories() { static function get_feedback_categories() {
$json = Api::get("campaigns/" . CAMPAIGN_ID . "/categories"); $json = Api::get("campaigns/" . CAMPAIGN_ID . "/categories");
......
...@@ -16,6 +16,13 @@ class Main extends Controller { ...@@ -16,6 +16,13 @@ class Main extends Controller {
//TODO: use weight for random //TODO: use weight for random
$rand_id = rand(0, count($f3->get('contacts'))-1); $rand_id = rand(0, count($f3->get('contacts'))-1);
$contacts = $f3->get('contacts'); $contacts = $f3->get('contacts');
$groups = Api::get_groups();
$f3->set('groups', $groups);
$group_types = Api::get_group_types();
$f3->set('group_types', $group_types);
$f3->set('contact', $contacts[$rand_id]); $f3->set('contact', $contacts[$rand_id]);
$f3->set('random', rand(0, 2)); $f3->set('random', rand(0, 2));
$f3->set('block_content', 'home.html'); $f3->set('block_content', 'home.html');
......
...@@ -3,94 +3,93 @@ ...@@ -3,94 +3,93 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<!-- image à gauche --> <!-- image à gauche -->
<div class="col-md-2 col-sm-4 hidden-xs"> <div class="col-md-2 col-sm-4 hidden-xs">
<img class= "img-responsive img-circle" src="static/img/base{{ @random }}.jpg" width="140px" alt="mep"> <img class= "img-responsive img-circle" src="static/img/base{{ @random }}.jpg" width="140px" alt="mep">
<!-- infos --> <!-- infos -->
<div class="visible-sm-block"> <div class="visible-sm-block">
<address style="margin-top:1em;"> <address style="margin-top:1em;">
<strong>{{ _("Informations") }}</strong><br> <strong>{{ _("Informations") }}</strong><br>
</address> </address>
</div> </div>
<!-- /infos --> <!-- /infos -->
</div> </div>
<!-- /image à gauche --> <!-- /image à gauche -->
<!-- pas image --> <!-- pas image -->
<div class="col-md-10 col-sm-8"> <div class="col-md-10 col-sm-8">
<div class="row"> <div class="row">
<!-- gauche --> <!-- gauche -->
<div class="col-md-8"> <div class="col-md-8">
<!-- titre --> <!-- titre -->
<div> <div>
<h1 class="text-center" id="name">{{ @contact.first_name }} <br class="visible-xs-block">{{ @contact.last_name }}</h1> <h1 class="text-center" id="name">{{ @contact.first_name }} <br class="visible-xs-block">{{ @contact.last_name }}</h1>
<!-- actions --> <!-- actions -->
<div class="text-center row"> <div class="text-center row">
<p class="lead text-center"> <p class="lead text-center">
<abbr title="{{ _("Phone number") }}">{{ _("Phone number") }}:</abbr> <a href="tel: {{ @contact.phone }}">{{ @contact.phone }}</a> <abbr title="{{ _("Phone number") }}">{{ _("Phone number") }}:</abbr> <a href="tel: {{ @contact.phone }}">{{ @contact.phone }}</a>
<br class="visible-xs-block"> <br class="visible-xs-block">
<a type="button" class="btn btn-default" title="{{ _("Call now") }}" href="#callModal"><span class="glyphicon glyphicon-earphone"></span></button> <a type="button" class="btn btn-default" title="{{ _("Call now") }}" href="#callModal"><span class="glyphicon glyphicon-earphone"></span></button>
<a type="button" class="btn btn-info" title="{{ _("Get more info...") }}" href="#"><span class="glyphicon glyphicon-info-sign"></span></a> <a type="button" class="btn btn-info" title="{{ _("Get more info...") }}" href="#"><span class="glyphicon glyphicon-info-sign"></span></a>
<a type="button" class="btn btn-default visible-xs-inline-block" title="{{ _("Choose someone else") }}" href="#"><span class="glyphicon glyphicon-refresh"></span></a> <a type="button" class="btn btn-default visible-xs-inline-block" title="{{ _("Choose someone else") }}" href="#"><span class="glyphicon glyphicon-refresh"></span></a>
</p> </p>
</div>
<!-- /actions -->
</div> </div>
<!-- /actions --> <!-- /titre -->
</div>
<!-- /titre -->
<!-- groupes --> <!-- groupes -->
<div> <div>
<dl class="dl-horizontal hidden-xs" id="resume"> <dl class="dl-horizontal hidden-xs" id="resume">
<repeat group="{{ @contact.groups }}" value="{{ @group }}"> <repeat group="{{ @contact.groups }}" value="{{ @group }}">
<check if="{{ @group.type!='Committee' }}"> <check if="{{ @group.type!='committee' }}">
<dt>{{ @group.type }}:</dt> <dt>{{ @group.type }}:</dt>
<dd><a href="#">{{ @group.name }}</a></dd> <dd><a href="#">{{ @group.name }}</a></dd>
</check> </check>
</repeat> </repeat>
</dl> </dl>
</div> </div>
<!-- /groupes --> <!-- /groupes -->
<!-- committees --> <!-- committees -->
<div> <div>
<ul class="list-inline" id="committee"> <ul class="list-inline" id="committee">
<repeat group="{{ @contact.groups }}" value="{{ @group }}"> <repeat group="{{ @contact.groups }}" value="{{ @group }}">
<check if="{{ @group.type=='Committee' }}"> <check if="{{ @group.type=='committee' }}">
<li><abbr title="{{ @group.name }}" class="initialism"><ahref="https://memopol.lqdn.fr/europe/parliament/committee/{{ @group.name }}/"><div class="well well-sm">{{ @group.name }}</div></a></abbr></li> <li><abbr title="{{ @group.name }}" class="initialism"><ahref="https://memopol.lqdn.fr/europe/parliament/committee/{{ @group.name }}/"><div class="well well-sm">{{ @group.name }}</div></a></abbr></li>
</check> </check>
</repeat> </repeat>
</ul> </ul>
</div> </div>
<!-- /committees --> <!-- /committees -->
</div> </div>
<!-- /gauche --> <!-- /gauche -->
<!-- droite --> <!-- droite -->
<div class="col-md-4"> <div class="col-md-4">
<!-- infos --> <!-- infos -->
<div class="hidden-xs hidden-sm text-right"> <div class="hidden-xs hidden-sm text-right">
<address style="margin-top:1em;"> <address style="margin-top:1em;">
<strong>{{ _("Informations") }}</strong><br> <strong>{{ _("Informations") }}</strong><br>
</address> </address>
</div> </div>
<!-- /infos --> <!-- /infos -->
<hr class="hidden-xs"> <hr class="hidden-xs">
<!-- random --> <!-- random -->
<div class="text-center"> <div class="text-center">
<form class="form-inline" role="form"> <form class="form-inline" role="form">
<!-- <div class="form-group hidden-xs"> <!-- <div class="form-group hidden-xs">
<label class="" for="country">Pays : </label> <label class="" for="country">Pays : </label>
<select class="form-control" name="country" id="country" onchange="$('#selcountry').submit()"><option value="">-- Toute l'Europe -- </select> <select class="form-control" name="country" id="country" onchange="$('#selcountry').submit()"><option value="">-- Toute l'Europe -- </select>
</div> --><!-- /form-group --> </div> --><!-- /form-group -->
<button type="submit" class="btn btn-default hidden-xs" title="Choisir un autre député"><span class="glyphicon glyphicon-refresh"></span></button> <button type="submit" class="btn btn-default hidden-xs" title="Choisir un autre député"><span class="glyphicon glyphicon-refresh"></span></button>
</form> </form>
</div>
<!-- /random -->
</div> </div>
<!-- /random --> <!-- /droite -->
</div>
<!-- /droite -->
</div> </div>
<!-- /row--> <!-- /row-->
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment