Skip to content

Instantly share code, notes, and snippets.

@otobrglez
Created October 16, 2014 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otobrglez/0a50795de7b316a91ec8 to your computer and use it in GitHub Desktop.
Save otobrglez/0a50795de7b316a91ec8 to your computer and use it in GitHub Desktop.
Collapsable Bootstrap Panels
- I18n.available_locales.each_with_index do |locale,i|
- ulocale = locale.to_s.underscore
- show_expanded = [:'en-US', I18n.locale].include?(locale)
.panel.panel-default{id: ulocale}
%a.panel-default{"data-toggle" => "collapse", "data-parent" => "##{ulocale}", "href" => "#panel-#{ulocale}"}
.panel-heading
.panel-title= CONFIG[:display_locales][locale]
.panel-collapse.collapse{id: "panel-#{ulocale}", class: (show_expanded ? "in" : "out") }
.panel-body
= f.input :"title_#{ulocale}", label: "Title"
= f.label :"excerpt_#{ulocale}", "Short Synopsis"
%small 300-char limit
= f.input :"excerpt_#{ulocale}", as: :text, input_html: {'rows' => 5}, label: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment