-
-
Save ROFISH/1888936 to your computer and use it in GitHub Desktop.
haml2erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ErbEngine < Haml::Engine | |
def push_script(text, preserve_script, in_tag = false, preserve_tag = false, | |
escape_html = false, nuke_inner_whitespace = false) | |
push_text "<%= #{text.strip} %>" | |
end | |
def push_silent(text, can_suppress = false) | |
push_text "<% #{text.strip} %>" | |
end | |
def parse_tag(line) | |
out = super | |
out[2][:old].gsub!(/\#\{(.*?)\}/) { |match| "<%= #{$1} %>" } if out[2][:old] | |
out | |
end | |
end | |
s='.overlay.centercenter | |
.lolflexbox | |
%h3=t("forum.topic.deleted_notice") | |
%ul.util | |
%li | |
%a.button{:href=>"#",:onclick=>"$(\"#post#{message.id} .overlay\").fadeOut();return false;"}=t("forum.topic.show_deleted_post")' | |
ErbEngine.new(s,:escape_attrs=>false).to_html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='overlay centercenter'> | |
<div class='lolflexbox'> | |
<h3> <%= t("forum.topic.deleted_notice") %> | |
</h3> | |
<ul class='util'> | |
<li> | |
<a class='button' href='#' onclick='$("#post<%= message.id %> .overlay").fadeOut();return false;'> <%= t("forum.topic.show_deleted_post") %> | |
</a> | |
</li> | |
</ul> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment