Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
piphone-front
Commits
11c151b4
Commit
11c151b4
authored
Jan 11, 2017
by
okhin
Browse files
Let's get group types
parent
a2c99ff6
Pipeline
#739
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Api.php
View file @
11c151b4
...
...
@@ -47,6 +47,12 @@ class Api {
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
static
function
get_feedback_categories
()
{
$json
=
Api
::
get
(
"campaigns/"
.
CAMPAIGN_ID
.
"/categories"
);
...
...
app/Main.php
View file @
11c151b4
...
...
@@ -16,6 +16,13 @@ class Main extends Controller {
//TODO: use weight for random
$rand_id
=
rand
(
0
,
count
(
$f3
->
get
(
'contacts'
))
-
1
);
$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
(
'random'
,
rand
(
0
,
2
));
$f3
->
set
(
'block_content'
,
'home.html'
);
...
...
templates/contact.html
View file @
11c151b4
...
...
@@ -3,94 +3,93 @@
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<!-- image à gauche -->
<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"
>
<!-- infos -->
<div
class=
"visible-sm-block"
>
<address
style=
"margin-top:1em;"
>
<strong>
{{ _("Informations") }}
</strong><br>
</address>
</div>
<!-- /infos -->
</div>
<!-- /image à gauche -->
<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"
>
<!-- infos -->
<div
class=
"visible-sm-block"
>
<address
style=
"margin-top:1em;"
>
<strong>
{{ _("Informations") }}
</strong><br>
</address>
</div>
<!-- /infos -->
</div>
<!-- /image à gauche -->
<!-- pas image -->
<div
class=
"col-md-10 col-sm-8"
>
<div
class=
"row"
>
<!-- gauche -->
<div
class=
"col-md-8"
>
<!-- titre -->
<div>
<h1
class=
"text-center"
id=
"name"
>
{{ @contact.first_name }}
<br
class=
"visible-xs-block"
>
{{ @contact.last_name }}
</h1>
<!-- actions -->
<div
class=
"text-center row"
>
<p
class=
"lead text-center"
>
<abbr
title=
"{{ _("
Phone
number
")
}}"
>
{{ _("Phone number") }}:
</abbr>
<a
href=
"tel: {{ @contact.phone }}"
>
{{ @contact.phone }}
</a>
<br
class=
"visible-xs-block"
>
<!-- pas image -->
<div
class=
"col-md-10 col-sm-8"
>
<div
class=
"row"
>
<!-- gauche -->
<div
class=
"col-md-8"
>
<!-- titre -->
<div>
<h1
class=
"text-center"
id=
"name"
>
{{ @contact.first_name }}
<br
class=
"visible-xs-block"
>
{{ @contact.last_name }}
</h1>
<!-- actions -->
<div
class=
"text-center row"
>
<p
class=
"lead text-center"
>
<abbr
title=
"{{ _("
Phone
number
")
}}"
>
{{ _("Phone number") }}:
</abbr>
<a
href=
"tel: {{ @contact.phone }}"
>
{{ @contact.phone }}
</a>
<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-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>
</p>
<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-default visible-xs-inline-block"
title=
"{{ _("
Choose
someone
else
")
}}"
href=
"#"
><span
class=
"glyphicon glyphicon-refresh"
></span></a>
</p>
</div>
<!-- /actions -->
</div>
<!-- /actions -->
</div>
<!-- /titre -->
<!-- /titre -->
<!-- groupes -->
<div>
<dl
class=
"dl-horizontal hidden-xs"
id=
"resume"
>
<repeat
group=
"{{ @contact.groups }}"
value=
"{{ @group }}"
>
<check
if=
"{{ @group.type!='
C
ommittee' }}"
>
<dt>
{{ @group.type }}:
</dt>
<dd><a
href=
"#"
>
{{ @group.name }}
</a></dd>
</check>
</repeat>
</dl>
</div>
<!-- /groupes -->
<!-- groupes -->
<div>
<dl
class=
"dl-horizontal hidden-xs"
id=
"resume"
>
<repeat
group=
"{{ @contact.groups }}"
value=
"{{ @group }}"
>
<check
if=
"{{ @group.type!='
c
ommittee' }}"
>
<dt>
{{ @group.type }}:
</dt>
<dd><a
href=
"#"
>
{{ @group.name }}
</a></dd>
</check>
</repeat>
</dl>
</div>
<!-- /groupes -->
<!-- committees -->
<div>
<ul
class=
"list-inline"
id=
"committee"
>
<repeat
group=
"{{ @contact.groups }}"
value=
"{{ @group }}"
>
<check
if=
"{{ @group.type=='
C
ommittee' }}"
>
<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>
</repeat>
</ul>
</div>
<!-- /committees -->
<!-- committees -->
<div>
<ul
class=
"list-inline"
id=
"committee"
>
<repeat
group=
"{{ @contact.groups }}"
value=
"{{ @group }}"
>
<check
if=
"{{ @group.type=='
c
ommittee' }}"
>
<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>
</repeat>
</ul>
</div>
<!-- /committees -->
</div>
<!-- /gauche -->
<!-- droite -->
<div
class=
"col-md-4"
>
<!-- infos -->
<div
class=
"hidden-xs hidden-sm text-right"
>
<address
style=
"margin-top:1em;"
>
<strong>
{{ _("Informations") }}
</strong><br>
</address>
</div>
<!-- /infos -->
<!-- infos -->
<div
class=
"hidden-xs hidden-sm text-right"
>
<address
style=
"margin-top:1em;"
>
<strong>
{{ _("Informations") }}
</strong><br>
</address>
</div>
<!-- /infos -->
<hr
class=
"hidden-xs"
>
<hr
class=
"hidden-xs"
>
<!-- random -->
<div
class=
"text-center"
>
<form
class=
"form-inline"
role=
"form"
>
<!-- <div class="form-group hidden-xs">
<label class="" for="country">Pays : </label>
<select class="form-control" name="country" id="country" onchange="$('#selcountry').submit()"><option value="">-- Toute l'Europe -- </select>
</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>
</form>
<!-- random -->
<div
class=
"text-center"
>
<form
class=
"form-inline"
role=
"form"
>
<!-- <div class="form-group hidden-xs">
<label class="" for="country">Pays : </label>
<select class="form-control" name="country" id="country" onchange="$('#selcountry').submit()"><option value="">-- Toute l'Europe -- </select>
</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>
</form>
</div>
<!-- /random -->
</div>
<!-- /random -->
</div>
<!-- /droite -->
<!-- /droite -->
</div>
<!-- /row-->
</div>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment