Projet

Général

Profil

0001-card-infos-cell-form-add-i18n-52073.patch

Voir les différences:

Subject: [PATCH] card infos cell form: add i18n (#52073)

 .../wcs/manager/card-infos-cell-form.html     | 47 ++++++++++++-------
 combo/manager/static/js/combo.manager.js      |  6 +--
 2 files changed, 32 insertions(+), 21 deletions(-)
combo/apps/wcs/templates/combo/wcs/manager/card-infos-cell-form.html
1 1
{% extends "combo/cell_form.html" %}
2
{% load i18n %}
2 3

  
3 4
{% block cell-form %}
4 5
{{ block.super }}
......
8 9
{# Grille de personalisation #}
9 10
<div class="wcs-cards-cell--grid">
10 11
  <div class="wcs-cards-cell--grid-options">
11
    <span class="wcs-cards-cell--grid-layout-label">auto</span>
12
    <span class="wcs-cards-cell--grid-layout-label">{% trans "Automatic" %}</span>
12 13
    <a role="button" class="wcs-cards-cell--grid-layout-btn">
13
      Modifier
14
      {% trans "Edit" %}
14 15
    </a>
15 16
  </div>
16 17
  <div class="wcs-cards-cell--grid-cells">
17 18
  </div>
18 19
  <div class="wcs-cards-cell--grid-buttons">
19
    <button type="button" class="wcs-cards-cell--add-grid-cell-btn">Ajouter</button>
20
    <button type="button" class="wcs-cards-cell--add-grid-cell-btn">{% trans "Add" %}</button>
20 21
  </div>
21 22
</div>
22 23

  
......
24 25
<script type="text/template" class="wcs-cards-cell--grid-form-tpl">
25 26
  <form>
26 27
    <p>
27
      Disposition
28
      {% trans "Layout" %}
28 29
      <select name="grid-layout">
29
        <option value="fx-grid--auto">auto</option>
30
        <option value="fx-grid">1 colonne</option>
31
        <option value="fx-grid--t2">2 colonnes</option>
32
        <option value="fx-grid--t3">3 colonnes</option>
30
        <option value="fx-grid--auto">{% trans "Automatic" %}</option>
31
        <option value="fx-grid">{% trans "1 column" %}</option>
32
        <option value="fx-grid--t2">{% trans "2 columns" %}</option>
33
        <option value="fx-grid--t3">{% trans "3 columns" %}</option>
33 34
      </select>
34 35
    </p>
35 36
  </form>
......
38 39
  <form>
39 40
    <p>
40 41
      <label>
41
        Champ
42
        {% trans "Field" %}
42 43
        <select name="card_field_varname"></select>
43 44
      </label>
44 45
    </p>
45 46
    <p>
46 47
      <label>
47
        Afficher
48
        {% trans "Display" %}
48 49
        <select name="card_field_elements">
49
          <option value="key,value">Label & valeur</option>
50
          <option value="key">Label uniquement</option>
51
          <option value="value">Valeur uniquement</option>
52
          <option value="title">Titre</option>
50
          <option value="key,value">{% trans "Label & Value" %}</option>
51
          <option value="key">{% trans "Label only" %}</option>
52
          <option value="value">{% trans "Value only" %}</option>
53
          <option value="title">{% trans "Title" %}</option>
53 54
        </select>
54 55
      </label>
55 56
    </p>
56 57
    <p>
57 58
      <label>
58
        Taille
59
        {% trans "Size" %}
59 60
        <select name="cell_size">
60
          <option value="">auto</option>
61
          <option value="">{% trans "Automatic" %}</option>
61 62
          <option value="size--1-1">1/1</option>
62 63
          <option value="size--t1-2">1/2</option>
63 64
          <option value="size--t1-3">1/3</option>
......
71 72
  <div class="wcs-cards-cell--grid-cell">
72 73
    <div class="wcs-cards-cell--grid-cell-content"></div>
73 74
    <div class="wcs-cards-cell--grid-cell-buttons">
74
      <a role="button" class="wcs-cards-cell--grid-cell-edit">Modifier</a>
75
      <a role="button" class="wcs-cards-cell--grid-cell-delete">Supprimer</a>
75
      <a role="button" class="wcs-cards-cell--grid-cell-edit">{% trans "Edit" %}</a>
76
      <a role="button" class="wcs-cards-cell--grid-cell-delete">{% trans "Delete" %}</a>
76 77
    </div>
77 78
  </div>
78 79
</script>
80

  
81
<script>
82
window.combo_i18n = {
83
  automatic: "{% trans 'Automatic' %}",
84
  cancel: "{% trans 'Cancel' %}",
85
  edit: "{% trans 'Edit' %}",
86
  add: "{% trans 'Add' %}"
87
};
88
</script>
89
</script>
79 90
{% endif %}
80 91
{% endblock %}
combo/manager/static/js/combo.manager.js
405 405
  this.cell = cell;
406 406
  this.gridShema_default = {
407 407
    "grid_class": "fx-grid--auto",
408
    "grid_layout_label": "auto",
408
    "grid_layout_label": window.combo_i18n.automatic,
409 409
    "cells": []
410 410
  }
411 411
  this.init();
......
564 564
    this.grid_cell_form.display.value = grid_cell.dataset.display;
565 565
    const cell_id = $(grid_cell).index();
566 566
    const grid_cell_shema = this.gridShema.cells[cell_id];
567
    this.grid_cell__form_dialog("Modifier", function(form_datas){
567
    this.grid_cell__form_dialog(window.combo_i18n.edit, function(form_datas){
568 568
      const grid_cell_shema_mod = _self.grid_cell__set_shema(form_datas, grid_cell_shema);
569 569
      _self.grid_cell__set(grid_cell, grid_cell_shema_mod);
570 570
      $(_self.cell).trigger("custom_cell:change");
......
626 626
    })
627 627
    // Add grid cell Btn click
628 628
    $(this.add_grid_cell_btn).on('click', function() {
629
      _self.grid_cell__form_dialog("Ajouter", _self.grid_cell__add_shema.bind(_self));
629
      _self.grid_cell__form_dialog(window.combo_i18n.add, _self.grid_cell__add_shema.bind(_self));
630 630
    });
631 631
    // Grid cells sortable
632 632
    $(_self.grid_wrapper).sortable({
633
-