Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrunic committed Jul 31, 2015
2 parents bc036b8 + 8442ecb commit 7645688
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 19 deletions.
8 changes: 5 additions & 3 deletions Controller/ExportController.php
Expand Up @@ -25,11 +25,13 @@ public function generateCsvAction() {

$handle = fopen('php://output','w+');

fputcsv($handle, array('Email','Gender','Country','City','T-Shirt','Food preference'),';');
fputcsv($handle, array('Email', 'Hash', 'Gender','Country','City','T-Shirt','Food preference'),';');
//$results = $this->connection->query('SELECT email, gender, country, city, tshirt, foodPreference FROM user');
//$results->execute();
foreach ($users as $user) {
fputcsv($handle, array($user->getEmail(),
fputcsv($handle, array(
$user->getEmail(),
md5($this->container->getParameter('email_hash_prefix').$user->getEmail()),
$user->getGender(),
$user->getCountry(),
$user->getCity(),
Expand All @@ -47,4 +49,4 @@ public function generateCsvAction() {

return $response;
}
}
}
8 changes: 8 additions & 0 deletions Controller/UserAdminController.php
Expand Up @@ -48,6 +48,14 @@ public function createAction(Request $request)

if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
if($em->getRepository('LiveVotingBundle:User')->findOneByEmail($user->getEmail())){
$request->getSession()->getFlashBag()->add(
'error', 'That user already exists.'
);

return $this->redirect($this->generateUrl('admin_user_new'));
}

$em->persist($user);
$em->flush();

Expand Down
4 changes: 4 additions & 0 deletions Resources/public/css/content.css
Expand Up @@ -91,6 +91,10 @@
}

.box .actions.single-action { text-align: center; }

.box .text-wrapper.extra-margin {
margin-top: 1em;
}
}


Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Answer/index.html.twig
Expand Up @@ -14,7 +14,7 @@
<div class="col-xs-4 col-sm-1 text-center">
<img class="image-full" src="{{asset('bundles/livevoting/')}}{{ event.getImage ? event.getWebPath : 'img/assets/slave-event.svg'}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h2>{{ event.getName }}</h2>
</div>
Expand All @@ -36,7 +36,7 @@
<div class="col-xs-4 col-sm-1">
<img class="image-full" src="{{asset('bundles/livevoting/img/assets/summer-camp-logo.svg')}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h1>{{ event.getName }}</h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Dashboard/index.html.twig
Expand Up @@ -95,7 +95,7 @@
<div class="col-xs-4 col-sm-1 text-center">
<img class="image-full" src="{{asset('bundles/livevoting/img/assets/summer-camp-logo.svg')}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h1>Current happenings:</h1>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Event/index.html.twig
Expand Up @@ -28,7 +28,7 @@
<tbody>
{% for entity in entities %}
<tr>
<td><a target="_blank" href="{{ path('admin_presentation', { 'event_id': entity.id }) }}">{{ entity.name }}</a></td>
<td><a href="{{ path('admin_presentation', { 'event_id': entity.id }) }}">{{ entity.name }}</a></td>
<td>{{ entity.stateName }}</td>
<td>
<a href="{{ path('admin_event_edit', { 'id': entity.id }) }}"><button type="button" class="btn">Edit</button></a>
Expand All @@ -47,7 +47,7 @@
<span class='glyphicon glyphicon-eye-{{ entity.allowViewingResults ? 'open':'close' }}'></span>
Live
</a>-->
<a target="_blank" href="{{ path('result_view', { 'event_id': entity.id }) }}"><button type="button" class="btn">Final</button></a>
<a href="{{ path('result_view', { 'event_id': entity.id }) }}"><button type="button" class="btn">Final</button></a>
</td>

<td>
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Index/index.html.twig
Expand Up @@ -14,7 +14,7 @@
<div class="col-xs-4 col-sm-1">
<img class="image-full" src="{{asset('bundles/livevoting/')}}{{ event.getImage ? event.getWebPath : 'img/assets/slave-event.svg'}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h2>{{ event.getName }}</h2>
</div>
Expand All @@ -39,7 +39,7 @@
<div class="col-xs-4 col-sm-1 garbage">
<img class="image-full" src="{{asset('bundles/livevoting/img/assets/box-img.svg')}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h1>{{ event.getName }}</h1>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Index/landing.html.twig
Expand Up @@ -14,7 +14,7 @@
<div class="col-xs-4 col-sm-1 text-center">
<img class="image-full" src="{{asset('bundles/livevoting/')}}{{ event.getImage ? event.getWebPath : 'img/assets/slave-event.svg'}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h2>{{ event.getName }}</h2>
</div>
Expand Down Expand Up @@ -42,7 +42,7 @@
<div class="col-xs-4 col-sm-1 text-center">
<img class="image-full" src="{{asset('bundles/livevoting/img/assets/summer-camp-logo.svg')}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h1>{{ event.getName }}</h1>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Presentation/user.html.twig
Expand Up @@ -9,7 +9,7 @@
<div class="col-xs-4 col-sm-1 text-center icon">
<i class="fa fa-clipboard"></i>
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h2>My lectures</h2>
</div>
Expand Down Expand Up @@ -42,7 +42,7 @@
<div class="col-xs-4 col-sm-1">
<img class="image image-o" src="{{asset('bundles/livevoting/' ~ ((entity[0].getImageUrl) ? entity[0].getImageUrl : 'img/assets/angry-che.png') )}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h2>{{ entity[0].name }}</h2>
</div>
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Result/liveIndex.html.twig
Expand Up @@ -14,7 +14,7 @@
<div class="col-xs-4 col-sm-1">
<img class="image-full" src="{{asset('bundles/livevoting/')}}{{ event.getImage ? event.getWebPath : 'img/assets/slave-event.svg'}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h2>{{ event.getName }}</h2>
</div>
Expand All @@ -36,7 +36,7 @@
<div class="col-xs-4 col-sm-1 garbage">
<img class="image-full" src="{{asset('bundles/livevoting/img/assets/summer-camp-logo.svg')}}">
</div>
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper">
<div class="col-xs-8 col-sm-6 col-lg-7 text-wrapper extra-margin">
<div>
<h1>{{ event.getName }}</h1>
</div>
Expand Down
11 changes: 9 additions & 2 deletions Resources/views/User/new.html.twig
Expand Up @@ -4,7 +4,14 @@

{% block mainHeading %}New user{% endblock %}

{% block body %}
{% block body %}

{% for flashMessage in app.Session.flashbag.get('error') %}
<div class="alert alert-danger">
<div class="text">{{flashMessage}}</div>
</div>
{% endfor %}

<div class="row">
<div class="col-xs-12 col-sm-4 margin-top">
{{ form(form) }}
Expand All @@ -16,4 +23,4 @@
<a href="{{path('admin_user')}}"><button type="button" class="btn">Back</button></a>
</div>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion Resources/views/base.html.twig
Expand Up @@ -4,7 +4,7 @@
<title>{% block title %}LiveVoting app{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Favicons -->
<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-152.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-144.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-120.png') }}">
Expand Down
10 changes: 10 additions & 0 deletions Resources/views/baseAdmin.html.twig
Expand Up @@ -4,6 +4,16 @@
<title>{% block title %}Admin panel{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-152.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-144.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-120.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-114.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-76.png') }}">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-72.png') }}">
<link rel="apple-touch-icon-precomposed" href="{{ asset('bundles/livevoting/favicon/apple-touch-icon-57.png') }}">
<link rel="icon" href="{{ asset('bundles/livevoting/favicon/favicon.png') }}">

<link rel="stylesheet" href="{{ asset('bundles/livevoting/css/bootstrap.min.css')}}">
<link rel="stylesheet" href="{{ asset('bundles/livevoting/css/font-awesome.min.css') }}">
<link rel="stylesheet" href="{{ asset('bundles/livevoting/css/font-face.css') }}">
Expand Down

0 comments on commit 7645688

Please sign in to comment.