udongo 6.0.0 → 6.1.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: 6a1aa922ab7b660bf5ffeb8cf1ff461a2d7a5077
4
- data.tar.gz: 9c361782ab9787cabeae45dd5e6564f92d8cc0f4
3
+ metadata.gz: 9058d4a4ae9f7e8f0d6c0f5ed60ae902559997cd
4
+ data.tar.gz: 4267002ee525804b74f0c38a0770d16a45d85ef1
5
5
  SHA512:
6
- metadata.gz: c47d3df9fe5c05e28659a7690e5cbfc1deee40aaacc909811378a7cee59a70e37080c558ab9f2b2016bc4e5190ea53a8cf8a72ede0dec548521ccdb064d2c32d
7
- data.tar.gz: 727518319c1dcbfb67a6f89ef409ebc477dea21d1db3afec85eac9c487de8e1b7d374dc57267c424c8c5182c5c1f33fc0cfa8f18ad581cb02f344ee60889cce2
6
+ metadata.gz: 7366fc2a16e78da7725965fdab5542763945380da67c3d1e73f23fd4d1d6e6db4c19560a2c5c297aa9aabd7b85e4053116426eed2fdd354b2da8efb0838ce39f
7
+ data.tar.gz: e96c73705f470b513397a3f5e1cb650235ea9d457130d057d1f5b6b98aada21de3f0cff88a63f82732476f98f9f3c0d90253d20c5e7ebad93d298ebe77df3a59
@@ -0,0 +1,3 @@
1
+ .abbreviated-tooltip {
2
+ border-bottom: 1px dashed #ffffff;
3
+ }
@@ -17,6 +17,7 @@
17
17
  @import 'components/page_tree';
18
18
  @import 'components/table';
19
19
  @import 'components/card';
20
+ @import 'components/abbreviated_tooltip';
20
21
 
21
22
  // Page specific styles
22
23
  @import 'pages/login';
@@ -46,6 +46,6 @@ class Backend::Content::Rows::PicturesController < Backend::BaseController
46
46
  def prepare_upload
47
47
  @asset = Asset.new
48
48
  @search = Asset.ransack params[:q]
49
- @assets = @search.result(distinct: true).image.where.not(id: @model.asset_id).order('id DESC')
49
+ @assets = @search.result(distinct: true).image.where.not(id: @model.asset_id).order('id DESC').limit(30)
50
50
  end
51
51
  end
@@ -5,7 +5,7 @@ class Backend::ImagesController < Backend::BaseController
5
5
 
6
6
  def index
7
7
  @search = Asset.ransack params[:q]
8
- @assets = @search.result(distinct: true).image.where.not(id: @model.images.pluck(:asset_id)).order('id DESC')
8
+ @assets = @search.result(distinct: true).image.where.not(id: @model.images.pluck(:asset_id)).order('id DESC').limit(30)
9
9
  end
10
10
 
11
11
  def create
@@ -59,7 +59,7 @@ class Backend::PagesController < Backend::BaseController
59
59
  end
60
60
 
61
61
  def allowed_params
62
- params[:page].permit(:description, :parent_id, :visible)
62
+ params[:page].permit(:description, :parent_id, :visible, :sitemap)
63
63
  end
64
64
 
65
65
  def translation_form
@@ -7,7 +7,7 @@ module Concerns
7
7
  end
8
8
 
9
9
  module ClassMethods
10
- def configure_adress(categories, default: nil)
10
+ def configure_address(categories, default: nil)
11
11
  address_config.update(categories, default: default)
12
12
  end
13
13
 
@@ -3,5 +3,11 @@ module Concerns
3
3
  def full_name
4
4
  "#{first_name} #{last_name}"
5
5
  end
6
+
7
+ def short_name
8
+ short = "#{first_name}"
9
+ short << ' ' if first_name.present? && last_name.present?
10
+ short << last_name.to_s.split(' ').map { |n| "#{n[0,1]}." }.join
11
+ end
6
12
  end
7
13
  end
@@ -10,10 +10,10 @@
10
10
  <tr>
11
11
  <th><%= t 'b.title' %></th>
12
12
  <th><%= t 'b.author' %></th>
13
- <th><%= t 'b.published_at' %></th>
14
- <th><%= t 'b.visible' %></th>
15
- <th><%= t 'b.press_release' %></th>
16
- <th>&nbsp;</th>
13
+ <th width="200"><%= t 'b.published_at' %></th>
14
+ <th><span data-toggle="tooltip" title="<%= t 'b.visible' %>" class="abbreviated-tooltip"><%= t 'b.msg.articles.visible_abbreviated' %></span></th>
15
+ <th><span data-toggle="tooltip" title="<%= t 'b.press_release' %>" class="abbreviated-tooltip"><%= t 'b.msg.articles.press_release_abbreviated' %></span></th>
16
+ <th width="60">&nbsp;</th>
17
17
  </tr>
18
18
  </thead>
19
19
 
@@ -27,17 +27,17 @@
27
27
  <%= t('b.msg.no_title_set') %>
28
28
  <% end %>
29
29
  <% else %>
30
- <%= truncate a.title, length: 40 %>
30
+ <%= truncate a.title, length: 70 %>
31
31
  <% end %>
32
32
  </td>
33
33
  <td>
34
34
  <% if a.user.present? %>
35
- <%= link_to icon(:user, a.user.full_name), edit_backend_user_path(a.user) %>
35
+ <%= link_to icon(:user, a.user.short_name), edit_backend_user_path(a.user) %>
36
36
  <% else %>
37
37
  <%= t 'b.not_set' %>
38
38
  <% end %>
39
39
  </td>
40
- <td><%= l a.published_at if a.published_at %></td>
40
+ <td class="text-right"><%= l(a.published_at, format: :short) if a.published_at %></td>
41
41
  <td><%= t a.visible?.to_s %></td>
42
42
  <td><%= t a.press_release?.to_s %></td>
43
43
  <td class="text-right">
@@ -31,7 +31,7 @@
31
31
  <td><%= a.actual_filename.split('.').last.upcase %></td>
32
32
  <td><%= number_to_human_size a.filesize %></td>
33
33
  <td><%= simple_format a.description %></td>
34
- <td><%= l a.updated_at %></td>
34
+ <td><%= l a.updated_at, format: :short %></td>
35
35
  <td class="text-right">
36
36
  <%= link_to_edit [:backend, a] %>
37
37
  <%= link_to_delete [:backend, a] if a.deletable? %>
@@ -3,9 +3,13 @@
3
3
  <%= image_tag object.asset.image.url(1100, 1100, quality: 65), alt: '', class: 'img-fluid' %>
4
4
 
5
5
  <% if object.caption.present? %>
6
- <div class="text-xs-center">
6
+ <% if Udongo.config.flexible_content.picture_caption_editor? %>
7
7
  <%= object.caption.html_safe %>
8
- </div>
8
+ <% else %>
9
+ <div class="text-center">
10
+ <%= object.caption%>
11
+ </div>
12
+ <% end %>
9
13
  <% end %>
10
14
 
11
15
  <% else %>
@@ -1,5 +1,5 @@
1
1
  <div class="alert alert-info">
2
- <p class="m-b-0">
2
+ <p class="mb-0">
3
3
  <%= icon(:info) %> <%= t 'b.msg.flexible_content.width_explanation' %>
4
4
  </p>
5
5
  </div>
@@ -1,5 +1,5 @@
1
1
  <%= search_form_for @search, url: link_or_upload_backend_content_picture_path(@model) do |f| %>
2
- <div class="row m-b-2">
2
+ <div class="row mb-4">
3
3
  <div class="col-md-6">
4
4
  <%= f.search_field :description_cont, placeholder: t('b.description'), class: 'form-control' %>
5
5
  </div>
@@ -10,7 +10,10 @@
10
10
 
11
11
  <%= simple_form_for [:backend, @model] do |f| %>
12
12
  <%= f.input :url, as: :string %>
13
- <%= f.input :caption, as: :text %>
13
+
14
+ <% content_type = Udongo.config.flexible_content.picture_caption_editor? ? :ckeditor : :text %>
15
+ <%= f.input :caption, as: content_type %>
16
+
14
17
  <%= render 'backend/form_actions', cancel_url: content_path %>
15
18
  <% end %>
16
19
  </div>
@@ -1,7 +1,7 @@
1
1
  <%= search_form_for @search, url: backend_images_path do |f| %>
2
2
  <%= hidden_field_tag :klass, @model.class.name %>
3
3
  <%= hidden_field_tag :id, @model.id %>
4
- <div class="row m-b-2">
4
+ <div class="row mb-4">
5
5
  <div class="col-md-6">
6
6
  <%= f.search_field :description_cont, placeholder: t('b.description'), class: 'form-control' %>
7
7
  </div>
@@ -23,6 +23,7 @@
23
23
 
24
24
  <div class="card-block">
25
25
  <%= f.input :visible, as: :boolean %>
26
+ <%= f.input :sitemap, as: :boolean %>
26
27
  </div>
27
28
  </div>
28
29
  </div>
@@ -1,4 +1,3 @@
1
- <!-- TODO move this div to the top navigation partial -->
2
1
  <div class="collapse navbar-collapse" id="udongo-navbar">
3
2
  <ul class="navbar-nav mr-auto">
4
3
  <li class="nav-item dropdown">
@@ -34,7 +33,7 @@
34
33
  </ul>
35
34
 
36
35
  <ul class="navbar-nav">
37
- <li class="nav-item pull-xs-right">
36
+ <li class="nav-item">
38
37
  <%= form_tag backend_search_path, method: :get, id: 'search', class: 'form-inline my-2 my-lg-0' do %>
39
38
  <%= text_field_tag :term, params[:term], class: 'form-control mr-sm-2 no-focus', placeholder: t('b.search') %>
40
39
  <% end %>
data/changelog.md CHANGED
@@ -1,3 +1,17 @@
1
+ 6.1.0 - 2017-05-16
2
+ --
3
+ * The obsolete top navigation markup has been cleaned up.
4
+ * Add setting 'sitemap' to pages. These can be used to easily see which pages
5
+ are to be included in the sitemap.
6
+ * Rename Concerns::Addressable#configure_adress to configure_address
7
+ * Add method Person#short_name which uses the first name and first letter of the
8
+ last name.
9
+ * A new setting ```Udongo.config.flexible_content.picture_caption_editor``` was
10
+ added. This allows you to use an editor for picture captions.
11
+ * Tweaked some bottom margins related to the media module.
12
+ * Linking an image via de media module now only suggests 30 pictures.
13
+
14
+
1
15
  6.0.0 - 2017-05-08
2
16
  --
3
17
  * When adding/editing flexible content columns, you now only see the medium
@@ -201,7 +201,7 @@ en:
201
201
  formats:
202
202
  default: ! '%B %-d, %Y at %Hh%M'
203
203
  timeless: ! '%d %B %Y'
204
- short: ! '%d %b at %Hh%M'
204
+ short: ! '%-d %b %Y at %-Hh%M'
205
205
  time_attr: ! '%G-W%V-%uT%R%:z'
206
206
  full: ! '%a, %d %b %Y %H:%M:%S %z'
207
207
  pm: pm
@@ -104,6 +104,9 @@ en:
104
104
  admins:
105
105
  account_details: Account details
106
106
  personal_details: Personal details
107
+ articles:
108
+ press_release_abbreviated: Press.
109
+ visible_abbreviated: Visi.
107
110
  changes_saved: The changes have been saved.
108
111
  confirm: Are you sure?
109
112
  content_types:
@@ -208,7 +208,7 @@ fr:
208
208
  formats:
209
209
  default: "%A %-d %B %Y à %Hh%M"
210
210
  timeless: '%d %B %Y'
211
- short: "%d %b à %Hh%M"
211
+ short: "%-d %b à %-Hh%M"
212
212
  time_attr: ! '%G-W%V-%uT%R%:z'
213
213
  full: "%d %B %Y %H:%M:%S %Z"
214
214
  pm: 'pm'
@@ -207,7 +207,7 @@ nl:
207
207
  formats:
208
208
  default: ! '%-d %B %Y om %Hu%M'
209
209
  timeless: ! '%d %B %Y'
210
- short: ! '%d %b om %Hu%M'
210
+ short: ! '%-d %b %Y om %-Hu%M'
211
211
  time_attr: ! '%FT%R%:z'
212
212
  full: ! '%a %d %b %Y %H:%M:%S %Z'
213
213
  pm: ! '''s middags'
@@ -104,6 +104,9 @@ nl:
104
104
  admins:
105
105
  account_details: Accountgegevens
106
106
  personal_details: Persoonlijke gegevens
107
+ articles:
108
+ press_release_abbreviated: Pers.
109
+ visible_abbreviated: Zicht.
107
110
  changes_saved: De wijzigingen werden opgeslagen.
108
111
  confirm: Ben je zeker?
109
112
  content_types:
@@ -46,6 +46,7 @@ nl:
46
46
  seo_description: Beschrijving
47
47
  seo_keywords: Sleutelwoorden
48
48
  seo_custom: Extra meta-tags
49
+ sitemap: Sitemap?
49
50
  subject: Onderwerp
50
51
  subtitle: Subtitel
51
52
  success_message: Melding bij succesvolle verzending
@@ -0,0 +1,6 @@
1
+ class AddSitemapToPage < ActiveRecord::Migration[5.0]
2
+ def change
3
+ add_column :pages, :sitemap, :boolean, after: 'content_disabled'
4
+ add_index :pages, :sitemap
5
+ end
6
+ end
@@ -7,6 +7,11 @@ module Udongo
7
7
  DEFAULT_BREAKPOINT = 'md'
8
8
 
9
9
  attribute :types, Array, default: %w(text picture video image)
10
+ attribute :picture_caption_editor, Axiom::Types::Boolean, default: false
11
+
12
+ def picture_caption_editor?
13
+ picture_caption_editor
14
+ end
10
15
  end
11
16
  end
12
17
  end
@@ -1,3 +1,3 @@
1
1
  module Udongo
2
- VERSION = '6.0.0'
2
+ VERSION = '6.1.0'
3
3
  end
data/readme.md CHANGED
@@ -119,6 +119,11 @@ You can also override the default message with your own:
119
119
  Udongo.config.flexible_content.types = %w(text picture video)
120
120
  ```
121
121
 
122
+ ### picture_caption_editor
123
+ ```ruby
124
+ Udongo.config.flexible_content.picture_caption_editor = false
125
+ ```
126
+
122
127
  ## Assets
123
128
  ### image_white_list
124
129
  ```ruby
@@ -9,7 +9,34 @@ shared_examples_for :person do
9
9
  expect(person.full_name).to eq 'Foo Bar'
10
10
  end
11
11
 
12
+ describe '#short_name' do
13
+ it 'no first name' do
14
+ person = build(klass, first_name: nil, last_name: 'Bar')
15
+ expect(person.short_name).to eq 'B.'
16
+ end
17
+
18
+ it 'no last name' do
19
+ person = build(klass, first_name: 'Foo', last_name: nil)
20
+ expect(person.short_name).to eq 'Foo'
21
+ end
22
+
23
+ it 'last name with 1 word' do
24
+ person = build(klass, first_name: 'Foo', last_name: 'Bar')
25
+ expect(person.short_name).to eq 'Foo B.'
26
+ end
27
+
28
+ it 'last name with 2 words' do
29
+ person = build(klass, first_name: 'Foo', last_name: 'Bar Baz')
30
+ expect(person.short_name).to eq 'Foo B.B.'
31
+ end
32
+
33
+ it 'last name with 3 words' do
34
+ person = build(klass, first_name: 'Foo', last_name: 'Bar Baz Boz')
35
+ expect(person.short_name).to eq 'Foo B.B.B.'
36
+ end
37
+ end
38
+
12
39
  it '#respond_to?' do
13
- expect(model.new).to respond_to(:full_name)
40
+ expect(model.new).to respond_to(:full_name, :short_name)
14
41
  end
15
42
  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: 6.0.0
4
+ version: 6.1.0
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: 2017-05-08 00:00:00.000000000 Z
12
+ date: 2017-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -440,6 +440,7 @@ files:
440
440
  - app/assets/javascripts/backend/tree.js
441
441
  - app/assets/stylesheets/backend/application.scss
442
442
  - app/assets/stylesheets/backend/bootstrap.scss
443
+ - app/assets/stylesheets/backend/components/_abbreviated_tooltip.scss
443
444
  - app/assets/stylesheets/backend/components/_breadcrumb.scss
444
445
  - app/assets/stylesheets/backend/components/_card.scss
445
446
  - app/assets/stylesheets/backend/components/_form.scss
@@ -807,6 +808,7 @@ files:
807
808
  - db/migrate/20170412074304_create_content_pictures.rb
808
809
  - db/migrate/20170507092541_add_alignment_options_to_content_rows.rb
809
810
  - db/migrate/20170507163532_create_content_videos.rb
811
+ - db/migrate/20170516092845_add_sitemap_to_page.rb
810
812
  - lib/tasks/task_extras.rb
811
813
  - lib/tasks/udongo_tasks.rake
812
814
  - lib/udongo.rb