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
54a04408
Commit
54a04408
authored
Jan 09, 2017
by
okhin
Browse files
Slighty better feedback form
parent
eec240d6
Pipeline
#728
failed with stage
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
app/Api.php
View file @
54a04408
...
@@ -49,7 +49,7 @@ class Api {
...
@@ -49,7 +49,7 @@ class Api {
// 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
.
"/
feedback/
categories"
);
$json
=
Api
::
get
(
"campaigns/"
.
CAMPAIGN_ID
.
"/categories"
);
return
json_decode
(
$json
,
true
);
return
json_decode
(
$json
,
true
);
}
}
...
...
app/Main.php
View file @
54a04408
...
@@ -31,11 +31,14 @@ class Main extends Controller {
...
@@ -31,11 +31,14 @@ class Main extends Controller {
//GET
//GET
if
(
$f3
->
get
(
'VERB'
)
==
'GET'
){
if
(
$f3
->
get
(
'VERB'
)
==
'GET'
){
$categories
=
Api
::
get_feedback_categories
();
$categories
=
Api
::
get_feedback_categories
();
$f3
->
set
(
'feedback_categories'
,
$categories
[
'categories'
]
);
$f3
->
set
(
'feedback_categories'
,
$categories
);
$contact_id
=
$f3
->
get
(
'POST.contact_id'
);
$contact_id
=
$f3
->
get
(
'POST.contact_id'
);
$f3
->
set
(
"contact_id"
,
$contact_id
);
$f3
->
set
(
"contact_id"
,
$contact_id
);
$arguments
=
Api
::
get_arguments
();
$f3
->
set
(
'arguments'
,
$arguments
);
$f3
->
set
(
'block_content'
,
'feedbackform.html'
);
$f3
->
set
(
'block_content'
,
'feedbackform.html'
);
}
}
//POST
//POST
...
...
app/config.ini
View file @
54a04408
...
@@ -15,4 +15,3 @@ DEBUG=3
...
@@ -15,4 +15,3 @@ DEBUG=3
LANGUAGE
=
'fr'
LANGUAGE
=
'fr'
; Global variables of website
; Global variables of website
templates/feedbackform.html
View file @
54a04408
<h2>
{{ _("Sale Form") }}
</h2>
<h2>
{{ _(@campaign.title) }}
</h2>
<!-- Add here the Sale form your campaign -->
<include
href=
"argumentation.html"
>
<p>
{{ _("Here is some argument in order to help you talking with your interlocutor.") }}
</p>
<h2>
{{ _("Feedback Form") }}
</h2>
<h2>
{{ _("Feedback Form") }}
</h2>
...
@@ -13,8 +11,8 @@
...
@@ -13,8 +11,8 @@
<input
type=
"text"
id=
"contact_id"
name=
"contact_id"
hidden=
"hidden"
value=
"{{ @contact_id }}"
/>
<input
type=
"text"
id=
"contact_id"
name=
"contact_id"
hidden=
"hidden"
value=
"{{ @contact_id }}"
/>
<repeat
group=
"{{ @feedback_categories }}"
value=
"{{ @feedback_category }}"
>
<repeat
group=
"{{ @feedback_categories }}"
value=
"{{ @feedback_category }}"
>
<input
type=
"radio"
name=
"feedback_category"
value=
"{{ @feedback_category }}"
/>
<input
type=
"radio"
name=
"feedback_category"
value=
"{{ @feedback_category
.id
}}"
/>
{{ @feedback_category }}
{{ @feedback_category
.name
}}
</repeat>
</repeat>
<p>
<p>
<textarea
id=
"feedback"
name=
"feedback"
></textarea>
<textarea
id=
"feedback"
name=
"feedback"
></textarea>
...
...
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