-
Notifications
You must be signed in to change notification settings - Fork 256
2757283 template admin order view #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2757283 template admin order view #565
Conversation
'commerce_order_edit_form' => [ | ||
'render element' => 'form', | ||
], | ||
'commerce_order__default' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed w/ @cornifex we'd make an admin view mode and use that instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we'd have to alter the default canonical route, Core provides
'_entity_view' => "{$entity_type_id}.full",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed w/ Bojan. Doesn't really give us a gain. And tests showed all kinds of madness by doing this.
ce6e9f5
to
5ba9504
Compare
{% endfor %} | ||
</div> | ||
</details> | ||
{% for key,value in {'billing_information': 'Billing information'|t, 'shipping_information': 'Shipping information'|t} %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bojanz I followed the same concepts from the email, since this is pretty hardcoded-ish.
@bojanz this is ready to take a peak at. |
</div> | ||
<details open> | ||
<summary role="button"> | ||
Customer Information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing |t for Customer information.
#} | ||
|
||
{{ attach_library('commerce_order/form') }} | ||
{% set order_state = order_entity.getState.value|capitalize %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're capitalizing the machine name of the state, instead of taking the label. That's not right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah so we need getState.getLabel
?
modules/order/commerce_order.module
Outdated
} | ||
|
||
if ($order->getBillingProfile()) { | ||
$variables['order']['billing_information'] = $order->getBillingProfile()->get('address')->view([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we not render the entire billing profile? Doing it this way means no phone field / VAT number is shown even if the fields are attached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works, get can just render it full
{% endfor %} | ||
</div> | ||
</details> | ||
{% for key,value in {'billing_information': 'Billing information'|t, 'shipping_information': 'Shipping information'|t} %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like it would be better for TX (themer experience) if these for loops were unrolled.
We have two elements here, repeating their HTML twice is probably no big deal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me
{# | ||
/** | ||
* @file | ||
* Default order template. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add something like "Used on the admin order page." so that the themers know which template they need.
b08663c
to
656d4eb
Compare
656d4eb
to
8397f4f
Compare
Captain @bojanz, your needs have been addressed |
Continued in #574. |
This is just a rough template using all twig with no preprocessing. Definitely needs more work but I've been given other priorities for the time being.