<div dir="ltr"><div>It might be simpler to just update the label on the python code. This is where the form label are defined.</div><div><br></div><div>You can update the label here: <a href="https://github.com/openstack/django_openstack_auth/blob/stable/kilo/openstack_auth/forms.py#L51">https://github.com/openstack/django_openstack_auth/blob/stable/kilo/openstack_auth/forms.py#L51</a></div><div><br></div>-Lin<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 15, 2016 at 12:54 AM, Itxaka Serrano Garcia <span dir="ltr"><<a href="mailto:itxaka@redhat.com" target="_blank">itxaka@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Looks like the form comes from django_openstack_auth:<br>
<a href="https://github.com/openstack/django_openstack_auth/blob/master/openstack_auth/forms.py#L53" rel="noreferrer" target="_blank">https://github.com/openstack/django_openstack_auth/blob/master/openstack_auth/forms.py#L53</a><br>
<br>
<br>
But to be honest, no idea how that can be overridden trough the themes, not sure if its even possible to override anything on that page without modifying django_openstack_auth directly :(<br>
<br>
Maybe someone else has a better insight on this than me.<br>
<br>
<br>
* Horrible Hack Incoming, read at your own discretion *<br>
<br>
You can override the template here:<br>
<a href="https://github.com/openstack/horizon/blob/master/horizon/templates/horizon/common/_form_field.html#L51" rel="noreferrer" target="_blank">https://github.com/openstack/horizon/blob/master/horizon/templates/horizon/common/_form_field.html#L51</a><br>
<br>
And change this line:<br>
<label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{{ field.label }}</label><br>
<br>
For this:<br>
<label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{% if field.label == "User Name" and not request.user.is_authenticated %}Email{% else %}{{ field.label }}{% endif %}</label><br>
<br>
<br>
Which will check if the label is "User Name" and the user is logged out and directly write "Email" as the field label.<br>
<br>
I know, its horrible and if you update horizon it will be overriden, but probably works for the time being if you really need it ¯\_(ツ)_/¯<br>
<br>
* Horrible Hack Finished *<span class=""><font color="#888888"><br>
<br>
<br>
<br>
<br>
Itxaka</font></span><div class=""><div class="h5"><br>
<br>
<br>
<br>
<br>
On 01/15/2016 05:13 AM, Adrian Turjak wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I've run into a weird issue with the Liberty release of Horizon.<br>
<br>
For our deployment we enforce emails as usernames, and thus for Horizon<br>
we used to have "User Name" on the login page replaced with "Email".<br>
This used to be a straightforward change in the html template file, and<br>
with the introduction of themes we assumed it would be the same. When<br>
one of our designers was migrating our custom CSS and html changes to<br>
the new theme system they missed that change and I at first it was a<br>
silly mistake.<br>
<br>
Only on digging through the code myself I found that the "User Name" on<br>
the login screen isn't in the html file at all, nor anywhere else<br>
straightforward. The login page form is built on the fly with javascript<br>
to facilitate different modes of authentication. While a bit annoying<br>
that didn't seem too bad and I then assumed it might mean a javascript<br>
change, only that the more I dug, the more I became confused.<br>
<br>
Where exactly is the login form defined? And where exactly is the "User<br>
Name" text for the login form set?<br>
<br>
I've tried all manner of stuff to change it with no luck and I feel like<br>
I must have missed something obvious.<br>
<br>
Cheers,<br>
-Adrian Turjak<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br>
</blockquote>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</div></div></blockquote></div><br></div></div>