Sha256: 89a532377c3bef3d15b4dedf0678291e8f5b04d94f0a032f8853bd1164ac2660

Contents?: true

Size: 1.01 KB

Versions: 43

Compression:

Stored size: 1.01 KB

Contents

module Releaf::I18nDatabase::Translations
  class IndexBuilder < Releaf::Builders::IndexBuilder
    include Releaf::I18nDatabase::Translations::BuildersCommon

    def text_search_content
      search_only_blank_ui + super
    end

    def search_only_blank_ui
      search_field "only-blank" do
        [
          check_box_tag(:only_blank, 'true', params[:only_blank].present? ),
          label_tag(:only_blank, t("Only blank"))
        ]
      end
    end

    def footer_primary_tools
      [edit_button]
    end

    def footer_secondary_tools
      [export_button, import_button, import_form]
    end

    def import_button
      button(t("Import"), "upload", name: "import", class: "secondary")
    end

    def import_form
      form_tag(url_for(action: 'import'), multipart: true, class: 'import') do
        file_field_tag :import_file
      end
    end

    def edit_button
      button(t("Edit"), "edit", class: "primary", href: action_url(:edit))
    end

    def text_search_available?
      true
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
releaf-i18n_database-3.1.0 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-3.0.3 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-3.0.2 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-3.0.1 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-3.0.0 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-2.2.1 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-2.2.0 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-2.1.2 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-2.1.1 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-2.1.0 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-2.0.1 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-2.0.0 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.22 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.21 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.20 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.19 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.18 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.17 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.16 app/builders/releaf/i18n_database/translations/index_builder.rb
releaf-i18n_database-1.1.15 app/builders/releaf/i18n_database/translations/index_builder.rb