Change logo on login splash screen

Hi,

I'd like to change the look/style of foreman. Specifically I'd like to add
a background image to the login screen, similair to how RedHat have done
for there branded foreman 'Openstack Installer'.

<https://access.redhat.com/sites/default/files/images/openstack_login.png>

Is there a formal way to do this, or is it a case of hacking the rails app?
I had a look in /usr/share/foreman/app/views/users/login.html.erb

There is a tag
<div class="col-sm-12">
<div id="brand">
<%= image_tag("foreman_white.png") %>
</div><!–/#brand–>
</div>

This is where the foreman logo is inserted.

Any thoughts on how to change this?

Hi Dave,

You can create a Foreman plugin for this, which would replace the
users/login page using deface (not sure if it's possible to replace assets
through plugins, but I think not).

Here's the wiki with some info:
http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin
And some examples for you to look at:
http://projects.theforeman.org/projects/foreman/wiki/List_of_Plugins

Best,

··· On Tue, Mar 3, 2015 at 1:49 PM, Dave Johnston wrote:

Hi,

I’d like to change the look/style of foreman. Specifically I’d like to
add a background image to the login screen, similair to how RedHat have
done for there branded foreman ‘Openstack Installer’.

https://access.redhat.com/sites/default/files/images/openstack_login.png

Is there a formal way to do this, or is it a case of hacking the rails app?
I had a look in /usr/share/foreman/app/views/users/login.html.erb

There is a tag



<%= image_tag(“foreman_white.png”) %>

This is where the foreman logo is inserted.

Any thoughts on how to change this?


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Daniel Lobato

@elobatoss
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30

Daniel you were right about the assets - they cannot be overridden in
plugins, but the code is not so far from enabling it.

I did some research on the matter, the key is changing the loading order of
the plugins and core inside the main application class:

class Application < Rails::Application

config.railties_order = config.themes + [:main_app, :all] if
> config.respond_to? :themes

Once it's done - you can override any file, including the assets - it will
give the plugin full control over the visual aspect.
Just put your file under the assets folder of your plugin.

··· On Tuesday, March 3, 2015 at 1:54:52 PM UTC+2, Daniel Lobato wrote: > > Hi Dave, > > You can create a Foreman plugin for this, which would replace the > users/login page using deface (not sure if it's possible to replace assets > through plugins, but I think not). > > Here's the wiki with some info: > http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin > And some examples for you to look at: > http://projects.theforeman.org/projects/foreman/wiki/List_of_Plugins > > Best, > > On Tue, Mar 3, 2015 at 1:49 PM, Dave Johnston > wrote: > >> Hi, >> >> I'd like to change the look/style of foreman. Specifically I'd like to >> add a background image to the login screen, similair to how RedHat have >> done for there branded foreman 'Openstack Installer'. >> >> >> >> Is there a formal way to do this, or is it a case of hacking the rails >> app? >> I had a look in /usr/share/foreman/app/views/users/login.html.erb >> >> There is a tag >>
>>
>> <%= image_tag("foreman_white.png") %> >>
>>
>> >> This is where the foreman logo is inserted. >> >> Any thoughts on how to change this? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Daniel Lobato > > @elobatoss > blog.daniellobato.me > daniellobato.me > > GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30 >

Update:
I have created a plugin that attempts to create a theme for foreman without
making changes to the core objects.
It kind of works (attached a screenshot), you can find the sources here:
https://github.com/ShimShtein/foreman_themify let me know if it helps.

<https://lh3.googleusercontent.com/-5bVir5r_x0c/VSEWGZVl_tI/AAAAAAAAFGo/HgUmQ-HsGds/s1600/Screenshot%2Bfrom%2B2015-03-26%2B11%3A10%3A41.png>

··· On Tuesday, March 3, 2015 at 6:55:48 PM UTC+2, Shim Shtein wrote: > > Daniel you were right about the assets - they cannot be overridden in > plugins, but the code is not so far from enabling it. > > I did some research on the matter, the key is changing the loading order > of the plugins and core inside the main application class: > > class Application < Rails::Application > > config.railties_order = config.themes + [:main_app, :all] if >> config.respond_to? :themes > > > Once it's done - you can override any file, including the assets - it will > give the plugin full control over the visual aspect. > Just put your file under the assets folder of your plugin. > > > > On Tuesday, March 3, 2015 at 1:54:52 PM UTC+2, Daniel Lobato wrote: >> >> Hi Dave, >> >> You can create a Foreman plugin for this, which would replace the >> users/login page using deface (not sure if it's possible to replace assets >> through plugins, but I think not). >> >> Here's the wiki with some info: >> http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Plugin >> And some examples for you to look at: >> http://projects.theforeman.org/projects/foreman/wiki/List_of_Plugins >> >> Best, >> >> On Tue, Mar 3, 2015 at 1:49 PM, Dave Johnston wrote: >> >>> Hi, >>> >>> I'd like to change the look/style of foreman. Specifically I'd like to >>> add a background image to the login screen, similair to how RedHat have >>> done for there branded foreman 'Openstack Installer'. >>> >>> >>> >>> >>> Is there a formal way to do this, or is it a case of hacking the rails >>> app? >>> I had a look in /usr/share/foreman/app/views/users/login.html.erb >>> >>> There is a tag >>>
>>>
>>> <%= image_tag("foreman_white.png") %> >>>
>>>
>>> >>> This is where the foreman logo is inserted. >>> >>> Any thoughts on how to change this? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Foreman users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to foreman-user...@googlegroups.com. >>> To post to this group, send email to forema...@googlegroups.com. >>> Visit this group at http://groups.google.com/group/foreman-users. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Daniel Lobato >> >> @elobatoss >> blog.daniellobato.me >> daniellobato.me >> >> GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30 >> >