Skip to content

Instantly share code, notes, and snippets.

@jonasschneider
Created December 20, 2011 21:51
Show Gist options
  • Save jonasschneider/1503458 to your computer and use it in GitHub Desktop.
Save jonasschneider/1503458 to your computer and use it in GitHub Desktop.
- def enquote(raw_text)
- text = raw_text.strip
- return "<span class=quotesym>„</span>#{text}<span class=quotesym>“</span>"
.memoir{ :class => defined?(on_show_page) ? 'show' : '' }
%span.number= memoir.number
- if memoir.is_quote?
%p.quote= enquote memoir.quoted_text
%p.quotesource= memoir.person
- elsif memoir.is_dialogue?
- reset_cycle
- memoir.dialogue_lines.each do |line|
%p.dialogue{ :class => cycle }
- if line[:speaker]
%span.speaker= line[:speaker]
- unless line[:style].nil?
%span.style= line[:style]
- unless line[:message].nil? || line[:message].empty?
%span.quote= enquote line[:message]
- elsif line[:action]
%span.action= line[:action]
- else
= line[:message]
- else
%p.quote= memoir.text
.clearfix
- unless defined?(skip_details)
.details
%a{ :href => url_for_memoir(memoir) }== #{memoir.person} am #{format_date(memoir.created_at)}
- if defined? on_show_page
= facebook_like_button
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment