From 3aa3415a0e41956fc132f5f18173341eb66279e2 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 7 May 2014 19:07:32 +0200 Subject: [PATCH] Add a feedback form Add a link to the feedback page in the public toolbar, and the goodby page Should fix #14 --- conf/vroom.conf.sample | 1 + lib/Vroom/I18N/en.pm | 8 ++++++++ lib/Vroom/I18N/fr.pm | 8 ++++++++ public/css/vroom.css | 4 ++++ public/vroom.pl | 20 ++++++++++++++++++++ templates/default/feedback.email.ep | 14 ++++++++++++++ templates/default/feedback.html.ep | 23 +++++++++++++++++++++++ templates/default/goodby.html.ep | 5 ++++- templates/default/public_toolbar.html.ep | 3 +++ 9 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 templates/default/feedback.email.ep create mode 100644 templates/default/feedback.html.ep diff --git a/conf/vroom.conf.sample b/conf/vroom.conf.sample index 1ef72b0..853b437 100644 --- a/conf/vroom.conf.sample +++ b/conf/vroom.conf.sample @@ -14,6 +14,7 @@ realm => 'example.com', # Web & contact baseUrl => 'https://vroom.example.com/', emailFrom => 'vroom@example.com', +feedbackRecipient => 'admin@example.com', # Templates to use for web pages template => 'default', # Used to sign cookies diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm index e478d67..0bbbcfb 100644 --- a/lib/Vroom/I18N/en.pm +++ b/lib/Vroom/I18N/en.pm @@ -17,6 +17,14 @@ our %Lexicon = ( "click on this link", "HAVE_A_NICE_MEETING" => "Have a nice meeting :-)", "EMAIL_SIGN" => "VROOM! And video conferencing becomes free, simple and safe", + "FEEDBACK" => "Feedback", + "YOUR_MAIL_OPTIONAL" => "Your email address (optional)", + "COMMENT" => "Comment", + "SUBMIT" => "Submit", + "FEEDBACK_FROM_VROOM" => "VROOM feedback", + "FROM" => "From", + "GIVE_US_YOUR_FEEDBACK" => "Give us your feedback", + "YOUR_FEEDBACK_HELPS_US" => "Your feedback (good or bad) can help us improve this application", "ROOM_LOCKED" => "This room is now locked", "ROOM_UNLOCKED" => "This room is now unlocked", "ONE_OF_THE_PEERS" => "one of the peers", diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm index 470eae2..d1b996d 100644 --- a/lib/Vroom/I18N/fr.pm +++ b/lib/Vroom/I18N/fr.pm @@ -18,6 +18,14 @@ our %Lexicon = ( "une webcam. Quand vous êtes prêt, cliquez sur ce lien", "HAVE_A_NICE_MEETING" => "Bonne réunion :-)", "EMAIL_SIGN" => "VROOM! Et la visio conférence devient libre, simple et sûr", + "FEEDBACK" => "Retour d'expérience", + "YOUR_MAIL_OPTIONAL" => "Votre adresse email (optionnelle)", + "COMMENT" => "Commentaire", + "SUBMIT" => "Envoyer", + "FEEDBACK_FROM_VROOM" => "Retour d'expérience de VROOM", + "FROM" => "De la part de", + "GIVE_US_YOUR_FEEDBACK" => "Parlez-nous de votre expérience", + "YOUR_FEEDBACK_HELPS_US" => "Votre retour d'expérience (bonne ou mauvaise) peut nous aider à améliorer cette application", "INVITE_SENT_TO_s" => "Une invitation a été envoyée à %s", "ROOM_LOCKED" => "Ce salon est maintenant verrouillé", "ROOM_UNLOCKED" => "Ce salon est maintenant déverrouillé", diff --git a/public/css/vroom.css b/public/css/vroom.css index 3d0806c..70ac519 100644 --- a/public/css/vroom.css +++ b/public/css/vroom.css @@ -69,6 +69,10 @@ max-width: 500px; margin: auto; } +#feedbackFormContainer { + max-width: 700px; + margin: auto; +} #chatBox { max-height:300px; resize:none; diff --git a/public/vroom.pl b/public/vroom.pl index 57610e3..94bb6d4 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -68,6 +68,7 @@ our $config = plugin Config => { realm => 'vroom', baseUrl => 'https://vroom.example.com/', emailFrom => 'vroom@example.com', + feedbackRecipient => 'admin@example.com', template => 'default', inactivityTimeout => 3600, logLevel => 'info', @@ -226,6 +227,25 @@ get '/about' => sub { get '/help' => 'help'; +get '/feedback' => 'feedback'; +post '/feedback' => sub { + my $self = shift; + my $email = $self->param('email') || ''; + my $comment = $self->param('comment'); + $self->email( + header => [ + Subject => encode("MIME-Header", $self->l("FEEDBACK_FROM_VROOM")), + To => $config->{feedbackRecipient} + ], + data => [ + template => 'feedback', + email => $email, + comment => $comment + ], + ); + $self->redirect_to($self->url_for('/')); +}; + get '/goodby/(:room)' => sub { my $self = shift; my $room = $self->stash('room'); diff --git a/templates/default/feedback.email.ep b/templates/default/feedback.email.ep new file mode 100644 index 0000000..6017ac5 --- /dev/null +++ b/templates/default/feedback.email.ep @@ -0,0 +1,14 @@ + +

+ <%=l 'FROM' %>: <%= $email %> +

+

+ <%=l 'COMMENT' %>: <%= $comment %> +

+

+ — +
+ <%=l 'EMAIL_SIGN' %> +

+ + diff --git a/templates/default/feedback.html.ep b/templates/default/feedback.html.ep new file mode 100644 index 0000000..ccb6e7a --- /dev/null +++ b/templates/default/feedback.html.ep @@ -0,0 +1,23 @@ +% title $self->l('FEEDBACK'); +%= include 'header' +%= include 'public_toolbar' +
+
+ +
+
<%=l 'GIVE_US_YOUR_FEEDBACK' %>
+
<%=l 'YOUR_FEEDBACK_HELPS_US' %>
+
+
+ + +
+
+ + +
+ +
+
+
+%= include 'footer' diff --git a/templates/default/goodby.html.ep b/templates/default/goodby.html.ep index 90b6a06..da9fe26 100644 --- a/templates/default/goodby.html.ep +++ b/templates/default/goodby.html.ep @@ -6,7 +6,10 @@

<%=l 'THANKS_SEE_YOU_SOON' %>

<%=l 'THANKS_FOR_USING' %>

-

<%=l 'BACK_TO_MAIN_MENU' %>

+
%=include 'footer' diff --git a/templates/default/public_toolbar.html.ep b/templates/default/public_toolbar.html.ep index d83e1e8..0bbf8ea 100644 --- a/templates/default/public_toolbar.html.ep +++ b/templates/default/public_toolbar.html.ep @@ -21,6 +21,9 @@
  • <%=l 'ABOUT' %>
  • +
  • + <%=l 'FEEDBACK' %> +