Commit aa2a7e40 authored by Julien Fastré's avatar Julien Fastré
Browse files

Add rendering of icpc2 codes refs #303

parent c8960db2
......@@ -94,7 +94,12 @@ class CustomFieldICPC2Code implements CustomFieldInterface
public function render($value, CustomField $customField)
{
return $this->templating();
$code = $this->deserialize($value, $customField);
return $this->templating->render("ChillICPC2Bundle:CustomFieldsRendering:"
. "icpc2.html.twig", array(
'icpc' => $code
));
}
public function buildOptionsForm(FormBuilderInterface $builder)
......@@ -105,7 +110,7 @@ class CustomFieldICPC2Code implements CustomFieldInterface
public function deserialize($serialized, CustomField $customField)
{
return $this->om->getRepository('ChillICPC2Bundle:Code')
->findByCode($serialized);
->findOneBy(array('code' => $serialized));
}
/**
......
<span class="icpc2 {{ icpc.component.slug }}"><span class="icpc2-code">{{ icpc.code }}</span>&nbsp;<span class="icpc2-name">{{ icpc.name[app.request.locale] }}</span>
\ No newline at end of file
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