game.html.twig 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ parent() }} - Game{% endblock %}
  3. {% block content %}
  4. <div id="game" class="box">
  5. <a href="{{ path('homepage_locale', {'_locale' : app.request.locale}) }}">{{ 'nav.home'|trans }}</a>
  6. <hr />
  7. <h2>{{ 'game.subtitle'|trans }}</h2>
  8. {% if game.iswon %}
  9. <div class="alert">
  10. <h3 class="alert alert-success text-center">{{ 'game.message.win'|trans }}</h3>
  11. </div>
  12. {% endif %}
  13. {% if game.ishanged %}
  14. <div class="alert">
  15. <h3 class="alert alert-warning text-center">{{ 'game.message.lose'|trans }}</h3>
  16. </div>
  17. {% endif %}
  18. {% if not game.isover %}
  19. <p class="attempts">
  20. {{ 'game.attempts'|trans({'%attempts%' : remaining_attempts}) }}
  21. </p>
  22. {% endif %}
  23. <ul class="word-letters">
  24. {% for letter in word_letters %}
  25. <li class="not-guessed">{{ letter }}</li>
  26. {% endfor %}
  27. </ul>
  28. <p class="attempts">
  29. <a href="{{ path('game_reset') }}">{{ 'game.reset'|trans }}</a>
  30. </p>
  31. <br class="clearfix" />
  32. {% if not game.isover %}
  33. <h2>{{ 'game.try_letter'|trans }}</h2>
  34. <ul>
  35. {% for letter in letters %}
  36. <li class="letter btn">
  37. <a href="{{ path('game_letter', {'letter' :letter}) }}">{{ letter|upper }}</a>
  38. </li>
  39. {% endfor %}
  40. </ul>
  41. <h2>{{ 'game.try_word'|trans }}</h2>
  42. <form action="{{ path('game_try_word') }}" method="post" class="form-inline">
  43. <div class="form-group">
  44. <input name="word" class="form-control mb-2" placeholder="{{ 'game.placeholder.guess'|trans }}"/>
  45. </div>
  46. <button>{{ 'game.button.guess'|trans }}</button>
  47. </form>
  48. {% endif %}
  49. </div>
  50. <div class="box">
  51. {{ render(controller('AppBundle:Testimonials:index')) }}
  52. </div>
  53. {% endblock %}