Project

General

Profile

Revision ada932ab

Added by Dmitri Dolguikh over 7 years ago

Fixes #7647: Added support for external registries

View differences:

app/views/containers/steps/image.html.erb
1 1
<%= javascript 'foreman_docker/image_step' %>
2 2
<%= stylesheet 'foreman_docker/autocomplete' %>
3
<%= render :layout => 'title', :locals => { :step => 2 } do %>
4
  <ul class="nav nav-tabs" data-tabs="tabs">
5
    <li class="active"><a href="#primary" data-toggle="tab">
6
      <span class="glyphicon glyphicon-cloud-download"></span>
7
      <%= _("Docker hub") %>
8
    </a></li>
9
  </ul>
10 3

  
11
  <%= form_for @container, :class => 'form-horizontal', :url => wizard_path, :method => :put do |f| %>
4
<%= render :layout => 'title', :locals => { :step => 2 } do %>
5
    <ul class="nav nav-tabs" data-tabs="tabs">
6
      <li class="active"><a href="#hub" data-toggle="tab" id="hub_tab">
7
        <span class="glyphicon glyphicon-cloud-download"></span>
8
        <%= _("Docker hub") %>
9
      </a></li>
10
      <li><a href="#registry" data-toggle="tab" id="registry_tab">
11
        <span class="glyphicon glyphicon-cloud-download"></span>
12
        <%= _("External registry") %>
13
      </a></li>
14
    </ul>
12 15

  
13
  <div class="tab-content">
14
    <div class="tab-pane active" id="hub">
15
      <div class="form-group col-md-6">
16
        <%= label_tag "image[search]", _('Search'), :class=>"col-sm-2 control-label" %>
17
        <div class="input-group">
18
          <%= auto_complete_search(:image, '',
19
                                   :'data-url'  => auto_complete_image_container_path(@container),
20
                                   :value       => f.object.image.present? ? f.object.image.image_id : '',
21
                                   :id          => :search,
22
                                   :focus_on_load => true,
23
                                   :placeholder => _('Find your favorite container, e.g: centos')) %>
24
          <span class="input-group-addon glyphicon" id="search-addon"></span>
25
          <span class="input-group-btn">
26
            <%= button_tag(:class      => 'btn btn-default',
27
                           :type       => 'button',
28
                           :id         => 'search_image',
29
                           :'data-url' => search_image_container_path(@container),
30
                           :onclick    => 'searchImage(this)') do %>
31
            <span class="glyphicon glyphicon-search"></span>
32
            <% end %>
33
          </span>
34
        </div>
35
      </div>
36
      <%= text_f f, :tag,
37
                    :value      => f.object.tag.present? ? f.object.tag.tag : '',
38
                    :id         => 'tag',
39
                    :'data-url' => auto_complete_image_tags_container_path(@container) %>
40
      <div class="col-md-12">
41
        <div id='searching_spinner' class='col-md-offset-3 hide'>
42
          <span id='waiting_text'>
43
          </span>
44
          <%= image_tag('/assets/spinner.gif', :id => 'loading_images_indicator') %>
16
    <%= form_for @container, :class => 'form-horizontal', :url => wizard_path, :method => :put do |f| %>
17
        <div class="tab-content">
18
          <div class="tab-pane active" id="hub">
19
          </div>
20
          <div class="tab-pane" id="registry">
21
            <div class="input-group col-md-6">
22
              <%= select_registry f %>
23
            </div>
24
          </div>
25
          <div>
26
            <div class="form-group col-md-6">
27
              <%= label_tag "image[search]", _('Search'), :class=>"col-sm-2 control-label" %>
28
              <div class="input-group">
29
                <%= auto_complete_search('image[image_id]', '',
30
                                         :'data-url'  => auto_complete_image_container_path(@container),
31
                                         :value       => f.object.image.present? ? f.object.image.image_id : '',
32
                                         :id          => :search,
33
                                         :focus_on_load => true,
34
                                         :placeholder => _('Find your favorite container, e.g: centos')) %>
35
                <span class="input-group-addon glyphicon" id="search-addon"></span>
36
                <span class="input-group-btn">
37
                  <%= button_tag(:class      => 'btn btn-default',
38
                                 :type       => 'button',
39
                                 :id         => 'search_image',
40
                                 :'data-url' => search_image_container_path(@container),
41
                                 :onclick    => 'searchImage(this)') do %>
42
                    <span class="glyphicon glyphicon-search"></span>
43
                  <% end %>
44
                </span>
45
              </div>
46
            </div>
47
            <%= text_f f, :tag,
48
                          :value      => f.object.tag.present? ? f.object.tag.tag : '',
49
                          :id         => 'tag',
50
                          :'data-url' => auto_complete_image_tags_container_path(@container) %>
51
            <div class="col-md-12">
52
              <div id='searching_spinner' class='col-md-offset-3 hide'>
53
                <span id='waiting_text'>
54
                </span>
55
                <%= image_tag('/assets/spinner.gif', :id => 'loading_images_indicator') %>
56
              </div>
57
              <div id='image_search_results'>
58
              </div>
59
            </div>
60
          </div>
61
          <%= render :partial => 'form_buttons' %>
45 62
        </div>
46
        <div id='image_search_results'>
47
        </div>
48
      </div>
49
      <hr/>
50
      <%= render :partial => 'form_buttons' %>
51
    </div>
52
  </div>
53

  
54
  <% end %>
63
    <% end %>
55 64
<% end %>

Also available in: Unified diff