Commit 7da0b123 authored by Arnaud Bey's avatar Arnaud Bey
Browse files

fixes in rush round editor

parent f3ebe6f6
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<div class="row"> <div class="row">
{% for j in range(0, 3) %} {% for j in range(0, 3) %}
{% set value = grid.squares[x] is defined ? grid.squares[x].letter.value|upper : "_" %} {% set value = grid.squares[x] is defined ? grid.squares[x].letter.value|upper : "_" %}
<li class="col-xs-3 col-sm-3 col-md-3" id="li-square-{{ i }}-{{ j }}"> <li class="col-3 col-3 col-3" id="li-square-{{ i }}-{{ j }}">
<p data-value="{{value}}" id="square-{{ i }}-{{ j }}" class="col-xs-12 col-sm-12 col-md-12 {{ editable == false ? "read-only": "read-write"}}"> <p data-value="{{value}}" style="padding:1px" id="square-{{ i }}-{{ j }}" class="col {{ editable == false ? "read-only": "read-write"}}">
{% if editable %} {% if editable %}
<input required id="square-{{ x }}" type="text" name="squares[]" size="1" maxlength="1" value="{{ grid.squares[x] is defined ? grid.squares[x].letter.value : "_" }}"/> <input required id="square-{{ x }}" type="text" style="text-align:center;" name="squares[]" size="1" maxlength="1" value="{{ grid.squares[x] is defined ? grid.squares[x].letter.value : "_" }}" spellcheck=false />
{% else %} {% else %}
{{ value }} {{ value }}
{% endif %} {% endif %}
...@@ -19,5 +19,5 @@ ...@@ -19,5 +19,5 @@
</div> </div>
{% endfor %} {% endfor %}
</ul> </ul>
<input id="gridLanguageId" type="hidden" name="gridLanguage" value="{{ grid ? grid.language.id }}"> <input id="gridLanguageId" type="hidden" name="gridLanguage" value="{{ grid ? grid.language.id }}">
{% endmacro %} {% endmacro %}
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col">
{% set grid = rush.grid %} {% set grid = rush.grid %}
<form id="grid"> <form id="grid">
{% include "MagicWordBundle:Round/Conquer:grid.html.twig" %} {% include "MagicWordBundle:Round/Conquer:grid.html.twig" %}
...@@ -7,20 +7,7 @@ ...@@ -7,20 +7,7 @@
<input id="languageId" type="hidden" name="language" value="{{ rush.language.id }}"> <input id="languageId" type="hidden" name="language" value="{{ rush.language.id }}">
</form> </form>
</div> </div>
<div class="col-md-6"> <div class="col">
<span class="btn btn-sm btn-outline-secondary" onclick="gridPatternHandler.list()">
<i class="fa fa-magic" aria-hidden="true"></i>
{{ 'patterns_list' | trans }}
</span>
<span class="btn btn-sm btn-outline-secondary" data-toggle="modal" data-target="#addword-modal">
<i class="fa fa-plus" aria-hidden="true"></i>
{{ 'addwords' | trans }}
</span>
<span onclick="rushEditor.savegrid()" class="btn btn-sm btn-outline-secondary">
<i class="far fa-save" aria-hidden="true"></i>
{{ 'save_grid' | trans }}
</span>
<hr/>
<div id="foundables"> <div id="foundables">
{% include 'MagicWordBundle:Grid:possible-inflections.html.twig' with {'foundableForms': grid.foundableForms, 'btn': false } %} {% include 'MagicWordBundle:Grid:possible-inflections.html.twig' with {'foundableForms': grid.foundableForms, 'btn': false } %}
</div> </div>
......
...@@ -16,20 +16,37 @@ ...@@ -16,20 +16,37 @@
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<strong> <strong>
<span id="round-title">{{ round.title ? round.title }}</span> <span id="round-title">{{ round.title ? round.title : "manche sans titre"}}</span>
</strong> </strong>
<span class="text-muted"> <span class="text-muted">
<span id="round-description">{{ round.description ? round.description }}</span> <span id="round-description">{{ round.description ? round.description }}</span>
</span> </span>
<span class="float-right"> <span class="float-right">
{% if round.discr == "conquer" %} {% if round.discr == "conquer" %}
<span onClick="editor.saveAll();" class="btn btn-sm btn-primary"> <span onClick="editor.saveAll();" class="btn btn-sm btn-primary">
<i class="far fa-save" aria-hidden="true"></i> <i class="far fa-save" aria-hidden="true"></i>
{{"save_all"|trans}} {{"save_all"|trans}}
</span> </span>
{% endif %} {% else %}
</span> <span class="btn btn-sm btn-outline-secondary" onclick="gridPatternHandler.list()">
<i class="fa fa-magic" aria-hidden="true"></i>
{{ 'patterns_list' | trans }}
</span>
<span class="btn btn-sm btn-outline-secondary" data-toggle="modal" data-target="#addword-modal">
<i class="fa fa-plus" aria-hidden="true"></i>
{{ 'addwords' | trans }}
</span>
<span class="btn btn-outline-secondary btn-sm" onclick="gridHandler.autofill()">
<i class="fa fa-magic" aria-hidden="true"></i>
{{ 'autofill_grid' | trans }}
</span>
<span onclick="rushEditor.savegrid()" class="btn btn-sm btn-primary">
<i class="far fa-save" aria-hidden="true"></i>
{{ 'save_grid' | trans }}
</span>
{% endif %}
</span>
</div> </div>
<div class="card-body"> <div class="card-body">
<ul class="nav nav-tabs nav-fill nav-justified" role="tablist"> <ul class="nav nav-tabs nav-fill nav-justified" role="tablist">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment