Commit a4b6e3b1 authored by webchick's avatar webchick

Issue #2250841 by andypost, thechanceg, Buratino42 | vijaycs85: Fixed Adding a...

Issue #2250841 by andypost, thechanceg, Buratino42 | vijaycs85: Fixed Adding a inline template for content translation status.
parent 2b24e721
......@@ -147,9 +147,14 @@ public function overview(Request $request, $entity_type_id = NULL) {
$links['edit']['title'] = $this->t('Edit');
}
$translation = $entity->translation[$langcode];
$status = !empty($translation['status']) ? $this->t('Published') : $this->t('Not published');
// @todo Remove as part of https://drupal.org/node/2250841.
$status = '<span class="status">' . $status . '</span>' . (!empty($translation['outdated']) ? ' <span class="marker">' . $this->t('outdated') . '</span>' : '');
$status = array('data' => array(
'#type' => 'inline_template',
'#template' => '<span class="status">{% if status %}{{ "Published"|t }}{% else %}{{ "Not published"|t }}{% endif %}</span>{% if outdated %} <span class="marker">{{ "outdated"|t }}</span>{% endif %}',
'#context' => array(
'status' => $translation['status'],
'outdated' => $translation['outdated'],
),
));
if ($is_original) {
$language_name = $this->t('<strong>@language_name (Original language)</strong>', array('@language_name' => $language_name));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment