occams 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: ce680397bd166f37f751f3809e6bae83bfa630626d20e21d479631487ba03f59
4
- data.tar.gz: 6b0bb13446c96370910182f7acdcb66ba9bc93cacb1815483fa182e1b51d9af5
3
+ metadata.gz: f030fa6c8dd687cc40cba6d81f64035f233c93ffd6b0b7c7f63b5ca90846c5d6
4
+ data.tar.gz: 3e739fe2c866bd741e2f5c7b2901bbc2ef898a6891d6d0c5c54d7a0037a2d8b8
5
5
  SHA512:
6
- metadata.gz: 3389d7c086da5dd49d5a3e54c81e0036abd459b13c9885ff7159aa49d74d39ca0667b2618438edd8414c3a4d97f8b1ced0d5abd6bddf4ffdbb9b9f8bf28e538d
7
- data.tar.gz: 9c47baa318396a1f77fc19cec2b0c8b7498a7946edb1ab6c0bbe66ca5df5de425211bcdf822758b4a8d752150327cfbbbf043031999bf410cfce97a1ed3ce304
6
+ metadata.gz: ae30e9cb660dcf2a31980a5d0de6d2da4d007ea5973d8e86a91e85c409bd2733d1554e64d8085d821745d37820c5e1a9a8b6c49ebde9254247fec315c9a9bac7
7
+ data.tar.gz: 7d18607b4253d86bff9cf8e3be92541385b33d474d188e1a5da22c94f3e339dc62bf86548a564838867d068d6c847ecda379b516c65b4f01d4f6fe03da6fb79b
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## v1.0.2 -
3
+ ## v1.0.3 - 8/15/2023
4
+
5
+ - Added a [cms:audio tag](https://github.com/avonderluft/occams/wiki/Content-Tags#audio) for an embedded audio player
6
+ - Some formatting of admin menu footer
7
+
8
+ ## v1.0.2 - 8/14/2023
4
9
 
5
10
  - Fixed image rendering which rubocop broke in v1.0.1
6
11
  - Show unpublished pages in Rails development mode
data/README.md CHANGED
@@ -41,7 +41,7 @@ Referring to the [ComfortableMexicanSofa](https://github.com/comfy/comfortable-m
41
41
 
42
42
  ## Compatibility
43
43
 
44
- - Install and basic functionality validated on Ruby 3.2.2. with Rails 6.1.7.4 and 7.0.6 and 7.0.6
44
+ - Install and basic functionality validated on Ruby 3.2.2. with Rails 6.1.7.4 and 7.0.6+
45
45
  - Rails 7 is recommended, since performance is noticably better
46
46
 
47
47
  ## Installation
@@ -114,4 +114,4 @@ For more detail see [CONTRIBUTING](CONTRIBUTING.md)
114
114
 
115
115
  ---
116
116
  - [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) Copyright 2010-2019 Oleg Khabarov. Released under the [MIT license](LICENSE)
117
- - [Occams] Copyright 2023 Andrew vonderLuft (https://github.com/avonderluft/occams) follows suit, being also released under the [MIT license](LICENSE)
117
+ - [Occams](https://github.com/avonderluft/occams) Copyright 2023 Andrew vonderLuft, following suit, also released under the [MIT license](LICENSE)
data/TODOS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ToDos
2
2
 
3
3
  - add application console for testing
4
- - feature to resize file_link'd images
4
+ - add feature to resize file_link'd images
5
5
  - get the original [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) tests working
6
- - add documentation to Occams to replace ComfortableMexicanSofa
6
+ - add and update documentation to Occams to replace ComfortableMexicanSofa
@@ -74,11 +74,11 @@ protected
74
74
  # Getting page and setting content_cache and fragments data if we need to
75
75
  # serve translation data
76
76
  def find_cms_page_by_full_path(full_path)
77
- if Rails.env == 'production'
78
- @cms_page = @cms_site.pages.published.find_by!(full_path: full_path)
79
- else
80
- @cms_page = @cms_site.pages.find_by!(full_path: full_path)
81
- end
77
+ @cms_page = if Rails.env == 'production'
78
+ @cms_site.pages.published.find_by!(full_path: full_path)
79
+ else
80
+ @cms_site.pages.find_by!(full_path: full_path)
81
+ end
82
82
 
83
83
  @cms_page.translate!
84
84
  @cms_layout = @cms_page.layout
@@ -41,4 +41,6 @@
41
41
  %span.version= Rails::version
42
42
  = link_to 'Ruby', 'https://www.ruby-lang.org', target: '_blank'
43
43
  %span.version= RUBY_VERSION
44
- = Rails.env
44
+ %br
45
+ = Rails.env.upcase
46
+
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Tag for injecting HTML5 audio player. Example tag:
4
+ # {{ cms:audio "path/to/audio", style: "height: 22px; width: 80%" }}
5
+ # This expands into:
6
+ # <audio controls src="path/to/audio"></audio>
7
+ # To customize your player style, add a 'audioplayer' class to your CSS, e.g
8
+ # .audioplayer
9
+ # border-radius: 6px
10
+ # height: 22px
11
+ # width: 60%
12
+ # margin: 2px 0 2px 8px
13
+ # padding: 0
14
+ # and/or pass in style overrides with the 'style' parameter
15
+
16
+ class Occams::Content::Tag::Audio < Occams::Content::Tag
17
+ attr_reader :path, :locals
18
+
19
+ def initialize(context:, params: [], source: nil)
20
+ super
21
+ options = params.extract_options!
22
+ @path = params[0]
23
+ @style = options['style']
24
+
25
+ return if @path.present?
26
+
27
+ raise Error, 'Missing path for audio tag'
28
+ end
29
+
30
+ def content
31
+ format(
32
+ '<style>.audioplayer {%<style>s}</style><audio controls class="audioplayer" src=%<path>p></audio>',
33
+ path: @path,
34
+ style: @style
35
+ )
36
+ end
37
+ end
38
+
39
+ Occams::Content::Renderer.register_tag(
40
+ :audio, Occams::Content::Tag::Audio
41
+ )
@@ -24,6 +24,7 @@ require_relative 'content/tags/files'
24
24
 
25
25
  require_relative 'content/tags/snippet'
26
26
  require_relative 'content/tags/asset'
27
+ require_relative 'content/tags/audio'
27
28
  require_relative 'content/tags/file_link'
28
29
  require_relative 'content/tags/page_file_link'
29
30
  require_relative 'content/tags/helper'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Occams
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
data/occams.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.add_runtime_dependency 'kramdown', '~> 2.4', '>= 2.4.0'
29
29
  s.add_runtime_dependency 'mimemagic', '~> 0.4', '>= 0.4.3'
30
30
  s.add_runtime_dependency 'mini_magick', '~> 4.12', '>= 4.12.0'
31
- s.add_dependency 'rails', '>= 6.1.7.4'
31
+ s.add_dependency 'rails', '>= 6.1.0'
32
32
  s.add_runtime_dependency 'rails-i18n', '>= 6.0.0'
33
33
  s.add_runtime_dependency 'sassc-rails', '~> 2.1', '>= 2.1.2'
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occams
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-14 00:00:00.000000000 Z
11
+ date: 2023-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_link_to
@@ -176,14 +176,14 @@ dependencies:
176
176
  requirements:
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
- version: 6.1.7.4
179
+ version: 6.1.0
180
180
  type: :runtime
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - ">="
185
185
  - !ruby/object:Gem::Version
186
- version: 6.1.7.4
186
+ version: 6.1.0
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: rails-i18n
189
189
  requirement: !ruby/object:Gem::Requirement
@@ -653,6 +653,7 @@ files:
653
653
  - lib/occams/content/renderer.rb
654
654
  - lib/occams/content/tag.rb
655
655
  - lib/occams/content/tags/asset.rb
656
+ - lib/occams/content/tags/audio.rb
656
657
  - lib/occams/content/tags/checkbox.rb
657
658
  - lib/occams/content/tags/date.rb
658
659
  - lib/occams/content/tags/datetime.rb