Hi folks,
Someone running a Cloud Engine demo instance was interested in displaying a message on the login page displaying some information about the system.
Note that I am NOT proposing to merge this patch at this time; it's really a one-off hack. I'm sending it out (a) so people can sanity-check it, and (b) because I think it's a decent RFE that we might want to fold in upstream.
There's a second patch I'll send in a moment, that goes to to the vendor/converge-ui checkout (from a separate repo). This is less of a disaster post-1.1, but this is for 1.1.
-- Matt
This patch isn't necessarily meant to go into product, but I'm sending it out for review.
If this is going to make it into the codebase, we should certainly make the file location configurable, and remove the marker comments. --- src/app/controllers/user_sessions_controller.rb | 11 +++++++++ src/app/stylesheets/login.scss | 28 +++++++++++++++++++++++ 2 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/user_sessions_controller.rb b/src/app/controllers/user_sessions_controller.rb index b0bb661..6cde8b2 100644 --- a/src/app/controllers/user_sessions_controller.rb +++ b/src/app/controllers/user_sessions_controller.rb @@ -20,6 +20,7 @@ class UserSessionsController < ApplicationController before_filter :require_no_user, :only => [:new, :create] before_filter :require_user, :only => :destroy + before_filter :global_notice # mawagner - MOTD patch change layout 'converge-ui/login_layout'
def new @@ -59,4 +60,14 @@ class UserSessionsController < ApplicationController logout redirect_to login_url end + + # mawagner - MOTD patch change + # Remember to remove reference on line 23 of this file + def global_notice + # Check for our message file: + message = File.read('/etc/aeolus-conductor/motd.html') rescue nil + @motd = message.html_safe if message.present? + end + # mawagner - end MOTD patch change + end diff --git a/src/app/stylesheets/login.scss b/src/app/stylesheets/login.scss index 00f4893..608f398 100644 --- a/src/app/stylesheets/login.scss +++ b/src/app/stylesheets/login.scss @@ -5,6 +5,34 @@ article{ aside img{ margin-left: 15px; }
+ // mawagner - MOTD patch + #motd { + @include box-sizing(border-box); + @include border-radius(7px); + border: 1px solid #ddd; + margin: 40px 0 0 0; + @include background-image(linear-gradient(top, rgba(255, 255, 255, 0) 40%, $login_base-color 120%)); + @include box-shadow($login_base-color 0px 12px 15px -8px); + padding: 20px 20px 20px 20px; + color: rgba(black, 0.48); + + &:before { + content: ""; + display: block; + width: 16px; + height: 16px; + position: absolute; + background: image-url("flash_warning_icon.png") no-repeat 0 0; + } + + p { + padding-left: 30px; + margin: 0; + position: relative; + } + } + // end mawagner - MOTD patch + #notifications{ position: relative;
On Mon, Feb 11, 2013 at 02:07:35PM -0500, Matt Wagner wrote:
Hi folks,
Someone running a Cloud Engine demo instance was interested in displaying a message on the login page displaying some information about the system.
Note that I am NOT proposing to merge this patch at this time; it's really a one-off hack. I'm sending it out (a) so people can sanity-check it, and (b) because I think it's a decent RFE that we might want to fold in upstream.
There's a second patch I'll send in a moment, that goes to to the vendor/converge-ui checkout (from a separate repo). This is less of a disaster post-1.1, but this is for 1.1.
-- Matt
It being Monday, I actually sent this to the wrong list. This patch was based on Cloud Engine 1.1, which is cut from a comparatively-old version of the source.
That said, this takes care of the next thing I was going to do, which was to send the patch here and see if it (sans the excessive comments marking what has changed) was something we'd want to apply upstream.
-- Matt
--- rails/layouts/_user_session_layout.haml | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/rails/layouts/_user_session_layout.haml b/rails/layouts/_user_session_layout.haml index fb2747a..c017d29 100644 --- a/rails/layouts/_user_session_layout.haml +++ b/rails/layouts/_user_session_layout.haml @@ -11,6 +11,11 @@ = yield :login_logo %section = yield :content + -# mawagner - MOTD patch + - if @motd + #motd + = @motd + -# mawagner - end MOTD patch %footer = yield :footer
aeolus-devel@lists.fedorahosted.org