udongo 7.3.1 → 7.3.2

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: 8bccd2a5bcab0646de1ca2051091b223106c0277
4
- data.tar.gz: 26b8e222f21dd5c458121cabb8f43d3c003a5a30
3
+ metadata.gz: 72ee824452a56fde697bee3c5ab8e57e771534be
4
+ data.tar.gz: 8c7fb89313641ebaa1aaa21b2b03b3b6725bbdb2
5
5
  SHA512:
6
- metadata.gz: 96e306e0c15c3f4cca4e31569196b18447a962742e9b1818adf1e8e6e87fbe85b5acdfaee2d0eb06c96899289bfc9f4d06d59deb3a96f9ca851fbc7d0f126c0e
7
- data.tar.gz: 2c285c4d370a2bacd1cf5bc4e1c07aa9443cba6970a7ac9d2447dba0c98aaea1e7c6ba034b99c56d0ef71d069cf76f609f1f6ae6e6630e31e862493e00af85ec
6
+ metadata.gz: cc05eab37bbed87a75c4f000d69a684c15aa512b20da601eef883125b7f1bd7d628f49715163ddcf52e0435f325d9a5ab0fdee0ee92a5ca855ad435675d1028f
7
+ data.tar.gz: a7db9a80123d29a6842f8a87e0f7ca546835852a1ed11da865789ab078061690ea8dc7a3a898964512376e83af51255d4f557b68211e599039d24ff0a78fa274
@@ -1,8 +1,9 @@
1
1
  class Backend::TagsController < Backend::BaseController
2
+ include Concerns::Backend::TranslatableController
2
3
  include Concerns::PaginationController
3
4
 
4
- before_action -> { breadcrumb.add t('b.tags'), backend_tags_path }
5
5
  before_action :find_model, only: [:show, :edit, :update, :destroy]
6
+ before_action -> { breadcrumb.add t('b.tags'), backend_tags_path }
6
7
 
7
8
  def index
8
9
  @search = Tag.ransack params[:q]
@@ -21,7 +22,11 @@ class Backend::TagsController < Backend::BaseController
21
22
  @tag = Tag.new(allowed_params)
22
23
 
23
24
  if @tag.save
24
- redirect_to backend_tags_path, notice: translate_notice(:added, :tag)
25
+ redirect_to edit_translation_backend_tag_path(
26
+ @tag,
27
+ translation_locale: default_app_locale,
28
+ notice: translate_notice(:added, :article)
29
+ )
25
30
  else
26
31
  render :new
27
32
  end
@@ -49,4 +54,12 @@ class Backend::TagsController < Backend::BaseController
49
54
  def find_model
50
55
  @tag = Tag.find params[:id]
51
56
  end
57
+
58
+ def translation_form
59
+ Backend::TagTranslationForm.new(
60
+ @model,
61
+ @model.translation(params[:translation_locale]),
62
+ @model.seo(params[:translation_locale])
63
+ )
64
+ end
52
65
  end
@@ -0,0 +1,9 @@
1
+ class Backend::TagTranslationForm < Backend::TranslationWithSeoForm
2
+ attribute :summary, String
3
+
4
+ validates :summary, presence: true
5
+
6
+ def self.model_name
7
+ Tag.model_name
8
+ end
9
+ end
data/app/models/tag.rb CHANGED
@@ -1,5 +1,9 @@
1
1
  class Tag < ApplicationRecord
2
2
  include Concerns::Locale
3
+ include Concerns::Seo
4
+
5
+ include Concerns::Translatable
6
+ translatable_fields :summary
3
7
 
4
8
  has_many :tagged_items, dependent: :destroy
5
9
 
@@ -0,0 +1,21 @@
1
+ <div class="row subnav">
2
+ <div class="col-md-12">
3
+ <ul class="nav nav-pills">
4
+ <li class="nav-item">
5
+ <% klass = %w(nav-link) %>
6
+ <% klass << 'active' if active == :general %>
7
+
8
+ <%= link_to t('b.general'), edit_backend_tag_path(model), class: klass %>
9
+ </li>
10
+
11
+ <% Udongo.config.i18n.app.locales.each do |locale| %>
12
+ <li class="nav-item">
13
+ <% klass = %w(nav-link) %>
14
+ <% klass << 'active' if active == locale.to_sym %>
15
+
16
+ <%= link_to locale.upcase, edit_translation_backend_tag_path(model, locale), class: klass %>
17
+ </li>
18
+ <% end %>
19
+ </ul>
20
+ </div>
21
+ </div>
@@ -1,4 +1,6 @@
1
1
  <% breadcrumb.add @tag.name %>
2
2
  <% breadcrumb.add t('b.edit') %>
3
3
  <%= render 'backend/breadcrumbs' %>
4
+
5
+ <%= render 'tabs', model: @tag, active: :general %>
4
6
  <%= render 'form', model: @tag %>
@@ -0,0 +1,31 @@
1
+ <% breadcrumb.add truncate(@tag.name, length: 40), edit_backend_tag_path(@tag) %>
2
+ <% breadcrumb.add t('b.edit') %>
3
+ <%= render 'backend/breadcrumbs' %>
4
+
5
+ <%= render 'tabs', model: @tag, active: params[:translation_locale].to_sym %>
6
+ <%= render 'backend/general_form_error', object: @translation %>
7
+
8
+ <%= simple_form_for([:backend, @translation], url: edit_translation_backend_tag_path, html: { class: 'no-focus' }) do |f| %>
9
+ <%= trigger_dirty_inputs_warning %>
10
+
11
+ <div class="row">
12
+ <div class="col-md-12">
13
+ <!-- Content -->
14
+ <div class="card">
15
+ <div class="card-header">
16
+ <%= t 'b.content' %>
17
+ </div>
18
+
19
+ <div class="card-block">
20
+ <% summary_type = Udongo.config.tags.editor_for_summary? ? :ckeditor : :text %>
21
+ <%= f.input :summary, as: summary_type %>
22
+ </div>
23
+ </div>
24
+
25
+ <!-- SEO -->
26
+ <%= render 'backend/seo_form', f: f, slug: @tag.name %>
27
+ </div>
28
+ </div>
29
+
30
+ <%= render 'backend/form_actions', cancel_url: backend_tags_path %>
31
+ <% end %>
data/changelog.md CHANGED
@@ -1,3 +1,8 @@
1
+ 7.3.2 - 2018-03-01
2
+ --
3
+ * Made Tags translatable with SEO, to allow them to have a summary page in projects.
4
+
5
+
1
6
  7.3.1 - 2018-02-28
2
7
  --
3
8
  * Republish gem because of an issue with rubygems.
File without changes
data/config/routes.rb CHANGED
@@ -22,7 +22,9 @@ Rails.application.routes.draw do
22
22
  resources :users
23
23
  resources :redirects, except: :show
24
24
  resources :search_synonyms, except: :show
25
- resources :tags
25
+ resources :tags do
26
+ concerns :translatable
27
+ end
26
28
 
27
29
  resources :pages, except: [:show] do
28
30
  concerns :translatable
@@ -0,0 +1,5 @@
1
+ class AddLocalesToTags < ActiveRecord::Migration[5.0]
2
+ def change
3
+ add_column :tags, :locales, :text, after: :id
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddSeoLocalesToTags < ActiveRecord::Migration[5.0]
2
+ def change
3
+ add_column :tags, :seo_locales, :text, after: :locales
4
+ end
5
+ end
@@ -4,10 +4,15 @@ module Udongo
4
4
  include Virtus.model
5
5
 
6
6
  attribute :allow_new, Axiom::Types::Boolean, default: true
7
+ attribute :editor_for_summary, Axiom::Types::Boolean, default: false
7
8
 
8
9
  def allow_new?
9
10
  allow_new === true
10
11
  end
12
+
13
+ def editor_for_summary?
14
+ editor_for_summary === true
15
+ end
11
16
  end
12
17
  end
13
18
  end
@@ -1,3 +1,3 @@
1
1
  module Udongo
2
- VERSION = '7.3.1'
2
+ VERSION = '7.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: udongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.1
4
+ version: 7.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davy Hellemans
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-28 00:00:00.000000000 Z
12
+ date: 2018-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -523,6 +523,7 @@ files:
523
523
  - app/forms/backend/navigation_item_translation_form.rb
524
524
  - app/forms/backend/page_translation_form.rb
525
525
  - app/forms/backend/snippet_translation_form.rb
526
+ - app/forms/backend/tag_translation_form.rb
526
527
  - app/forms/backend/translation_form.rb
527
528
  - app/forms/backend/translation_with_seo_form.rb
528
529
  - app/helpers/backend/dropdown_helper.rb
@@ -722,8 +723,10 @@ files:
722
723
  - app/views/backend/snippets/new.html.erb
723
724
  - app/views/backend/tags/_filter.html.erb
724
725
  - app/views/backend/tags/_form.html.erb
726
+ - app/views/backend/tags/_tabs.html.erb
725
727
  - app/views/backend/tags/_tag_usages.html.erb
726
728
  - app/views/backend/tags/edit.html.erb
729
+ - app/views/backend/tags/edit_translation.html.erb
727
730
  - app/views/backend/tags/index.html.erb
728
731
  - app/views/backend/tags/new.html.erb
729
732
  - app/views/backend/users/_filter.html.erb
@@ -744,6 +747,7 @@ files:
744
747
  - app/views/layouts/backend/login.html.erb
745
748
  - app/views/layouts/frontend/application.html.erb
746
749
  - changelog.md
750
+ - config/environment.rb
747
751
  - config/initializers/assets.rb
748
752
  - config/initializers/ckeditor.rb
749
753
  - config/initializers/core_ext/string.rb
@@ -861,6 +865,8 @@ files:
861
865
  - db/migrate/20171119182643_larger_email_plain_html_storage.rb
862
866
  - db/migrate/20171217163339_add_disallow_resizeto_content_picture.rb
863
867
  - db/migrate/20180228071957_add_attachments_to_emails.rb
868
+ - db/migrate/20180301093228_add_locales_to_tags.rb
869
+ - db/migrate/20180301101320_add_seo_locales_to_tags.rb
864
870
  - lib/tasks/task_extras.rb
865
871
  - lib/tasks/udongo_tasks.rake
866
872
  - lib/udongo.rb