Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
94201c5d
Commit
94201c5d
authored
Sep 10, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2329779
by lauriii | davidhernandez: Move user classes from preprocess to templates.
parent
f98fd49d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
9 deletions
+2
-9
core/modules/user/templates/user.html.twig
core/modules/user/templates/user.html.twig
+1
-1
core/modules/user/templates/username.html.twig
core/modules/user/templates/username.html.twig
+1
-1
core/modules/user/user.module
core/modules/user/user.module
+0
-4
core/modules/user/user.pages.inc
core/modules/user/user.pages.inc
+0
-3
No files found.
core/modules/user/templates/user.html.twig
View file @
94201c5d
...
...
@@ -23,7 +23,7 @@
* @ingroup themeable
*/
#}
<article
{{
attributes
}}
>
<article
{{
attributes
.addClass
(
'profile'
)
}}
>
{%
if
content
%}
{{
-
content
-
}}
{%
endif
%}
...
...
core/modules/user/templates/username.html.twig
View file @
94201c5d
...
...
@@ -19,7 +19,7 @@
*/
#}
{%
if
link_path
-
%}
<a
{{
attributes
}}
>
{{
name
}}{{
extra
}}
</a>
<a
{{
attributes
.addClass
(
'username'
)
}}
>
{{
name
}}{{
extra
}}
</a>
{%
-
else
-
%}
<span
{{
attributes
}}
>
{{
name
}}{{
extra
}}
</span>
{%
-
endif
-
%}
core/modules/user/user.module
View file @
94201c5d
...
...
@@ -625,11 +625,7 @@ function template_preprocess_username(&$variables) {
$variables
[
'link_path'
]
=
$account
->
homepage
;
$variables
[
'homepage'
]
=
$account
->
homepage
;
}
// Set a default class.
$variables
[
'attributes'
][
'class'
]
=
array
(
'username'
);
// We have a link path, so we should generate a link using url().
// Additional classes may be added as array elements like
// $variables['attributes']['class'][] = 'myclass';
if
(
isset
(
$variables
[
'link_path'
]))
{
$variables
[
'attributes'
][
'href'
]
=
url
(
$variables
[
'link_path'
],
$variables
[
'link_options'
]);
}
...
...
core/modules/user/user.pages.inc
View file @
94201c5d
...
...
@@ -29,9 +29,6 @@ function template_preprocess_user(&$variables) {
foreach
(
Element
::
children
(
$variables
[
'elements'
])
as
$key
)
{
$variables
[
'content'
][
$key
]
=
$variables
[
'elements'
][
$key
];
}
// Set up attributes.
$variables
[
'attributes'
][
'class'
][]
=
'profile'
;
}
/**
...
...
Write
Preview
Markdown
is supported
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