ai_upgrade_assistant-0.2.0-alpha2/templates/ai-upgrade-analysis-results.html.twig

templates/ai-upgrade-analysis-results.html.twig
{#
/**
 * @file
 * Default theme implementation for AI upgrade analysis results.
 *
 * Available variables:
 * - show_code_previews: Boolean indicating if code previews should be shown.
 * - group_by_severity: Boolean indicating if results should be grouped by severity.
 * - inline_diffs: Boolean indicating if diffs should be shown inline.
 * - severity_colors: Array of colors for different severity levels.
 * - results: Array of analysis results.
 */
#}

<div class="analysis-results {{ group_by_severity ? 'grouped-by-severity' : 'grouped-by-module' }}">
  {% if results %}
    {% if group_by_severity %}
      {% for severity, items in results|group_by('severity') %}
        <div class="severity-group severity-{{ severity }}" style="--severity-color: {{ severity_colors[severity] }}">
          <h3>{{ severity|title }} Issues</h3>
          
          {% for result in items %}
            <div class="result-item" data-severity="{{ severity }}">
              <div class="result-header">
                <span class="module-name">{{ result.module }}</span>
                <span class="file-path">{{ result.file }}</span>
              </div>
              
              {% if show_code_previews %}
                <div class="code-preview">
                  {% if inline_diffs %}
                    <div class="inline-diff">{{ result.diff|raw }}</div>
                  {% else %}
                    <div class="code-before">{{ result.code.before }}</div>
                    <div class="code-after">{{ result.code.after }}</div>
                  {% endif %}
                </div>
              {% endif %}
              
              <div class="result-actions">
                <button class="action-button apply-fix" data-result-id="{{ result.id }}">
                  {{ 'Apply Fix'|t }}
                </button>
                <button class="action-button ignore" data-result-id="{{ result.id }}">
                  {{ 'Ignore'|t }}
                </button>
              </div>
            </div>
          {% endfor %}
        </div>
      {% endfor %}
    {% else %}
      {% for module, items in results|group_by('module') %}
        <div class="module-group">
          <h3>{{ module }}</h3>
          
          {% for result in items %}
            <div class="result-item" data-severity="{{ result.severity }}">
              {# Similar content as above, but grouped by module #}
              {{ result.content }}
            </div>
          {% endfor %}
        </div>
      {% endfor %}
    {% endif %}
  {% else %}
    <div class="empty-results">
      <p>{{ 'No analysis results available. Run an analysis to see potential upgrade issues.'|t }}</p>
    </div>
  {% endif %}
</div>

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

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