krant 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba0f34faf0b16e61df910db4c83718b1e25504984d8de226203ab2e50f762956
4
- data.tar.gz: 2132ba279ce47cde88e3956b007b758d7a76c17543d18e55ad41c0cc11e7a2ce
3
+ metadata.gz: e41b01787c4238be635ddb9d868a6a44e583fdc42854955c560c95b73bf70f3c
4
+ data.tar.gz: 22d24551cb7c92c8b611dd2a018d22cc24e87dc4b9ccf2c71011935f7da40346
5
5
  SHA512:
6
- metadata.gz: d8e239a5b45e1d973439139b7ff004dc030d41e8997c590fc542a50b548a3872939dba3becb20c1885e828fce9f21270139cd15f3fd94c04e4d4216c6a072f4e
7
- data.tar.gz: 2d71a30ef434e5d1868797c1fbe92ff57439cb182996a349ab6f649b4d266bf0af089508662da00739ad59fbb4595073a659f9bd0e7d525956128d254e18bfc1
6
+ metadata.gz: 5fe9c3e5ec1e74509852becc490d157d00b32382c99335aa43d830623cb1f577765f226c24fea753d7427bd6b9d7ccf58e67405f081901ffc6cf0e2e519f0b80
7
+ data.tar.gz: deef5f5daf44dbe0e1084dd8d90e8388ec67df0fcdcc340a65aecbba4dabd76f64f8888583caf18e10c44a6cd5488496ff80e939f0e1d4c6ab44031d923b0b6d
@@ -1,14 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 1.0.0
3
+ ### Version 1.1.0
4
4
 
5
- 2019-02-26
5
+ 2019-05-20
6
6
 
7
- [Compare changes](https://github.com/codevise/krant/compare/0-1-stable...v1.0.0)
7
+ [Compare changes](https://github.com/codevise/krant/compare/1-0-stable...v1.1.0)
8
8
 
9
- - Upgrade to Rails 5.2
10
- ([#1](https://github.com/codevise/krant/pull/1))
9
+ - Add markdown support to broadcast messages
10
+ ([#2](https://github.com/codevise/krant/pull/2))
11
11
 
12
12
  See
13
- [0-1-stable branch](https://github.com/codevise/krant/blob/0-1-stable/CHANGELOG.md)
13
+ [1-0-stable branch](https://github.com/codevise/krant/blob/1-0-stable/CHANGELOG.md)
14
14
  for previous changes.
data/README.md CHANGED
@@ -59,6 +59,7 @@ Krant.broadcast_message_locales = [:en, :fr, :es]
59
59
 
60
60
  Messages with different translations can now be configured via the
61
61
  admin interface and will be displayed once marked as active.
62
+ Broadcast messages have full markdown support.
62
63
 
63
64
  The color of the broadcast message bar can be configured via SCSS
64
65
 
@@ -141,7 +142,7 @@ Define a Rake tasks to persists news items in the database:
141
142
  ```ruby
142
143
  # Rakefile
143
144
  require 'krant/tasks'
144
- Krant::Trasks.install { MyApp.news }
145
+ Krant::Tasks.install { MyApp.news }
145
146
  ```
146
147
 
147
148
  and run the defined task after each deploy:
@@ -13,7 +13,8 @@ module Krant
13
13
  broadcast_message.translations.each do |t|
14
14
  div class: 'krant-broadcast-messages-table-text' do
15
15
  span "#{t.locale}:", class: 'krant-broadcast-messages-table-text-locale'
16
- span t.text, class: 'krant-broadcast-messages-table-text-translation'
16
+ span Redcarpet::Markdown.new(Redcarpet::Render::StripDown).render(t.text),
17
+ class: 'krant-broadcast-messages-table-text-translation'
17
18
  end
18
19
  end
19
20
  end
@@ -27,5 +27,9 @@ $krant-broadcast-message-bar-border-color: #dedede !default;
27
27
  border-right: solid 1px $krant-broadcast-message-bar-border-color;
28
28
  padding: 10px $horizontal-page-margin;
29
29
  text-align: center;
30
+
31
+ p {
32
+ margin: 0;
33
+ }
30
34
  }
31
35
  }
@@ -2,7 +2,7 @@ de:
2
2
  krant:
3
3
  admin:
4
4
  broadcast_messages:
5
- text_translation_label: "Text (%{locale_name}):"
5
+ text_translation_label: "Text/Markdown (%{locale_name}):"
6
6
  news_menu_item:
7
7
  unseen: "Neuigkeiten*"
8
8
  no_unseen: "Neuigkeiten"
@@ -17,7 +17,7 @@ de:
17
17
  other: "Broadcast Nachrichten"
18
18
  attributes:
19
19
  "krant/broadcast_message":
20
- text: "Text"
20
+ text: "Inhalt"
21
21
  active: "Aktiv"
22
22
  created_at: "Erstellt am"
23
23
  updated_at: "Geändert am"
@@ -2,7 +2,7 @@ en:
2
2
  krant:
3
3
  admin:
4
4
  broadcast_messages:
5
- text_translation_label: "Text (%{locale_name}):"
5
+ text_translation_label: "Text/Markdown (%{locale_name}):"
6
6
  news_menu_item:
7
7
  unseen: "What's new*"
8
8
  no_unseen: "What's new"
@@ -17,7 +17,7 @@ en:
17
17
  other: "Broadcast Messages"
18
18
  attributes:
19
19
  "krant/broadcast_message":
20
- text: "Text"
20
+ text: "Content"
21
21
  active: "Active"
22
22
  created_at: "Created at"
23
23
  updated_at: "Updated at"
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_runtime_dependency 'activeadmin', ['>= 1.0', '< 1.4']
36
36
  spec.add_runtime_dependency 'rails', '~> 5.1'
37
37
  spec.add_runtime_dependency 'kramdown', '~> 1.5'
38
+ spec.add_runtime_dependency 'redcarpet', '~> 3.4'
38
39
  end
@@ -1,5 +1,7 @@
1
1
  require 'active_admin'
2
2
  require 'kramdown'
3
+ require 'redcarpet'
4
+ require 'redcarpet/render_strip'
3
5
 
4
6
  module Krant
5
7
  # Rails integration
@@ -1,3 +1,3 @@
1
1
  module Krant
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -10,7 +10,9 @@ module Krant
10
10
  div do
11
11
  TranslatedBroadcastMessage.active.each do |broadcast_message|
12
12
  div class: 'krant-broadcast-messages-bar' do
13
- broadcast_message.text
13
+ Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true)
14
+ .render(broadcast_message.text)
15
+ .html_safe
14
16
  end
15
17
  end
16
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: krant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Fischbach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-26 00:00:00.000000000 Z
11
+ date: 2019-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -212,6 +212,20 @@ dependencies:
212
212
  - - "~>"
213
213
  - !ruby/object:Gem::Version
214
214
  version: '1.5'
215
+ - !ruby/object:Gem::Dependency
216
+ name: redcarpet
217
+ requirement: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: '3.4'
222
+ type: :runtime
223
+ prerelease: false
224
+ version_requirements: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - "~>"
227
+ - !ruby/object:Gem::Version
228
+ version: '3.4'
215
229
  description:
216
230
  email:
217
231
  - tfischbach@codevise.de
@@ -280,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
294
  version: '0'
281
295
  requirements: []
282
296
  rubyforge_project:
283
- rubygems_version: 2.7.8
297
+ rubygems_version: 2.7.5
284
298
  signing_key:
285
299
  specification_version: 4
286
300
  summary: Display app news and broadcast messages in Active Admin.