Sha256: ddbfdd00644544d1c3e0aac9aa8802dfa6fc3078090af8b38a1a92480d20d8d8

Contents?: true

Size: 971 Bytes

Versions: 10

Compression:

Stored size: 971 Bytes

Contents

class Kaui::BundleTagsController < Kaui::EngineController

  def edit
    @bundle_id = params.require(:bundle_id)

    fetch_tag_names = lambda { @tag_names = (Kaui::Tag.all_for_bundle(@bundle_id, false, 'NONE', options_for_klient).map { |tag| tag.tag_definition_name }).sort }
    fetch_available_tags = lambda { @available_tags = Kaui::TagDefinition.all_for_bundle(options_for_klient) }

    run_in_parallel fetch_tag_names, fetch_available_tags
  end

  def update
    account_id = params.require(:account_id)
    bundle_id = params.require(:bundle_id)

    tags = []
    params.each do |tag, tag_name|
      tag_info = tag.split('_')
      next if tag_info.size != 2 or tag_info[0] != 'tag'
      tags << tag_info[1]
    end

    Kaui::Tag.set_for_bundle(bundle_id, tags, current_user.kb_username, params[:reason], params[:comment], options_for_klient)
    redirect_to kaui_engine.account_bundles_path(account_id), :notice => 'Bundle tags successfully set'
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kaui-0.15.5 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.15.4 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.15.3 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.15.2 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.15.1 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.15.0 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.14.2 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.14.1 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.14.0 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.12.0 app/controllers/kaui/bundle_tags_controller.rb