Project

General

Profile

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

foreman_docker / app / views / containers / steps / _image_hub_tab.html.erb @ 329cfcba

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
      <%= select_registry f %>
21
  <% end -%>
22

    
23
  <% help_type = f.object.errors[:repository_name].present? ? :help_block : :help_inline %>
24
  <%= text_f(f, :repository_name,
25
    :label => _('Search'),
26
    :wrapper_class => (image_search_wrapper_class(model) if tab_active?(registry)),
27
    :'data-url'  => search_repository_image_search_path(model.compute_resource_id),
28
    :value       => f.object.repository_name.present? ? f.object.repository_name : '',
29
    :'data-registry' => registry,
30
    :'data-image' => true,
31
    :'data-min-length' => 1,
32
    :focus_on_load => true,
33
    :placeholder => _('Find your favorite container, e.g. centos'),
34
    :control_group_id => "#{registry}_image_search",
35
    :help_inline => spinner('', class: 'hide autocomplete-status')) %>
36

    
37
  <%= text_f f, :tag,
38
    :control_group_id => "#{registry}_tag_search",
39
    :'data-registry' => registry,
40
    :'data-tag' => true,
41
    :'data-min-length' => 0,
42
    :'data-url' => search_repository_image_search_path(model.compute_resource_id),
43
    :help_inline => spinner('', class: 'hide autocomplete-status') %>
44

    
45
  <div class="col-md-6 col-md-offset-2 small-gutter">
46
    <%= link_to(icon_text('search', _('Search for images')), "#",
47
          :id => "search_repository_button_#{registry}",
48
          :class => 'image-search-button btn btn-default',
49
          :'data-registry' => registry,
50
          :'data-url' => search_repository_image_search_path(model.compute_resource_id)) %>
51
  </div>
52

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