mirror of
https://github.com/kvazar-network/webapp.git
synced 2025-03-12 05:31:09 +00:00
add namespace title support
This commit is contained in:
parent
61a90e2591
commit
3429324188
@ -89,6 +89,9 @@ class MainController extends AbstractController
|
||||
],
|
||||
$request->get('part') > 1 ? (int) $request->get('part') * $this->getParameter('app.main.index.limit') : 0,
|
||||
$this->getParameter('app.main.index.limit')
|
||||
),
|
||||
'title' => $this->_title(
|
||||
$request->get('namespace')
|
||||
)
|
||||
]
|
||||
);
|
||||
@ -126,14 +129,46 @@ class MainController extends AbstractController
|
||||
throw $this->createNotFoundException();
|
||||
}
|
||||
|
||||
$record = reset(
|
||||
$records
|
||||
);
|
||||
|
||||
return $this->render(
|
||||
'default/main/transaction.html.twig',
|
||||
[
|
||||
'request' => $request,
|
||||
'record' => reset(
|
||||
$records
|
||||
'record' => $record,
|
||||
'title' => $this->_title(
|
||||
$record['namespace']
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
private function _title(string $namespace): ?string
|
||||
{
|
||||
$index = new \Kvazar\Index\Manticore();
|
||||
|
||||
$title = $index->get(
|
||||
'_KEVA_NS_',
|
||||
[
|
||||
'crc32namespace' => crc32(
|
||||
$namespace
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
if ($title)
|
||||
{
|
||||
$title = reset(
|
||||
$title
|
||||
);
|
||||
|
||||
return trim(
|
||||
$title['value']
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
{% extends 'default/layout.html.twig' %}
|
||||
{% block title %}{% if title %}{{ title }} - {% endif %}{{ app.name }}{% endblock %}
|
||||
{% block body %}
|
||||
<div class="t-center px-16 pt-54">
|
||||
<div class="mx-a mw-560 px-16">
|
||||
@ -8,11 +9,11 @@
|
||||
<div class="mx-a mw-560 px-16 pb-16">
|
||||
<img class="br-50 shine" src="{{ request.get('namespace') | jIdenticon }}" alt="{{ request.get('namespace') }}" />
|
||||
</div>
|
||||
{# @TODO current namespace value
|
||||
<div class="mb-36 c-1">
|
||||
{{ 'Observe Kevacoin Universe' | trans }}
|
||||
</div>
|
||||
#}
|
||||
{% if title %}
|
||||
<div class="mb-36 c-1">
|
||||
{{ title }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="t-center px-16 pb-36">
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% extends 'default/layout.html.twig' %}
|
||||
{% block title %}{% if title %}{{ title }} - {% endif %}{{ app.name }}{% endblock %}
|
||||
{% block body %}
|
||||
<div class="t-center px-16 pt-54">
|
||||
<div class="mx-a mw-560 px-16">
|
||||
@ -10,11 +11,11 @@
|
||||
<img class="br-50 shine" src="{{ record.namespace | jIdenticon }}" alt="{{ record.namespace }}" />
|
||||
</a>
|
||||
</div>
|
||||
{# @TODO current namespace value
|
||||
<div class="mb-36 c-1">
|
||||
{{ 'Observe Kevacoin Universe' | trans }}
|
||||
</div>
|
||||
#}
|
||||
{% if title %}
|
||||
<div class="mb-36 c-1">
|
||||
{{ title }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="t-center px-16 pb-36">
|
||||
|
Loading…
x
Reference in New Issue
Block a user