how_to 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/models/how_to/section.rb +1 -1
 - data/app/views/how_to/contents/_form.html.erb +2 -2
 - data/app/views/how_to/faq/show.html.erb +1 -1
 - data/app/views/how_to/sections/_form.html.erb +2 -2
 - data/db/migrate/20130906034009_alter_order_column.rb +11 -0
 - data/lib/how_to/version.rb +1 -1
 - data/test/fixtures/how_to/contents.yml +2 -2
 - metadata +2 -1
 
| 
         @@ -14,7 +14,7 @@ module HowTo 
     | 
|
| 
       14 
14 
     | 
    
         
             
                scope :roots_only, where(:parent_id => nil)
         
     | 
| 
       15 
15 
     | 
    
         
             
                scope :without, ->(id) {   where("id <> ? ", id) if id.present?}
         
     | 
| 
       16 
16 
     | 
    
         
             
                scope :with_content, where("contents_count > 0")
         
     | 
| 
       17 
     | 
    
         
            -
                scope :ordered, order(" 
     | 
| 
      
 17 
     | 
    
         
            +
                scope :ordered, order("position ASC")
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                class Translation
         
     | 
| 
       20 
20 
     | 
    
         
             
                  attr_accessible :locale, :name
         
     | 
| 
         @@ -69,9 +69,9 @@ 
     | 
|
| 
       69 
69 
     | 
    
         | 
| 
       70 
70 
     | 
    
         | 
| 
       71 
71 
     | 
    
         
             
                  <div class="control-group">
         
     | 
| 
       72 
     | 
    
         
            -
                    <%= f.label : 
     | 
| 
      
 72 
     | 
    
         
            +
                    <%= f.label :position, :class => 'control-label' %>
         
     | 
| 
       73 
73 
     | 
    
         
             
                    <div class="controls">
         
     | 
| 
       74 
     | 
    
         
            -
                      <%= f.text_field : 
     | 
| 
      
 74 
     | 
    
         
            +
                      <%= f.text_field :position, :class => 'text_field' %>
         
     | 
| 
       75 
75 
     | 
    
         
             
                    </div>
         
     | 
| 
       76 
76 
     | 
    
         
             
                  </div>
         
     | 
| 
       77 
77 
     | 
    
         
             
                  <div class="form-actions">
         
     | 
| 
         @@ -40,7 +40,7 @@ 
     | 
|
| 
       40 
40 
     | 
    
         
             
                      <h3>Select Category</h3>
         
     | 
| 
       41 
41 
     | 
    
         | 
| 
       42 
42 
     | 
    
         
             
                      <div id="sidetreecontrol"><a href="?#">Collapse All</a> | <a href="?#">Expand All</a></div>
         
     | 
| 
       43 
     | 
    
         
            -
                      <%= sorted_nested_li(HowTo::Section.active, : 
     | 
| 
      
 43 
     | 
    
         
            +
                      <%= sorted_nested_li(HowTo::Section.active, :position, "id='tree_root'") do |section| %>
         
     | 
| 
       44 
44 
     | 
    
         
             
                          <% if section.contents_count > 0 %>
         
     | 
| 
       45 
45 
     | 
    
         
             
                              <%= link_to section.name, "##{dom_id(section)}" %>
         
     | 
| 
       46 
46 
     | 
    
         
             
                          <% else %>
         
     | 
| 
         @@ -20,9 +20,9 @@ 
     | 
|
| 
       20 
20 
     | 
    
         
             
                  <% end %>
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
                  <div class="control-group">
         
     | 
| 
       23 
     | 
    
         
            -
                    <%= f.label : 
     | 
| 
      
 23 
     | 
    
         
            +
                    <%= f.label :position, :class => 'control-label' %>
         
     | 
| 
       24 
24 
     | 
    
         
             
                    <div class="controls">
         
     | 
| 
       25 
     | 
    
         
            -
                      <%= f.text_field : 
     | 
| 
      
 25 
     | 
    
         
            +
                      <%= f.text_field :position, :class => 'text_field'%>
         
     | 
| 
       26 
26 
     | 
    
         
             
                    </div>
         
     | 
| 
       27 
27 
     | 
    
         
             
                  </div>
         
     | 
| 
       28 
28 
     | 
    
         
             
                  <div class="form-actions">
         
     | 
| 
         @@ -0,0 +1,11 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            class AlterOrderColumn < ActiveRecord::Migration
         
     | 
| 
      
 2 
     | 
    
         
            +
              def up
         
     | 
| 
      
 3 
     | 
    
         
            +
                rename_column :how_to_sections, :order, :position
         
     | 
| 
      
 4 
     | 
    
         
            +
                rename_column :how_to_contents, :order, :position
         
     | 
| 
      
 5 
     | 
    
         
            +
              end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              def down
         
     | 
| 
      
 8 
     | 
    
         
            +
                rename_column :how_to_sections, :position, :order
         
     | 
| 
      
 9 
     | 
    
         
            +
                rename_column :how_to_contents, :position, :order
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/how_to/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: how_to
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.7
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -151,6 +151,7 @@ files: 
     | 
|
| 
       151 
151 
     | 
    
         
             
            - config/routes.rb
         
     | 
| 
       152 
152 
     | 
    
         
             
            - db/migrate/20130602053453_create_how_to_sections.rb
         
     | 
| 
       153 
153 
     | 
    
         
             
            - db/migrate/20130602054608_create_how_to_contents.rb
         
     | 
| 
      
 154 
     | 
    
         
            +
            - db/migrate/20130906034009_alter_order_column.rb
         
     | 
| 
       154 
155 
     | 
    
         
             
            - lib/generators/how_to/config_generator.rb
         
     | 
| 
       155 
156 
     | 
    
         
             
            - lib/generators/how_to/layout_generator.rb
         
     | 
| 
       156 
157 
     | 
    
         
             
            - lib/generators/how_to/templates/how_to_config.rb
         
     |