diff --git a/app/models/org.rb b/app/models/org.rb index 807d4b3..66c2bfb 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -40,7 +40,7 @@ dragonfly_accessor :logo do after_assign :resize_image end - validates_property :height, of: :logo, in: (0..100), message: _("height must be less than 100px") + validates_property :height, of: :logo, in: (0..165), message: _("height must be less than 165px") validates_property :format, of: :logo, in: ['jpeg', 'png', 'gif','jpg','bmp'], message: _("must be one of the following formats: jpeg, jpg, png, gif, bmp") validates_size_of :logo, maximum: 500.kilobytes, message: _("can't be larger than 500KB") @@ -124,98 +124,6 @@ end ## - # finds all organisations who have a parent of the passed organisation type - # - # @param [String] the name of an organisation type - # @return [Array] -=begin - def self.orgs_with_parent_of_type(org_type) - parents = OrganisationType.find_by_name(org_type).organisations - children = Array.new - parents.each do |parent| - children += parent.children - end - return children - end - - ## - # returns a list of all guidance groups belonging to other organisations - # - # @return [Array] - def self.other_organisations - org_types = [GlobalHelpers.constant("organisation_types.funder")] - organisations_list = [] - org_types.each do |ot| - new_org_obejct = OrganisationType.find_by_name(ot) - - org_with_guidance = GuidanceGroup.joins(new_org_obejct.organisations) - - organisations_list = organisations_list + org_with_guidance - end - return organisations_list - end - - - ## - # returns a list of all guidance groups belonging to other organisations - # - # @return [Array] - def self.other_organisations - org_types = [GlobalHelpers.constant("organisation_types.funder")] - organisations_list = [] - org_types.each do |ot| - new_org_obejct = OrganisationType.find_by_name(ot) - - org_with_guidance = GuidanceGroup.joins(new_org_obejct.organisations) - - organisations_list = organisations_list + org_with_guidance - end - return organisations_list - end - - ## - # returns a list of all sections of a given version from this organisation and it's parents - # - # @param version_id [Integer] version number of the section - # @return [Array
] list of sections - def all_sections(version_id) - if parent.nil? - secs = sections.where("version_id = ?", version_id) - if secs.nil? then - secs = Array.new - end - return secs - else - return sections.where("version_id = ? ", version_id).all + parent.all_sections(version_id) - end - end - - ## - # returns the guidance groups of this organisation and all of it's children - # - # @return [Array] list of guidance groups - def all_guidance_groups - ggs = guidance_groups - children.each do |c| - ggs = ggs + c.all_guidance_groups - end - return ggs - end - - ## - # returns the highest parent organisation in the tree - # - # @return [organisation] the root organisation - def root - if parent.nil? - return self - else - return parent.root - end - end -=end - - ## # returns all published templates belonging to the organisation # # @return [Array] published dmptemplates @@ -238,8 +146,8 @@ # def resize_image unless logo.nil? - if logo.height != 100 - self.logo = logo.thumb('x100') # resize height and maintain aspect ratio + if logo.height != 165 + self.logo = logo.thumb('x165') # resize height and maintain aspect ratio end end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 1dbf52b..9d49705 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -129,7 +129,7 @@ follow_redirects assert_response :success - assert_select 'main .page h1', _('My plans') + assert_select 'main .page h1', _('My Dashboard') end # ----------------------------------------------------------------------