Maintain size of sponsor logos

Places logo on a white background if image is smaller than the given
constrains.
Resizes the logo if image is larger than constrains.
Validation of presence of logo was moved cause file field wasn't getting
marked as required field ('*' thingy) in form.
`- if logo presence` was removed cause logo is mandatory field.
This commit is contained in:
Aditya Prakash 2016-04-20 12:13:07 +05:30
parent 647a40be63
commit af08d843a8
3 changed files with 26 additions and 7 deletions

View file

@ -0,0 +1,12 @@
module SponsorsHelper
# returns the url to be used for logo on basis of sponsorship level position
def get_logo(sponsor)
if sponsor.sponsorship_level.position == 1
sponsor.logo.url(:first)
elsif sponsor.sponsorship_level.position == 2
sponsor.logo.url(:second)
else
sponsor.logo.url(:others)
end
end
end