diff --git a/app/models/organisation.rb b/app/models/organisation.rb index 190a8b7..4c0f282 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -35,7 +35,7 @@ after_assign :resize_image end - validates_property :width, of: :logo, in: (0..160) + validates_property :height, of: :logo, in: (0..100) validates_property :format, of: :logo, in: ['jpeg', 'png', 'gif','jpg','bmp'] validates_size_of :logo, maximum: 500.kilobytes @@ -190,8 +190,8 @@ # def resize_image unless logo.nil? - if logo.height != 160 && logo.width != 160 - self.logo = logo.thumb('160x') # resize width and maintain aspect ratio + if logo.height != 100 + self.logo = logo.thumb('x100') # resize height and maintain aspect ratio end end end diff --git a/app/views/layouts/_dmponline_header.html.erb b/app/views/layouts/_dmponline_header.html.erb index b80c58b..65c5036 100644 --- a/app/views/layouts/_dmponline_header.html.erb +++ b/app/views/layouts/_dmponline_header.html.erb @@ -3,11 +3,7 @@
diff --git a/app/views/layouts/_dmponline_org_branding.html.erb b/app/views/layouts/_dmponline_org_branding.html.erb index 3a0b3a1..e6f0af6 100644 --- a/app/views/layouts/_dmponline_org_branding.html.erb +++ b/app/views/layouts/_dmponline_org_branding.html.erb @@ -1,34 +1,24 @@
- <% if user_signed_in? then%> - <% if current_user.organisation.present? then%> - - <% if current_user.organisation.logo_file_name.present? then%> - - <%end%> + <% if user_signed_in? %> + <% if !current_user.organisation.nil? %> + + + <% if current_user.organisation.logo.present? %> + + <% end %> - - <% if current_user.organisation.banner_text.present? then%> -
- - <%= raw current_user.organisation.banner_text %> - -
- - <%end%> - <%end%> - + + <% if current_user.organisation.banner_text.present? %> +
+ + <%= raw current_user.organisation.banner_text %> + +
+ <%end%> + + <%end%> <%end%>
\ No newline at end of file