Sha256: 319abbce6dc334d58c94b3e0b576379eed01625e7b61c737051e180ac511ae90

Contents?: true

Size: 1.7 KB

Versions: 2

Compression:

Stored size: 1.7 KB

Contents

- title "Translations"

#add-translation.modal.hide.fade
  .modal-header
    %a.close{"data-dismiss" => "modal"} ×
    %h3 Translation
  .modal-body
    .row
      = form_tag translations_path, id: 'form-translation' do
        .span1
          = label_tag :locale
          = text_field_tag :locale, '', class: 'span1', autofocus: true

        .span4
          = label_tag :key
          = text_field_tag :key, '', class: 'span4'

        .span5
          = label_tag :value
          = text_area_tag :value, '', class: 'span5'
        .span2
          %br
          = button_tag "Submit", class: 'btn'

.navbar
  .navbar-inner
    = form_tag translations_path, class: 'navbar-form pull-left', method: :get do
      = text_field_tag :query, params[:query], hint: 'Search', autofocus: true
      = button_tag 'search', class: 'btn'
      = link_to 'clear', translations_path, class: 'btn'

    .pull-right
      = link_to 'new', '#', data: { toggle: "modal", target: '#add-translation'}, class: 'btn add-translation'
%hr/
%table.table.table-hover
  %thead
    %th key
    - I18n.available_locales.each do |locale|
      %th= locale
  %tbody
    - @translations.each do |key|
      %tr
        %td= key
        - I18n.available_locales.each do |locale|
          %td
            = link_to '#', data: {key: key, locale: locale, toggle: "modal", target: '#add-translation'}, class: "edit-translation #{(I18nDashboard::Translation.exists?(key, locale) ? nil : 'text-error')}" do
              = t(key, locale: locale, default: humanize_key(key))
        %td
          - unless I18nDashboard::Translation.system_key?(key)
            = link_to translation_path(key), method: :delete, class: 'btn btn-mini btn-danger' do
              %i.icon-trash

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
i18n_dashboard-0.1.4 app/views/i18n_dashboard/translations/index.html.haml
i18n_dashboard-0.1.3 app/views/i18n_dashboard/translations/index.html.haml