machinery-tool 1.14.2 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +14 -0
  4. data/html/assets/compare/machinery.js +20 -13
  5. data/html/assets/file_loader.gif +0 -0
  6. data/html/assets/machinery-base.css +21 -12
  7. data/html/assets/machinery-base.js +19 -0
  8. data/html/assets/machinery.css +35 -11
  9. data/html/assets/show/machinery.js +24 -7
  10. data/html/comparison.html.haml +13 -36
  11. data/html/index.html.haml +32 -47
  12. data/html/partials/changed_managed_files.html.haml +5 -5
  13. data/html/partials/compare/changed_managed_file_list.html.haml +1 -1
  14. data/html/partials/compare/changed_managed_files.html.haml +41 -47
  15. data/html/partials/compare/changes.html.haml +8 -0
  16. data/html/partials/compare/config_file_list.html.haml +5 -5
  17. data/html/partials/compare/config_files.html.haml +38 -44
  18. data/html/partials/compare/group_list.html.haml +3 -3
  19. data/html/partials/compare/groups.html.haml +34 -42
  20. data/html/partials/compare/os.html.haml +21 -23
  21. data/html/partials/compare/package_list.html.haml +2 -2
  22. data/html/partials/compare/packages.html.haml +40 -56
  23. data/html/partials/compare/pattern_list.html.haml +2 -2
  24. data/html/partials/compare/patterns.html.haml +40 -42
  25. data/html/partials/compare/repositories.html.haml +40 -41
  26. data/html/partials/compare/service_list.html.haml +1 -1
  27. data/html/partials/compare/services.html.haml +44 -36
  28. data/html/partials/compare/summary.html.haml +17 -0
  29. data/html/partials/compare/unmanaged_file_list.html.haml +4 -3
  30. data/html/partials/compare/unmanaged_files.html.haml +44 -38
  31. data/html/partials/compare/user_list.html.haml +2 -2
  32. data/html/partials/compare/users.html.haml +40 -43
  33. data/html/partials/config_files.html.haml +8 -8
  34. data/html/partials/os.html.haml +8 -5
  35. data/html/partials/packages.html.haml +4 -4
  36. data/html/partials/patterns.html.haml +2 -2
  37. data/html/partials/repositories.html.haml +5 -5
  38. data/html/partials/scope_header.html.haml +4 -6
  39. data/html/partials/services.html.haml +1 -1
  40. data/html/partials/unmanaged_files.html.haml +1 -1
  41. data/html/partials/users.html.haml +4 -4
  42. data/lib/array.rb +4 -0
  43. data/lib/cli.rb +12 -4
  44. data/lib/file_scope.rb +9 -3
  45. data/lib/html.rb +1 -0
  46. data/lib/machinery.rb +1 -0
  47. data/lib/scope.rb +16 -0
  48. data/lib/server.rb +61 -23
  49. data/lib/system_description.rb +0 -8
  50. data/lib/try.rb +28 -0
  51. data/lib/version.rb +1 -1
  52. data/machinery-helper/version.go +1 -1
  53. data/man/generated/machinery.1.gz +0 -0
  54. data/man/generated/machinery.1.html +54 -22
  55. data/plugins/changed_managed_files/{changed_managed_files.md → changed_managed_files.yml} +4 -0
  56. data/plugins/changed_managed_files/changed_managed_files_model.rb +14 -0
  57. data/plugins/changed_managed_files/changed_managed_files_renderer.rb +17 -0
  58. data/plugins/config_files/{config_files.md → config_files.yml} +4 -0
  59. data/plugins/config_files/config_files_model.rb +14 -0
  60. data/plugins/config_files/config_files_renderer.rb +17 -0
  61. data/plugins/groups/{groups.md → groups.yml} +4 -0
  62. data/plugins/groups/groups_model.rb +14 -0
  63. data/plugins/groups/groups_renderer.rb +17 -0
  64. data/plugins/os/{os.md → os.yml} +4 -0
  65. data/plugins/packages/{packages.md → packages.yml} +4 -0
  66. data/plugins/packages/packages_model.rb +1 -12
  67. data/plugins/patterns/{patterns.md → patterns.yml} +4 -0
  68. data/plugins/patterns/patterns_model.rb +14 -0
  69. data/plugins/patterns/patterns_renderer.rb +21 -0
  70. data/plugins/repositories/{repositories.md → repositories.yml} +4 -0
  71. data/plugins/repositories/repositories_model.rb +14 -0
  72. data/plugins/repositories/repositories_renderer.rb +17 -0
  73. data/plugins/services/{services.md → services.yml} +4 -0
  74. data/plugins/services/services_model.rb +21 -11
  75. data/plugins/services/services_renderer.rb +17 -0
  76. data/plugins/unmanaged_files/{unmanaged_files.md → unmanaged_files.yml} +4 -0
  77. data/plugins/unmanaged_files/unmanaged_files_model.rb +2 -1
  78. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +17 -0
  79. data/plugins/users/{users.md → users.yml} +4 -0
  80. data/plugins/users/users_model.rb +38 -0
  81. data/plugins/users/users_renderer.rb +17 -0
  82. metadata +17 -32
  83. data/html/assets/logo-changed-managed-files-small.png +0 -0
  84. data/html/assets/logo-changed-managed-files.png +0 -0
  85. data/html/assets/logo-config-files-small.png +0 -0
  86. data/html/assets/logo-config-files.png +0 -0
  87. data/html/assets/logo-groups-small.png +0 -0
  88. data/html/assets/logo-groups.png +0 -0
  89. data/html/assets/logo-os-small.png +0 -0
  90. data/html/assets/logo-os.png +0 -0
  91. data/html/assets/logo-packages-small.png +0 -0
  92. data/html/assets/logo-packages.png +0 -0
  93. data/html/assets/logo-patterns-small.png +0 -0
  94. data/html/assets/logo-patterns.png +0 -0
  95. data/html/assets/logo-repositories-small.png +0 -0
  96. data/html/assets/logo-repositories.png +0 -0
  97. data/html/assets/logo-services-small.png +0 -0
  98. data/html/assets/logo-services.png +0 -0
  99. data/html/assets/logo-unmanaged-files-small.png +0 -0
  100. data/html/assets/logo-unmanaged-files.png +0 -0
  101. data/html/assets/logo-users-small.png +0 -0
  102. data/html/assets/logo-users.png +0 -0
@@ -15,11 +15,11 @@
15
15
  %tr
16
16
  %th Name
17
17
  %th Package Name
18
- %th Package Version
19
- %th Changes
20
- %th Mode
21
- %th User
22
- %th Group
18
+ %th.medium Package Version
19
+ %th.medium Changes
20
+ %th.small Mode
21
+ %th.small User
22
+ %th.small Group
23
23
  %tbody
24
24
  - changed_managed_files.files.each do |file|
25
25
  %tr
@@ -6,7 +6,7 @@
6
6
  %tr
7
7
  %th Name
8
8
  %th Package Name
9
- %th Package Version
9
+ %th.medium Package Version
10
10
  %th.small Changes
11
11
  %th.small Mode
12
12
  %th.small User
@@ -1,57 +1,51 @@
1
1
  - if @diff["changed_managed_files"]
2
- %a.scope_anchor{ id: "changed_managed_files" }
2
+ - scope = "changed_managed_files"
3
+ %a.scope_anchor{ id: scope }
3
4
  .scope#changed_managed_files_container
4
5
  .row
5
6
  .col-xs-1
6
- %a{ href: "#changed_managed_files" }
7
- %img.over.scope_logo_big{ :src => "/assets/logo-changed-managed-files.png",
8
- "data-toggle" => "popover",
9
- :title => "Changed Managed Files",
10
- "data-content" => "#{scope_help("changed_managed_files")}" }
7
+ %a.btn.btn-default.btn-lg.scope_logo_big{ :href => "##{scope}",
8
+ :title => scope_title(scope), "data-toggle"=>"popover",
9
+ "data-content" => scope_help(scope) }
10
+ %span= scope_initials(scope)
11
11
  %span.toggle{ title: "Collapse/Expand" }
12
12
  .col-xs-11
13
13
  %h2
14
14
  Changed Managed Files
15
- .scope-summary
16
- - if @diff["changed_managed_files"].only_in1
17
- %span.summary-part
18
- #{@description_a.name}:
19
- #{safe_length(@diff["changed_managed_files"].only_in1, :files)} files
20
- - if @diff["changed_managed_files"].only_in2
21
- %span.summary-part
22
- #{@description_b.name}:
23
- #{safe_length(@diff["changed_managed_files"].only_in2, :files)} files
24
- - if @diff["changed_managed_files"].common
25
- %span.summary-part
26
- %a.show-common-elements{ href: "#changed_managed_files_both" }<
27
- both
28
- = ": #{safe_length(@diff["changed_managed_files"].common, :files)} files"
15
+ = render_partial "compare/summary",
16
+ scope: "changed_managed_files",
17
+ singular: "file",
18
+ plural: "files"
29
19
  .row.scope_content.collapse.in
30
- .row
31
- .col-xs-1
32
- .col-xs-5.table_container
33
- - if safe_length(@diff["changed_managed_files"].only_in1, :files) > 0
34
- = only_in_a
35
- = render_partial "compare/changed_managed_file_list",
36
- list: @diff["changed_managed_files"].only_in1
37
- .col-xs-1
38
- .col-xs-5.table_container
39
- - if safe_length(@diff["changed_managed_files"].only_in2, :files) > 0
40
- = only_in_b
41
- = render_partial "compare/changed_managed_file_list",
42
- list: @diff["changed_managed_files"].only_in2
43
- - if safe_length(@diff["changed_managed_files"].common, :files) > 0
44
- %a.both_anchor{ id: "changed_managed_files_both" }
20
+ .col-md-12
45
21
  .row
46
- .col-xs-1
47
- .col-xs-11
48
- %a.show-common-elements{ href: "#changed_managed_files_both" }
49
- Show common elements in changed-managed-files
50
- %a.hide-common-elements{ href: "#", style: "display: none" }
51
- Hide common elements in changed-managed-files
52
- .row.scope_common_content.collapse
53
- .col-xs-1
54
- .col-xs-10.table_container
55
- = in_both
56
- = render_partial "compare/changed_managed_file_list",
57
- list: @diff["changed_managed_files"].common
22
+ .col-xs-6.table_container
23
+ - if safe_length(@diff["changed_managed_files"].only_in1, :files) > 0
24
+ = only_in_a
25
+ = render_partial "compare/changed_managed_file_list",
26
+ list: @diff["changed_managed_files"].only_in1
27
+ .col-xs-6.table_container
28
+ - if safe_length(@diff["changed_managed_files"].only_in2, :files) > 0
29
+ = only_in_b
30
+ = render_partial "compare/changed_managed_file_list",
31
+ list: @diff["changed_managed_files"].only_in2
32
+ - if @diff["changed_managed_files"].changed
33
+ %a.both_anchor{ id: "changed_managed_files_changed" }
34
+ .row
35
+ .col-xs-12.table_container
36
+ = changed
37
+ = render_partial "compare/changes", changes: changed_elements("changed_managed_files",
38
+ key: "name")
39
+ - if safe_length(@diff["changed_managed_files"].common, :files) > 0
40
+ %a.both_anchor{ id: "changed_managed_files_both" }
41
+ .row
42
+ .col-xs-12
43
+ %a.show-common-elements{ href: "#changed_managed_files_both" }
44
+ Show common elements in changed-managed-files
45
+ %a.hide-common-elements{ href: "#", style: "display: none" }
46
+ Hide common elements in changed-managed-files
47
+ .row.scope_common_content.collapse
48
+ .col-xs-12.table_container
49
+ = in_both
50
+ = render_partial "compare/changed_managed_file_list",
51
+ list: @diff["changed_managed_files"].common
@@ -0,0 +1,8 @@
1
+ %ul.changed
2
+ - changes.each do |change|
3
+ %li
4
+ = change[:id] + " " + change[:change]
5
+ - if change[:diffable]
6
+ %a.diff-unmanaged-files{ "data-toggle" => "modal",
7
+ "data-target" => "#diff-unmanaged-files", "data-file" => change[:id] }
8
+ (diff)
@@ -6,11 +6,11 @@
6
6
  %tr
7
7
  %th Name
8
8
  %th Package Name
9
- %th Package Version
10
- %th Changes
11
- %th Mode
12
- %th User
13
- %th Group
9
+ %th.medium Package Version
10
+ %th.medium Changes
11
+ %th.small Mode
12
+ %th.small User
13
+ %th.small Group
14
14
  %tbody
15
15
  - list.files.each do |file|
16
16
  %tr
@@ -1,54 +1,48 @@
1
1
  - if @diff["config_files"]
2
- %a.scope_anchor{ id: "config_files" }
2
+ - scope = "config_files"
3
+ %a.scope_anchor{ id: scope }
3
4
  .scope#config_files_container
4
5
  .row
5
6
  .col-xs-1
6
- %a{ href: "#groups" }
7
- %img.over.scope_logo_big{ src: "/assets/logo-config-files.png",
8
- "data-toggle" => "popover",
9
- :title => "Config Files",
10
- "data-content" => "#{scope_help("config_files")}" }
7
+ %a.btn.btn-default.btn-lg.scope_logo_big{ :href => "##{scope}",
8
+ :title => scope_title(scope), "data-toggle"=>"popover",
9
+ "data-content" => scope_help(scope) }
10
+ %span= scope_initials(scope)
11
11
  %span.toggle{ title: "Collapse/Expand" }
12
12
  .col-xs-11
13
13
  %h2
14
14
  Config Files
15
- .scope-summary
16
- - if @diff["config_files"].only_in1
17
- %span.summary-part
18
- #{@description_a.name}:
19
- #{safe_length(@diff["config_files"].only_in1, :files)} files
20
- - if @diff["config_files"].only_in2
21
- %span.summary-part
22
- #{@description_b.name}:
23
- #{safe_length(@diff["config_files"].only_in2, :files)} files
24
- - if @diff["config_files"].common
25
- %span.summary-part
26
- %a.show-common-elements{ href: "#config_files_both" }<
27
- both
28
- = ": #{safe_length(@diff["config_files"].common, :files)} files"
15
+ = render_partial "compare/summary",
16
+ scope: "config_files",
17
+ singular: "file",
18
+ plural: "files"
29
19
  .row.scope_content.collapse.in
30
- .row
31
- .col-xs-1
32
- .col-xs-5.table_container
33
- - if safe_length(@diff["config_files"].only_in1, :files) > 0
34
- = only_in_a
35
- = render_partial "compare/config_file_list", list: @diff["config_files"].only_in1
36
- .col-xs-1
37
- .col-xs-5.table_container
38
- - if safe_length(@diff["config_files"].only_in2, :files) > 0
39
- = only_in_b
40
- = render_partial "compare/config_file_list", list: @diff["config_files"].only_in2
41
- - if safe_length(@diff["config_files"].common, :files) > 0
42
- %a.both_anchor{ id: "config_files_both" }
20
+ .col-md-12
43
21
  .row
44
- .col-xs-1
45
- .col-xs-11
46
- %a.show-common-elements{ href: "#config_files_both" }
47
- Show common elements in config-files
48
- %a.hide-common-elements{ href: "#", style: "display: none" }
49
- Hide common elements in config-files
50
- .row.scope_common_content.collapse
51
- .col-xs-1
52
- .col-xs-10.table_container
53
- = in_both
54
- = render_partial "compare/config_file_list", list: @diff["config_files"].common
22
+ .col-xs-6.table_container
23
+ - if safe_length(@diff["config_files"].only_in1, :files) > 0
24
+ = only_in_a
25
+ = render_partial "compare/config_file_list", list: @diff["config_files"].only_in1
26
+ .col-xs-6.table_container
27
+ - if safe_length(@diff["config_files"].only_in2, :files) > 0
28
+ = only_in_b
29
+ = render_partial "compare/config_file_list", list: @diff["config_files"].only_in2
30
+ - if @diff["config_files"].changed
31
+ %a.both_anchor{ id: "config_files_changed" }
32
+ .row
33
+ .col-xs-12.table_container
34
+ = changed
35
+ = render_partial "compare/changes", changes: changed_elements("config_files",
36
+ key: "name")
37
+ - if safe_length(@diff["config_files"].common, :files) > 0
38
+ %a.both_anchor{ id: "config_files_both" }
39
+ .row
40
+ .col-xs-12
41
+ %a.show-common-elements{ href: "#config_files_both" }
42
+ Show common elements in config-files
43
+ %a.hide-common-elements{ href: "#", style: "display: none" }
44
+ Hide common elements in config-files
45
+ .row.scope_common_content.collapse
46
+ .col-xs-12.table_container
47
+ = in_both
48
+ = render_partial "compare/config_file_list", list: @diff["config_files"].common
@@ -2,9 +2,9 @@
2
2
  %thead
3
3
  %tr
4
4
  %th Name
5
- %th GID
6
- %th Password
7
- %th Users
5
+ %th.small GID
6
+ %th.small Password
7
+ %th.medium Users
8
8
  %tbody
9
9
  - list.each do |group|
10
10
  %tr
@@ -1,52 +1,44 @@
1
1
  - if @diff["groups"]
2
- %a.scope_anchor{ id: "groups" }
2
+ - scope = "groups"
3
+ %a.scope_anchor{ id: scope }
3
4
  .scope#groups_container
4
5
  .row
5
6
  .col-xs-1
6
- %a{ href: "#groups" }
7
- %img.over.scope_logo_big{ :src => "/assets/logo-groups.png",
8
- "data-toggle" => "popover",
9
- :title => "Groups",
10
- "data-content" => "#{scope_help("groups")}" }
7
+ %a.btn.btn-default.btn-lg.scope_logo_big{ :href => "##{scope}",
8
+ :title => scope_title(scope), "data-toggle"=>"popover",
9
+ "data-content" => scope_help(scope) }
10
+ %span= scope_initials(scope)
11
11
  %span.toggle{ title: "Collapse/Expand" }
12
12
  .col-xs-11
13
13
  %h2
14
14
  Groups
15
- .scope-summary
16
- - if @diff["groups"].only_in1
17
- %span.summary-part
18
- #{@description_a.name}: #{@diff["groups"].only_in1.length} groups
19
- - if @diff["groups"].only_in2
20
- %span.summary-part
21
- #{@description_b.name}: #{@diff["groups"].only_in2.length} groups
22
- - if @diff["groups"].common
23
- %span.summary-part
24
- %a.show-common-elements{ href: "#groups_both" }<
25
- both
26
- = ": #{@diff["groups"].common.length} groups"
15
+ = render_partial "compare/summary", scope: "groups", singular: "group", plural: "groups"
27
16
  .row.scope_content.collapse.in
28
- .row
29
- .col-xs-1
30
- .col-xs-5.table_container
31
- - if @diff["groups"].only_in1
32
- = only_in_a
33
- = render_partial "compare/group_list", list: @diff["groups"].only_in1
34
- .col-xs-1
35
- .col-xs-5.table_container
36
- - if @diff["groups"].only_in2
37
- = only_in_b
38
- = render_partial "compare/group_list", list: @diff["groups"].only_in2
39
- - if @diff["groups"].common
40
- %a.both_anchor{ id: "groups_both" }
17
+ .col-md-12
41
18
  .row
42
- .col-xs-1
43
- .col-xs-2
44
- %a.show-common-elements{ href: "#groups_both" }
45
- Show common elements in groups
46
- %a.hide-common-elements{ href: "#", style: "display: none" }
47
- Hide common elements in groups
48
- .row.scope_common_content.collapse
49
- .col-xs-1
50
- .col-xs-10.table_container
51
- = in_both
52
- = render_partial "compare/group_list", list: @diff["groups"].common
19
+ .col-md-6.table_container
20
+ - if @diff["groups"].only_in1
21
+ = only_in_a
22
+ = render_partial "compare/group_list", list: @diff["groups"].only_in1
23
+ .col-md-6.table_container
24
+ - if @diff["groups"].only_in2
25
+ = only_in_b
26
+ = render_partial "compare/group_list", list: @diff["groups"].only_in2
27
+ - if @diff["groups"].changed
28
+ %a.both_anchor{ id: "groups_changed" }
29
+ .row
30
+ .col-md-12.table_container
31
+ = changed
32
+ = render_partial "compare/changes", changes: changed_elements("groups", key: "name")
33
+ - if @diff["groups"].common
34
+ %a.both_anchor{ id: "groups_both" }
35
+ .row
36
+ .col-md-12
37
+ %a.show-common-elements{ href: "#groups_both" }
38
+ Show common elements in groups
39
+ %a.hide-common-elements{ href: "#", style: "display: none" }
40
+ Hide common elements in groups
41
+ .row.scope_common_content.collapse
42
+ .col-md-12.table_container
43
+ = in_both
44
+ = render_partial "compare/group_list", list: @diff["groups"].common
@@ -1,32 +1,30 @@
1
1
  - if @diff["os"]
2
- %a.scope_anchor{ id: "os" }
2
+ - scope = "os"
3
+ %a.scope_anchor{ id: scope }
3
4
  .scope#os_container
4
5
  .row
5
6
  .col-xs-1
6
- %a{ href: "#os" }
7
- %img.over.scope_logo_big{ :src => "/assets/logo-os.png",
8
- "data-toggle" => "popover",
9
- :title => "Operating System",
10
- "data-content" => "#{scope_help("os")}" }
7
+ %a.btn.btn-default.btn-lg.scope_logo_big{ :href => "##{scope}",
8
+ :title => scope_title(scope), "data-toggle"=>"popover",
9
+ "data-content" => scope_help(scope) }
10
+ %span= scope_initials(scope)
11
11
  %span.toggle{ title: "Collapse/Expand" }
12
12
  .col-xs-11
13
13
  %h2
14
14
  Operating System
15
15
  .row.scope_content.collapse.in
16
- .row
17
- .col-xs-1
18
- .col-xs-5.table_container
19
- - if @diff["os"].only_in1
20
- = only_in_a
21
- = render_partial "compare/os_table", os: @diff["os"].only_in1
22
- .col-xs-1
23
- .col-xs-5.table_container
24
- - if @diff["os"].only_in2
25
- = only_in_b
26
- = render_partial "compare/os_table", os: @diff["os"].only_in2
27
- - if @diff["os"].common
28
- .row.scope_common_content
29
- .col-xs-1
30
- .col-xs-11.table_container.collapse.in
31
- = in_both
32
- = render_partial "compare/os_table", os: @diff["os"].common
16
+ .col-md-12
17
+ .row
18
+ .col-md-6.table_container
19
+ - if @diff["os"].only_in1
20
+ = only_in_a
21
+ = render_partial "compare/os_table", os: @diff["os"].only_in1
22
+ .col-md-6.table_container
23
+ - if @diff["os"].only_in2
24
+ = only_in_b
25
+ = render_partial "compare/os_table", os: @diff["os"].only_in2
26
+ - if @diff["os"].common
27
+ .row.scope_common_content
28
+ .col-md-12.table_container.collapse.in
29
+ = in_both
30
+ = render_partial "compare/os_table", os: @diff["os"].common
@@ -5,8 +5,8 @@
5
5
  %th.small Version
6
6
  %th.small.visible-md.visible-lg Release
7
7
  %th.small.visible-md.visible-lg Arch
8
- %th.visible-lg Vendor
9
- %th.visible-lg Checksum
8
+ %th.medium.visible-lg Vendor
9
+ %th.medium.visible-lg Checksum
10
10
  %th.tiny.hidden-lg
11
11
  %tbody
12
12
  - list.each do |package|
@@ -1,66 +1,50 @@
1
1
  - if @diff["packages"]
2
- %a.scope_anchor{ id: "packages" }
2
+ - scope = "packages"
3
+ %a.scope_anchor{ id: scope }
3
4
  .scope#packages_container
4
5
  .row
5
6
  .col-xs-1
6
- %a{ href: "#packages" }
7
- %img.over.scope_logo_big{ :src => "/assets/logo-packages.png",
8
- "data-toggle" => "popover",
9
- :title => "Packages",
10
- "data-content" => "#{scope_help("packages")}" }
7
+ %a.btn.btn-default.btn-lg.scope_logo_big{ :href => "##{scope}",
8
+ :title => scope_title(scope), "data-toggle"=>"popover",
9
+ "data-content" => scope_help(scope) }
10
+ %span= scope_initials(scope)
11
11
  %span.toggle{ title: "Collapse/Expand" }
12
12
  .col-xs-11
13
13
  %h2
14
14
  Packages
15
- .scope-summary
16
- - if @diff["packages"].only_in1
17
- %span.summary-part
18
- #{@description_a.name}: #{@diff["packages"].only_in1.length} packages
19
- - if @diff["packages"].only_in2
20
- %span.summary-part
21
- #{@description_b.name}: #{@diff["packages"].only_in2.length} packages
22
- - if @diff["packages"].changed
23
- %span.summary-part
24
- %a{ href: "#packages_changed" }
25
- Changed
26
- = ": #{@diff["packages"].changed.length} packages"
27
- - if @diff["packages"].common
28
- %span.summary-part
29
- %a.show-common-elements{ href: "#packages_both" }<
30
- both
31
- = ": #{@diff["packages"].common.length} packages"
15
+ = render_partial "compare/summary",
16
+ scope: "packages",
17
+ singular: "package",
18
+ plural: "packages"
32
19
  .row.scope_content.collapse.in
33
- .row
34
- .col-xs-1
35
- .col-xs-5.table_container
36
- - if @diff["packages"].only_in1
37
- = only_in_a
38
- = render_partial "compare/package_list", list: @diff["packages"].only_in1
39
- .col-xs-1
40
- .col-xs-5.table_container
41
- - if @diff["packages"].only_in2
42
- = only_in_b
43
- = render_partial "compare/package_list", list: @diff["packages"].only_in2
44
- - if @diff["packages"].changed
45
- %a.both_anchor{ id: "packages_changed" }
46
- .row
47
- .col-xs-1
48
- .col-xs-11.table_container
49
- = changed
50
- %ul.changed
51
- - changed_packages.each do |change|
52
- %li= change
53
- - if @diff["packages"].common
54
- %a.both_anchor{ id: "packages_both" }
20
+ .col-md-12
55
21
  .row
56
- .col-xs-1
57
- .col-xs-2
58
- %a.show-common-elements{ href: "#packages_both" }
59
- Show common elements in packages
60
- %a.hide-common-elements{ href: "#", style: "display: none" }
61
- Hide common elements in packages
62
- .row.scope_common_content.collapse
63
- .col-xs-1
64
- .col-xs-10.table_container
65
- = in_both
66
- = render_partial "compare/package_list", list: @diff["packages"].common
22
+ .col-md-6.table_container
23
+ - if @diff["packages"].only_in1
24
+ = only_in_a
25
+ = render_partial "compare/package_list", list: @diff["packages"].only_in1
26
+ .col-md-6.table_container
27
+ - if @diff["packages"].only_in2
28
+ = only_in_b
29
+ = render_partial "compare/package_list", list: @diff["packages"].only_in2
30
+ - if @diff["packages"].changed
31
+ %a.both_anchor{ id: "packages_changed" }
32
+ .row
33
+ .col-md-12.table_container
34
+ = changed
35
+ = render_partial "compare/changes", changes: changed_elements("packages",
36
+ key: "name",
37
+ attributes: ["version", "vendor", "arch"],
38
+ optional_attributes: ["version", "release", "checksum"])
39
+ - if @diff["packages"].common
40
+ %a.both_anchor{ id: "packages_both" }
41
+ .row
42
+ .col-md-12
43
+ %a.show-common-elements{ href: "#packages_both" }
44
+ Show common elements in packages
45
+ %a.hide-common-elements{ href: "#", style: "display: none" }
46
+ Hide common elements in packages
47
+ .row.scope_common_content.collapse
48
+ .col-md-12.table_container
49
+ = in_both
50
+ = render_partial "compare/package_list", list: @diff["packages"].common