template comparaison
This commit is contained in:
parent
466f9c773b
commit
428a9e2f35
3 changed files with 80 additions and 1 deletions
|
@ -944,12 +944,23 @@ class WikiController extends AbstractController
|
|||
}
|
||||
}
|
||||
|
||||
// Load newly created French pages
|
||||
$newlyCreatedPages = [];
|
||||
$newlyCreatedPagesFile = $this->getParameter('kernel.project_dir') . '/wiki_compare/newly_created_french_pages.json';
|
||||
if (file_exists($newlyCreatedPagesFile)) {
|
||||
$newlyCreatedPagesData = json_decode(file_get_contents($newlyCreatedPagesFile), true);
|
||||
if (isset($newlyCreatedPagesData['created_pages']) && is_array($newlyCreatedPagesData['created_pages'])) {
|
||||
$newlyCreatedPages = $newlyCreatedPagesData['created_pages'];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('admin/wiki.html.twig', [
|
||||
'wiki_pages' => $wikiPages,
|
||||
'missing_translations' => $missingTranslations,
|
||||
'page_differences' => $pageDifferences,
|
||||
'pages_unavailable_in_english' => $pagesUnavailableInEnglish,
|
||||
'specific_pages' => $specificPages,
|
||||
'newly_created_pages' => $newlyCreatedPages
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -324,6 +324,66 @@
|
|||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if newly_created_pages is defined and newly_created_pages|length > 0 %}
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-success text-white">
|
||||
<h2>Pages françaises récemment créées ({{ newly_created_pages|length }})</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Ces pages wiki françaises ont été récemment créées et étaient auparavant dans la liste des pages non disponibles en français.</p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Titre</th>
|
||||
<th>Version anglaise</th>
|
||||
<th>Date de création</th>
|
||||
<th>Créée par</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for page in newly_created_pages %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div>
|
||||
<strong>{{ page.title }}</strong>
|
||||
<span class="badge bg-success">Nouvelle</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{{ page.en_title }}
|
||||
</td>
|
||||
<td>
|
||||
{{ page.created_at }}
|
||||
</td>
|
||||
<td>
|
||||
{{ page.created_by }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{{ page.url }}" target="_blank"
|
||||
class="btn btn-sm btn-outline-info" title="Version française">
|
||||
<i class="bi bi-flag-fill"></i> FR
|
||||
</a>
|
||||
<a href="{{ page.en_url }}" target="_blank"
|
||||
class="btn btn-sm btn-outline-primary" title="Version anglaise">
|
||||
<i class="bi bi-flag-fill"></i> EN
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<p>
|
||||
le score de fraîcheur prend en compte d'avantage la différence entre le nombre de mots que l'ancienneté de
|
||||
modification.
|
||||
|
|
|
@ -104,7 +104,15 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ change.change_size }}</td>
|
||||
<td>
|
||||
{% if change.change_size starts with '+' or change.change_size > 0 %}
|
||||
<span class="text-success">{{ change.change_size }}</span>
|
||||
{% elseif change.change_size starts with '−' or change.change_size < 0 %}
|
||||
<span class="text-danger">{{ change.change_size }}</span>
|
||||
{% else %}
|
||||
{{ change.change_size }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ change.page_url }}" target="_blank" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-box-arrow-up-right"></i> Voir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue