forked from Katello/katello
/
_new.html.haml
38 lines (29 loc) · 1.77 KB
/
_new.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
= content_for :title do
#{_("New Activation Key")}
= content_for :content do
.full#new_key
= kt_form_for ActivationKey.new do |form|
= form.text_field :name, :label =>_("Name")
= form.text_area :description, :label => _("Description"), :size => "40x4"
.promotion_paths
= hidden_field_tag 'activation_key[environment_id]', @environment.id unless @environment.nil?
= form.field :environment_id, :label => _("Environment"), :grid => [2,7] do
- if @environment.nil?
#{_("No environments are currently available in this organization. Please add some to be able to create activation keys.")}
- else
= environment_selector(:path_widget_class=>"grid_7", :path_entries_class=>"grid_7", :library_clickable=>false,
:accessible_envs=>accessible_envs, :url_content_views_proc=>url_content_views_proc)
.clear
- if Katello.config.katello?
= form.field :content_view_id, :label => _("Content View"), :wrapper => {:id => "content_views"}, :grid => [2,7] do
= select_tag 'activation_key[content_view_id]',
options_for_select(content_view_select_labels(@organization, @environment), no_content_view),
:tabindex => auto_tab_index
= form.field :usage_limit, :label => _("Usage Limit"), :grid => [2,7] do
= number_field_tag 'activation_key[usage_limit]', params[:usage_limit], :size => "4", :tabindex => form.tabindex, :min => 1, :id => :activation_key_usage_limit, :disabled => true
%label
%input{:type => "checkbox", :checked => 'checked', :id => :usage_limit_checkbox, :tabindex=>form.tabindex}
= _("Unlimited")
= form.submit _("Save"), :id => :save_key
= render :template => "layouts/tupane_layout"