thecore_ui_commons 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/thecore_ui_commons_manifest.js +2 -0
- data/app/assets/stylesheets/thecore_ui_commons/actiontext.scss +37 -0
- data/app/views/active_storage/blobs/_blob.html.erb +14 -0
- data/config/initializers/thecore_ui_commons_action_text.rb +1 -0
- data/db/migrate/20190920115550_create_action_text_tables.action_text.rb +14 -0
- data/lib/thecore_ui_commons/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6332d31cfff2f038b9b812564a922c4dc6aa622705b133ad3d9cbcf6f1fab331
|
4
|
+
data.tar.gz: 5159e24aec12b7f0216fb2c200d0216930e722f1480f6fdb0708d8349c7ab6e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff3b46a0a29ad5aa11e17f3d0564edbd318457e3b92027088012d86667e372a3ec61c313815ac09f4eb0775444d1a8e2a9f0d4663a38a2056f140336dc1ad2c1
|
7
|
+
data.tar.gz: d32e66b52ca718e7f8fe62bf22489c3ad0ef6a8f5d59ab6526e7544dbe6c4e600bdb1192b45e6a9f48896889c664a965dbe840f1bdbbc87c4ff6f7a369bc715f
|
@@ -0,0 +1,37 @@
|
|
1
|
+
//
|
2
|
+
// Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
|
3
|
+
// the trix-editor content (whether displayed or under editing). Feel free to incorporate this
|
4
|
+
// inclusion directly in any other asset bundle and remove this file.
|
5
|
+
//
|
6
|
+
//= require trix/dist/trix
|
7
|
+
|
8
|
+
// We need to override trix.css’s image gallery styles to accommodate the
|
9
|
+
// <action-text-attachment> element we wrap around attachments. Otherwise,
|
10
|
+
// images in galleries will be squished by the max-width: 33%; rule.
|
11
|
+
.trix-content {
|
12
|
+
.attachment-gallery {
|
13
|
+
> action-text-attachment,
|
14
|
+
> .attachment {
|
15
|
+
flex: 1 0 33%;
|
16
|
+
padding: 0 0.5em;
|
17
|
+
max-width: 33%;
|
18
|
+
}
|
19
|
+
|
20
|
+
&.attachment-gallery--2,
|
21
|
+
&.attachment-gallery--4 {
|
22
|
+
> action-text-attachment,
|
23
|
+
> .attachment {
|
24
|
+
flex-basis: 50%;
|
25
|
+
max-width: 50%;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
action-text-attachment {
|
31
|
+
.attachment {
|
32
|
+
padding: 0 !important;
|
33
|
+
max-width: 100% !important;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
|
2
|
+
<% if blob.representable? %>
|
3
|
+
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<figcaption class="attachment__caption">
|
7
|
+
<% if caption = blob.try(:caption) %>
|
8
|
+
<%= caption %>
|
9
|
+
<% else %>
|
10
|
+
<span class="attachment__name"><%= blob.filename %></span>
|
11
|
+
<span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
|
12
|
+
<% end %>
|
13
|
+
</figcaption>
|
14
|
+
</figure>
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.precompile += %w( thecore_ui_commons/index.js thecore_ui_commons/index.css )
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from action_text (originally 20180528164100)
|
2
|
+
class CreateActionTextTables < ActiveRecord::Migration[6.0]
|
3
|
+
def change
|
4
|
+
create_table :action_text_rich_texts do |t|
|
5
|
+
t.string :name, null: false
|
6
|
+
t.text :body, size: :long
|
7
|
+
t.references :record, null: false, polymorphic: true, index: false
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
|
11
|
+
t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_ui_commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
@@ -35,7 +35,11 @@ files:
|
|
35
35
|
- README.md
|
36
36
|
- Rakefile
|
37
37
|
- app/assets/config/thecore_ui_commons_manifest.js
|
38
|
+
- app/assets/stylesheets/thecore_ui_commons/actiontext.scss
|
39
|
+
- app/views/active_storage/blobs/_blob.html.erb
|
40
|
+
- config/initializers/thecore_ui_commons_action_text.rb
|
38
41
|
- config/routes.rb
|
42
|
+
- db/migrate/20190920115550_create_action_text_tables.action_text.rb
|
39
43
|
- lib/tasks/thecore_ui_commons_tasks.rake
|
40
44
|
- lib/thecore_ui_commons.rb
|
41
45
|
- lib/thecore_ui_commons/engine.rb
|