documentation-editor 0.6.3 → 0.7.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22619e44fae6aa92b50ea69c41db107e9ecb774d
4
- data.tar.gz: 91e1a7f324eaa58349567e0545b60e25b66743c4
3
+ metadata.gz: 7d8db49d46ea03aed0cf4ef19c9efa168153cfda
4
+ data.tar.gz: bd00b630e7c9905c85424b731bddf19dafa6f04e
5
5
  SHA512:
6
- metadata.gz: 21f09604fd63a1a8f1891dcd9d751d3dbcfbf037cb372f2916e2fbc96e6a637cdf0490b39ed35f249f7e9ecea7e5b9436b773a13dd1deb4561c8f6b6badd1836
7
- data.tar.gz: 0e4a9d172339175cad1b31b43b7c7598d1b59d711a9d7b9391bcd9c00ee932b72f39dffe992ab4b3751862c3461228d1bdd75fa205a22aed77f140709d56d40f
6
+ metadata.gz: bb8c4efb42208c0a7a978f66a7e9dae2fe5c80c6f34d88501f61756133e16463d1fe5ed457c46f8d7c0e226fa820a2ebdfd17695487da56b011ff13a70a79c51
7
+ data.tar.gz: 7254b3d293888ecde417416c03d2c8b7662b4f876516093f89a4093ab8be447f80a3dedffdb252d36be5f3bb83cd28e06d779ae1b3cc7b7478f920ab1c6417e3
@@ -32,8 +32,12 @@ module DocumentationEditor
32
32
  end
33
33
 
34
34
  def update
35
+ @page.position = params[:page][:position] || 0
35
36
  @page.title = params[:page][:title] unless params[:page][:title].nil?
36
37
  @page.slug = params[:page][:slug] unless params[:page][:slug].nil?
38
+ @page.description = params[:page][:description] unless params[:page][:description].nil?
39
+ @page.languages = params[:page][:languages] unless params[:page][:languages].nil?
40
+ @page.section = params[:page][:section] unless params[:page][:section].nil?
37
41
  @page.save!
38
42
  render nothing: true
39
43
  end
@@ -48,6 +52,9 @@ module DocumentationEditor
48
52
  p.author_id = respond_to?(:current_user) ? current_user.id : nil
49
53
  p.title = params[:page][:title]
50
54
  p.slug = params[:page][:slug]
55
+ p.description = params[:page][:description]
56
+ p.languages = params[:page][:languages]
57
+ p.section = params[:page][:section]
51
58
  p.save!
52
59
  redirect_to edit_page_path(p)
53
60
  end
@@ -105,11 +105,11 @@
105
105
  %li{"ng-repeat" => "code in section.content.codes track by $index", "ng-class" => "{ active: ($index === 0) }"}
106
106
  %a{href: '#', 'ng-click' => 'deleteLanguage($event, section.id, $index)'}>
107
107
  %i.fa.fa-remove>
108
- %a{contenteditable: true, href: '#snippet_{{section.id}}_{{$index}}', 'data-toggle' => 'tab', 'ng-model' => 'sections[sectionIndex].content.codes[$index].language' }>
108
+ %a{contenteditable: true, 'ng-href' => '#snippet_{{section.id}}_{{$index}}', 'data-toggle' => 'tab', 'ng-model' => 'sections[sectionIndex].content.codes[$index].language' }>
109
109
  .tab-content
110
110
  %pre.tab-pane{contenteditable: true, "ng-repeat" => "code in section.content.codes track by $index", "ng-class" => "{ 'in active': ($index === 0) }", id: 'snippet_{{section.id}}_{{$index}}', 'ng-model' => 'sections[sectionIndex].content.codes[$index].code'}
111
111
  .html{"ng-if" => "section.type === 'html'"}
112
- %pre{contenteditable: true, id: 'snippet_{{section.id}}_{{$index}}', 'ng-model' => 'sections[sectionIndex].content.body'}
112
+ %pre{contenteditable: true, 'ng-model' => 'sections[sectionIndex].content.body'}
113
113
 
114
114
  .insert-sections
115
115
  .pull-right
@@ -8,20 +8,28 @@
8
8
  %thead
9
9
  %tr
10
10
  %th Thumbnail
11
+ %th Position
11
12
  %th Title
12
13
  %th Slug
14
+ %th Description
15
+ %th Languages
16
+ %th Section
13
17
  %th Last modification
14
18
  %th Published at
15
19
  %th Published by
16
20
  %th.text-right Actions
17
21
  %tbody
18
- - DocumentationEditor::Page.order('id DESC').each do |p|
22
+ - DocumentationEditor::Page.order('position ASC').each do |p|
19
23
  %tr
20
24
  %td
21
25
  - if p.thumbnail
22
26
  = image_tag p.thumbnail_url
27
+ %td= best_in_place p, :position, url: update_path(p)
23
28
  %td= best_in_place p, :title, url: update_path(p)
24
29
  %td= best_in_place p, :slug, url: update_path(p)
30
+ %td= best_in_place p, :description, url: update_path(p)
31
+ %td= best_in_place p, :languages, url: update_path(p)
32
+ %td= best_in_place p, :section, url: update_path(p)
25
33
  %td= l p.created_at, format: :short
26
34
  %td= p.published_revision ? l(p.published_revision.created_at, format: :long) : ''
27
35
  %td= p.published_revision ? p.published_revision.author_id : ''
@@ -42,4 +50,7 @@
42
50
  = form_for DocumentationEditor::Page.new, url: admin_path, html: { class: 'form form-inline' } do |f|
43
51
  = f.text_field :title, placeholder: 'Title', class: 'form-control'
44
52
  = f.text_field :slug, placeholder: 'tutorials/my-tutorial', class: 'form-control'
53
+ = f.text_field :description, placeholder: 'Description', class: 'form-control'
54
+ = f.text_field :languages, placeholder: 'ruby, php, python', class: 'form-control'
55
+ = f.text_field :section, placeholder: 'getting-started', class: 'form-control'
45
56
  = f.submit 'Create', class: 'btn btn-success'
@@ -0,0 +1,5 @@
1
+ class AddLanguagesToPages < ActiveRecord::Migration
2
+ def change
3
+ add_column :documentation_editor_pages, :languages, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddDescriptionToPages < ActiveRecord::Migration
2
+ def change
3
+ add_column :documentation_editor_pages, :description, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddSectionToPages < ActiveRecord::Migration
2
+ def change
3
+ add_column :documentation_editor_pages, :section, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPositionToPages < ActiveRecord::Migration
2
+ def change
3
+ add_column :documentation_editor_pages, :position, :integer
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module DocumentationEditor
2
- VERSION = "0.6.3"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: documentation-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-06 00:00:00.000000000 Z
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -173,6 +173,10 @@ files:
173
173
  - db/migrate/20150728040718_create_documentation_editor_revisions.rb
174
174
  - db/migrate/20150818102838_add_title_to_pages.rb
175
175
  - db/migrate/20150903121913_add_thumbnail_id_to_pages.rb
176
+ - db/migrate/20160202155254_add_languages_to_pages.rb
177
+ - db/migrate/20160202155259_add_description_to_pages.rb
178
+ - db/migrate/20160202164212_add_section_to_pages.rb
179
+ - db/migrate/20160204105307_add_position_to_pages.rb
176
180
  - lib/documentation-editor.rb
177
181
  - lib/documentation_editor.rb
178
182
  - lib/documentation_editor/configuration.rb
@@ -200,10 +204,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
204
  version: '0'
201
205
  requirements: []
202
206
  rubyforge_project:
203
- rubygems_version: 2.4.1
207
+ rubygems_version: 2.4.8
204
208
  signing_key:
205
209
  specification_version: 4
206
210
  summary: Mountable Rails application providing an extended Markdown documentation
207
211
  editor.
208
212
  test_files: []
209
- has_rdoc: