how_to 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/how_to/contents_controller.rb +1 -1
- data/app/controllers/how_to/faq_controller.rb +1 -1
- data/app/controllers/how_to/sections_controller.rb +1 -1
- data/app/models/how_to/section.rb +2 -2
- data/app/views/how_to/faq/show.html.erb +2 -2
- data/app/views/how_to/sections/_form.html.erb +1 -1
- data/lib/how_to/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0492337f20abc7910ca243a5e5db1ee3976e13795437b1d2652ef232ac6e1267'
|
4
|
+
data.tar.gz: cf86a678a117e4be9c85b8838582bfe2ff25b1e82ada07d851f6a8f17f154c0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16f021c35d865f8a52e3ad38c2e2033edf65db7a0b6bfdc7301c2693f4490de51f75f9015601954eea792e7bfe6d566157834369c76758cf0d8f948ee306879c
|
7
|
+
data.tar.gz: 279cd1d9377a6f894edfee794342faa2e0e6204cd225efbb8ebdf0899b8e577beb802b0de77f277840ea780b73173d715336ff446e18bfbe3080aabf76d55f1b
|
@@ -12,8 +12,8 @@ module HowTo
|
|
12
12
|
|
13
13
|
scope :active, -> { where(active: true) }
|
14
14
|
scope :roots_only, -> { where(:parent_id => nil) }
|
15
|
-
scope :
|
16
|
-
scope :
|
15
|
+
scope :without_ids, ->(id) { where("id <> ? ", id) if id.present? }
|
16
|
+
scope :having_content, -> { where("contents_count > 0") }
|
17
17
|
scope :ordered, -> { order("position ASC") }
|
18
18
|
|
19
19
|
# class Translation
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<div class="faq_content" id="faq_content" style="padding: 0">
|
1
|
+
<div class="faq_content" id="faq_content" style="padding: 0; margin-top: 15px">
|
2
2
|
<div class="col-md-9">
|
3
3
|
<div id="primary">
|
4
|
-
<% HowTo::Section.
|
4
|
+
<% HowTo::Section.having_content.ordered.each do |section| %>
|
5
5
|
<div class="panel panel-primary">
|
6
6
|
<div class="panel-heading" id="<%= dom_id(section) %>">
|
7
7
|
<h3 class="panel-title"><%= section.name %></h3>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="control-group">
|
6
6
|
<%= f.label :parent_section, :class => 'control-label' %>
|
7
7
|
<div class="controls">
|
8
|
-
<%= f.select :parent_id, nested_set_options(HowTo::Section.active.roots_only.
|
8
|
+
<%= f.select :parent_id, nested_set_options(HowTo::Section.active.roots_only.without_ids(@section.id)) { |i| "#{'-' * i.level} #{i.name}" }, {:prompt => 'select'}, :'chosen-enabled' => true %>
|
9
9
|
</div>
|
10
10
|
</div>
|
11
11
|
|
data/lib/how_to/version.rb
CHANGED