Project

General

Profile

Download (2.28 KB) Statistics
| Branch: | Tag: | Revision:

foreman_docker / app / views / containers / steps / _image_hub_tab.html.erb @ f6a9acbd

1
<%- model = model_for(registry) %>
2
<%= form_for model, :namespace => registry,
3
  :class => 'form-horizontal',
4
  :url => wizard_path,
5
  :method => :put,
6
  :html => {:data => {:registry => registry}} do |f| %>
7

    
8
  <% model.errors.messages.each do |field, field_errors| %>
9
    <div class="alert alert-danger">
10
      <span class="pficon pficon-error-circle-o"></span>
11
      <ul>
12
        <% field_errors.each do |message| %>
13
          <li><%= message %></li>
14
        <% end %>
15
      </ul>
16
    </div>
17
  <% end %>
18

    
19
  <% if registry == "registry" -%>
20
    <div class="input-group col-md-6">
21
      <%= select_registry f %>
22
    </div>
23
  <% end -%>
24

    
25
  <% help_type = f.object.errors[:repository_name].present? ? :help_block : :help_inline %>
26
  <%= text_f(f, :repository_name,
27
    :label => _('Search'),
28
    :size => 'col-md-6',
29
    :wrapper_class => (image_search_wrapper_class(model) if tab_active?(registry)),
30
    :'data-url'  => auto_complete_repository_name_image_search_path(model.compute_resource_id),
31
    :value       => f.object.repository_name.present? ? f.object.repository_name : '',
32
    :'data-registry' => registry,
33
    :'data-image' => true,
34
    :'data-search' => true,
35
    :'data-min-length' => 1,
36
    :focus_on_load => true,
37
    :placeholder => _('Find your favorite container, e.g. centos'),
38
    :control_group_id => "#{registry}_image_search",
39
    help_type => link_to_function(
40
        icon_text('search', ''),
41
        'searchRepo(this)',
42
        :class => 'btn btn-default',
43
        :id => "search_repository_#{registry}",
44
        :'data-registry' => registry,
45
        :'data-url' => search_repository_image_search_path(model.compute_resource_id)
46
      ) + content_tag(:span, '', :id => 'image-confirmation').html_safe) %>
47

    
48
  <%= text_f f, :tag,
49
    :control_group_id => "#{registry}_tag_search",
50
    :'data-registry' => registry,
51
    :'data-tag' => true,
52
    :'data-url' => auto_complete_image_tag_image_search_path(model.compute_resource_id) %>
53

    
54
  <div class="col-md-12">
55
    <div data-search-spinner=true class='col-md-offset-3 hide'>
56
      <span data-wait-text=true>
57
      </span>
58
      <%= spinner('', :id => "loading_repositories_indicator_#{registry}") %>
59
    </div>
60
    <div data-repository-search-results=true >
61
    </div>
62
  </div>
63
  <%= render :partial => 'form_buttons', locals: { :registry => registry} %>
64
<% end -%>