%h1
  EC2 Uploader

%p
  Select the Amazon EC2 region to which you want to upload your cloud image.
  Please note that it is necessary to have the OBS public key available in this region before starting the upload job.
  Please have a lookt at your
  = link_to "Amazon EC2 configuration", cloud_ec2_configuration_path
  for more information.

%h3
  Upload image

= form_for @upload_job, url: cloud_upload_index_path, method: :post do |upload_job_form|
  %p
    Filename:
    %b
      = @upload_job.filename
  %p
    = upload_job_form.label 'cloud_backend_upload_job[ami_name]', "AMI Name:"
    = upload_job_form.text_field :filename, size: 35, name: 'cloud_backend_upload_job[ami_name]'
  %p
    = upload_job_form.label 'cloud_backend_upload_job[region]', "Region:"
    = select_tag('cloud_backend_upload_job[region]', options_for_select(@ec2_regions))
  %p
    = upload_job_form.label 'cloud_backend_upload_job[vpc_subnet_id]', 'VPC Subnet ID (eg. subnet-12345678, optional):'
    = sprite_tag('help', title: "We create a temporary subnet, if you don't provide one.")
    = upload_job_form.text_field(:vpc_subnet_id, size: 35, name: 'cloud_backend_upload_job[vpc_subnet_id]')
  %p
    = upload_job_form.hidden_field :project
    = upload_job_form.hidden_field :package
    = upload_job_form.hidden_field :arch
    = upload_job_form.hidden_field :repository
    = upload_job_form.hidden_field :filename
    = upload_job_form.hidden_field :target, value: 'ec2'
  %p
    = submit_tag 'Upload Image'

%p
  = link_to "All Cloud Uploads", cloud_upload_index_path
