summaryrefslogtreecommitdiff
path: root/new/lib/crys/processors/common_parts.rb
blob: 1dbf6d82de699ec2f6f93dbde0a32e022a4903ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Crys
  module CommonParts
    def webbutton(file:, url:, alt:)
      full_path = image_dir + "/buttons/" +  file
    
      image = ::Crys::ImageProcessor.new(path: full_path, filename: file, width: 88)
      assets << image

      code = ERB.new <<-EOF
<a href="<%=url%>">
<img src="<%=image.relative_path%>" width="88" height="31" class="webbutton" alt="<%=alt%>">
</a>
EOF

      code.result(binding)

    end

  end
end