Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Chill-project
Chill-ICPC2
Commits
aa2a7e40
Commit
aa2a7e40
authored
Nov 13, 2014
by
Julien Fastré
Browse files
Add rendering of icpc2 codes refs #303
parent
c8960db2
Changes
2
Show whitespace changes
Inline
Side-by-side
CustomField/CustomFieldICPC2Code.php
View file @
aa2a7e40
...
...
@@ -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'
)
->
find
ByCode
(
$serialized
);
->
find
OneBy
(
array
(
'code'
=>
$serialized
)
)
;
}
/**
...
...
Resources/views/CustomFieldsRendering/icpc2.html.twig
0 → 100644
View file @
aa2a7e40
<span
class=
"icpc2
{{
icpc.component.slug
}}
"
><span
class=
"icpc2-code"
>
{{
icpc.code
}}
</span>
<span
class=
"icpc2-name"
>
{{
icpc.name
[
app.request.locale
]
}}
</span>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment