Projet

Général

Profil

0001-wcs-add-labels-before-layout-size-values-55860.patch

Frédéric Péters, 27 juillet 2021 14:32

Télécharger (4,22 ko)

Voir les différences:

Subject: [PATCH] wcs: add labels before layout/size values (#55860)

 .../templates/combo/wcs/manager/card-infos-cell-form.html  | 3 ++-
 combo/manager/static/css/combo.manager.css                 | 3 ---
 combo/manager/static/js/combo.manager.js                   | 7 +++----
 3 files changed, 5 insertions(+), 8 deletions(-)
combo/apps/wcs/templates/combo/wcs/manager/card-infos-cell-form.html
9 9
{# UI to customize content layout #}
10 10
<div class="wcs-cards-cell--grid">
11 11
  <div class="wcs-cards-cell--grid-options">
12
    <span class="wcs-cards-cell--grid-layout-label">{% trans "Automatic" %}</span>
12
    <span class="wcs-cards-cell--grid-layout-label">{% trans "Grid Layout:" %}</span>
13
    <span class="wcs-cards-cell--grid-layout-mode">{% trans "Automatic" %}</span>
13 14
    <a role="button" class="wcs-cards-cell--grid-layout-btn">
14 15
      {% trans "Edit" %}
15 16
    </a>
combo/manager/static/css/combo.manager.css
656 656
	font-weight: bold;
657 657
}
658 658

  
659
.wcs-cards-cell--grid-layout-label,
660 659
.wcs-cards-cell--grid-cell-content .cell-size-label {
661 660
	color: #666;
662 661
}
663 662

  
664
.wcs-cards-cell--grid-layout-label::before,
665 663
.wcs-cards-cell--grid-cell-content .cell-size-label::before {
666 664
	content: " [ ";
667 665
}
668 666

  
669
.wcs-cards-cell--grid-layout-label::after,
670 667
.wcs-cards-cell--grid-cell-content .cell-size-label::after {
671 668
	content: " ]";
672 669
}
combo/manager/static/js/combo.manager.js
405 405
  this.cell = cell;
406 406
  this.gridSchema_default = {
407 407
    "grid_class": "fx-grid--auto",
408
    "grid_layout_label": gettext('Automatic'),
409 408
    "cells": []
410 409
  }
411 410
  this.init();
......
458 457
    $(this.cell).trigger("custom_cell:change");
459 458
  },
460 459
  grid__set_layout: function() {
461
    this.grid_layout_label.textContent = this.gridSchema.grid_layout_label;
460
    this.grid_layout_label.textContent = $(this.grid_form).find('select[name="grid-layout"] option[value="' + this.gridSchema.grid_class + '"]').text();
462 461
    if (this.grid_wrapper.dataset.grid_layout) {
463 462
      this.grid_wrapper.classList.remove(this.grid_wrapper.dataset.grid_layout); }
464 463
    this.grid_wrapper.classList.add(this.gridSchema.grid_class);
......
539 538
    let cell_display_mode_label = $(this.grid_cell_form).find('select[name="display_mode"] option[value="' + schema_cell.display_mode + '"]').text();
540 539
    cell_text += '<span class="cell-display-mode-label">' + cell_display_mode_label + '</span>';
541 540
    let cell_size_label = $(this.grid_cell_form).find('select[name="cell_size"] option[value="' + schema_cell.cell_size + '"]').text();
542
    cell_text += '<span class="cell-size-label">' + cell_size_label + '</span>';
541
    cell_text += '<span class="cell-size-label">' + gettext('Size:') + ' ' + cell_size_label + '</span>';
543 542
    cell_text += '</span>';
544 543
    grid_cell.contentEl.innerHTML = cell_text;
545 544
  },
......
665 664
    this.is_on = false;
666 665
    this.grid = cell.querySelector('.wcs-cards-cell--grid');
667 666
    this.edit_grid_btn = cell.querySelector('.wcs-cards-cell--grid-layout-btn');
668
    this.grid_layout_label = cell.querySelector('.wcs-cards-cell--grid-layout-label');
667
    this.grid_layout_label = cell.querySelector('.wcs-cards-cell--grid-layout-mode');
669 668

  
670 669
    const grid_form_tpl_string = cell.querySelector('.wcs-cards-cell--grid-form-tpl').innerText;
671 670
    this.grid_form = this.parse_string_tpl(grid_form_tpl_string);
672
-