This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/shared/attribute_field/_placeholder_block.html.erb

25 lines
1.6 KiB
Plaintext
Raw Normal View History

<% values ||=[]%>
2013-08-09 07:07:05 +00:00
<%= content_tag :div,:class=>"control-group" do%>
<label class="control-label muted" for=""><%= (defined? label_ext) ? label_ext : t(:placeholder) %></label>
<div class="controls">
2013-08-09 07:07:05 +00:00
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_in_use_locales.first ? "active in" : "'") %>
<%= content_tag :div,:class=>"tab-pane fade #{active}",:id=>"#{name_to_id(field_name)}_#{locale}" do%>
<% locale_value = values[locale.to_s] rescue nil%>
2013-08-09 07:07:05 +00:00
<%= text_field(field_name, locale,:value=>locale_value,:placeholder=>I18nVariable.from_locale(locale),:data=>{:type=>"lang_#{locale}"}) %>
<% end %>
<% end %>
</div>
2013-08-09 07:07:05 +00:00
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
2013-08-09 07:07:05 +00:00
<%= link_to I18nVariable.from_locale(locale),"##{name_to_id(field_name)}_#{locale}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
<% end %>
</div>
</div>
</div>
<% end %>