work_time-1.0.x-dev/templates/views-view-work-time-sheet.html.twig

templates/views-view-work-time-sheet.html.twig
{#
/**
 * @file
 * Default theme implementation for displaying a view as a table.
 *
 * Available variables:
 * - attributes: Remaining HTML attributes for the element.
 *   - class: HTML classes that can be used to style contextually through CSS.
 * - title : The title of this group of rows.
 * - header: The table header columns.
 *   - attributes: Remaining HTML attributes for the element.
 *   - content: HTML classes to apply to each header cell, indexed by
 *   the header's key.
 *   - default_classes: A flag indicating whether default classes should be
 *     used.
 * - caption_needed: Is the caption tag needed.
 * - caption: The caption for this table.
 * - accessibility_description: Extended description for the table details.
 * - accessibility_summary: Summary for the table details.
 * - rows: Table row items. Rows are keyed by row number.
 *   - attributes: HTML classes to apply to each row.
 *   - columns: Row column items. Columns are keyed by column number.
 *     - attributes: HTML classes to apply to each column.
 *     - content: The column content.
 *   - default_classes: A flag indicating whether default classes should be
 *     used.
 * - responsive: A flag indicating whether table is responsive.
 * - sticky: A flag indicating whether table header is sticky.
 * - summary_element: A render array with table summary information (if any).
 *
 * @see template_preprocess_views_view_work_time_sheet()
 *
 * @ingroup themeable
 */
#}
<form id="work-time-sheet" method="post" action="{{ path('work_time.timesheet') }}">
<input type="hidden" name="reference_type" value="{{ reference_type }}"/>
<input type="hidden" name="route_name" value="{{ route_name }}"/>
<div class="container-fluid">
  <div class="row g-3 align-items-center">
    <div class="col-auto">
      <label for="edit-month" class="col-form-label">{{ 'Month'|t }}</label>
    </div>
    <div class="col-auto">
      <input type="month" id="edit-month" name="month" class="form-control" aria-labelledby="month" value="{{ month }}" onchange="monthOnChange(this)">
    </div>

    <div class="col-auto">
      <strong id="workinghour" class="form-text">{{ 'Time work'|t }}</strong>
      <div class="col-auto btn-group" role="group">
        <input type="radio" class="btn-check" name="hour" id="remove" value="0">
        <label class="btn btn-outline-danger" for="remove" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="{{ 'Remove'|t }}" title="{{ 'Remove'|t }}"><i class="bi bi-x-circle"></i></label>
        {% for i in 1..8 %}
          <input type="radio" class="btn-check" name="hour" id="hour{{ i }}" value="{{ i }}">
          <label class="btn btn-outline-success" for="hour{{ i }}">{{ i }}H</label>
        {% endfor %}
      </div>
    </div>

    <div class="col-auto">
      <strong id="overtimehour" class="form-text">{{ 'Overtime hours'|t }}</strong>
      <div class="col-auto btn-group" role="group">
        {% for i in 9..16 %}
          <input type="radio" class="btn-check" name="hour" id="hour{{ i }}" value="{{ i }}">
          <label class="btn btn-outline-danger" for="hour{{ i }}">{{ i }}H</label>
        {% endfor %}
      </div>
    </div>
  </div>
</div>


<div class="table-responsive">
  {%
    set classes = [
    'table',
    'caption-top',
    'cols-' ~ header|length,
    'table-bordered',
    'table-condensed',
    'table-hover',
    'table-striped',
    'responsive-enabled',
    'sticky-enabled',
  ]
  %}
  {% set totals_attributes = create_attribute() %}
  <table{{ attributes.addClass(classes) }}
    data-toggle="table"
    data-show-export="true"
    data-show-footer="true">
    <caption class="text-center">
      {% if caption %}
        {{ caption }}
      {% else %}
        {{ title }}
      {% endif %}
      {% if (summary_element is not empty) %}
        {{ summary_element }}
      {% endif %}
    </caption>
    {% if header %}
      <thead>
      <tr>
        {% for key, column in header %}
        <th{{ column.attributes }}>
          {%- if column.wrapper_element -%}
            <{{ column.wrapper_element }}>
            {%- if column.url -%}
              <a href="{{ column.url }}" title="{{ column.title }}" rel="nofollow">{{ column.content }}{{ column.sort_indicator }}</a>
            {%- else -%}
              {{ column.content }}{{ column.sort_indicator }}
            {%- endif -%}
            </{{ column.wrapper_element }}>
          {%- else -%}
            {%- if column.url -%}
              <a href="{{ column.url }}" title="{{ column.title }}" rel="nofollow">{{ column.content }}{{ column.sort_indicator }}</a>
            {%- else -%}
              {{- column.content }}{{ column.sort_indicator }}
            {%- endif -%}
          {%- endif -%}
          </th>
        {% endfor %}
      </tr>
      </thead>
    {% endif %}
    <tbody>
    {% for row in rows %}
      <tr{{ row.attributes }}>
        {% for key, column in row.columns %}
        <td{{ column.attributes }}>
          {%- if column.wrapper_element -%}
            <{{ column.wrapper_element }}>
            {% for content in column.content %}
              {{ content.separator }}{{ content.field_output }}
            {% endfor %}
            </{{ column.wrapper_element }}>
          {%- else -%}
            {% for content in column.content %}
              {{- content.separator }}{{ content.field_output -}}
            {% endfor %}
          {%- endif %}
          </td>
        {% endfor %}
      </tr>
    {% endfor %}
    </tbody>

    {% if footer %}
      <tfoot>
      <tr>
        {% for key, column in footer %}
        <td{{ column.attributes }}>
          {{- column.content }}
        </td>
        {% endfor %}
      </tr>
      </tfoot>
    {% endif %}
  </table>
</div>
<div class="col-12">
  <button type="submit" class="btn btn-success"><i class="bi bi-stopwatch-fill"></i> {{ 'Send'|t }}</button>
</div>
</form>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc