/
add_repository_from_default_list.html.erb
47 lines (39 loc) · 1.86 KB
/
add_repository_from_default_list.html.erb
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
39
40
41
42
43
44
45
46
47
<% @pagetitle = 'Add Repository'
@metarobots = 'noindex'
project_bread_crumb @pagetitle
-%>
<%= render :partial => 'tabs' %>
<h2>Add Repositories to <%= @project %></h2>
<p>Please choose the repositories that your packages will be built for by following default list. Or
<%= link_to 'pick one via advanced interface', :action => :add_repository, :project => @project %>.
</p>
<%= form_tag(:action => :save_distributions, :project => @project) do %>
<% @distributions.each do |vendor, list| %>
<h3><%= sprite_tag("distributions-#{vendor.downcase}") %> <%= vendor -%> distributions</h3>
<p>
<% list.each do |distribution| %>
<% selected = @project.has_distribution(distribution['project'], distribution['repository']) %>
<span class="nowrap">
<%= check_box_tag 'distributions[]', distribution['reponame'], selected, :disabled => selected, :id => 'repo_' + distribution['reponame'], :class => 'repocheckbox' -%>
<label for="<%= "repo_#{distribution['reponame']}" %>"><%= distribution['name'] %></label>
</span>
<% end -%>
</p>
<% end -%>
<h3><%= image_tag('distributions/kiwi.png', :width => 40) %> Kiwi image builds</h3>
<p>
<span class="nowrap">
<% selected = @project.repositories.where(name: 'images').count > 0 -%>
<%= check_box_tag 'images', 'true', selected, :disabled => selected, :id => 'repo_images', :class => 'repocheckbox' -%>
<label for="repo_images">
KIWI image build <i>(to be used for appliance and product builds with kiwi)</i>
</label>
</span>
</p>
<p>
<%= submit_tag 'Add selected repositories', :disabled => true, :id => 'submitrepos' -%>
</p>
<% end %>
<%= content_for :ready_function do %>
$('.repocheckbox').click(function() { $('#submitrepos').removeAttr('disabled'); } );
<% end %>