summaryrefslogtreecommitdiff
path: root/new/lib/crys/processors/mixins/common_parts.rb
diff options
context:
space:
mode:
Diffstat (limited to 'new/lib/crys/processors/mixins/common_parts.rb')
-rw-r--r--new/lib/crys/processors/mixins/common_parts.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/new/lib/crys/processors/mixins/common_parts.rb b/new/lib/crys/processors/mixins/common_parts.rb
new file mode 100644
index 00000000..a6c2dc16
--- /dev/null
+++ b/new/lib/crys/processors/mixins/common_parts.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+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