strada-rails 0.0.3 → 0.0.4

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: c249357d91c182e542afecfe632377bf3a822fe8fbb698e467ee384db79ab77f
4
- data.tar.gz: 3605854dfcb0eb32ce5717c0494547d4908f13e6429d14ba39171932fc9c57d1
3
+ metadata.gz: eb9228de23e4d69eddc81e12af66c15a298b9b867024701af1e37c2a4fa33589
4
+ data.tar.gz: fdbfda34a88d91bfbf73084d3b0565686d89a92ec6a30b83d711b762dbb974f2
5
5
  SHA512:
6
- metadata.gz: 24642340e1759c81dd49153ccbcbb43ed81efcf4efefcaacc8e8f71c144202d5bc674ebbe8924eea2d624f21090286d02cfb81c4d7b6742c40b8950ed346b900
7
- data.tar.gz: 6495fc53530f6323186e47a42fe01736384b750140cb9780fb6a78de3d5558e8575174e3e2b3e196c1947dc180492295a6e098629983f31a9bb648c2bbc24d91
6
+ metadata.gz: 3f56d6ea102e136c7e5e9ea6ab74bdd9b12846c5294f1338bced53e52cb1d097e9087196edac25c5dcde42829c5a4bf13b774327910cbe1933150424d960576d
7
+ data.tar.gz: e626f6fb0a22c11ef2f734c2ffd94bd49088b1ea54af4181bbc811bd11431ab5cba306cd83c544e253d7088b7b13d8e4924d18221c539e4febb5b5b03cfcfee5
@@ -1,10 +1,10 @@
1
- <h1 class="hide-on-mobile">Editing <%= human_name.downcase %></h1>
1
+ <h1 class="hide-on-native">Editing <%= human_name.downcase %></h1>
2
2
 
3
3
  <%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
4
4
 
5
5
  <br>
6
6
 
7
- <div class="hide-on-mobile">
7
+ <div class="hide-on-native">
8
8
  <%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %> %> |
9
9
  <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %> %>
10
10
  </div>
@@ -2,7 +2,7 @@
2
2
  <p style="color: green" data-controller="bridge--flash-message"><%%= notice %></p>
3
3
  <%% end %>
4
4
 
5
- <h1 class="hide-on-mobile"><%= human_name.pluralize %></h1>
5
+ <h1 class="hide-on-native"><%= human_name.pluralize %></h1>
6
6
 
7
7
  <div id="<%= plural_table_name %>">
8
8
  <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
@@ -1,9 +1,9 @@
1
- <h1 class="hide-on-mobile">New <%= human_name.downcase %></h1>
1
+ <h1 class="hide-on-native">New <%= human_name.downcase %></h1>
2
2
 
3
3
  <%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
4
4
 
5
5
  <br>
6
6
 
7
- <div class="hide-on-mobile">
7
+ <div class="hide-on-native">
8
8
  <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %> %>
9
9
  </div>
@@ -5,7 +5,7 @@
5
5
  <%%= render @<%= singular_table_name %> %>
6
6
 
7
7
  <div>
8
- <div class="hide-on-mobile">
8
+ <div class="hide-on-native">
9
9
  <%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, data: { controller: "bridge--nav-button", bridge_title: "Edit" } %> |
10
10
  <%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %> %>
11
11
  </div>
@@ -1,11 +1,5 @@
1
1
  APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
2
2
 
3
- HIDE_ON_MOBILE_STYLE = <<-HTML.chomp
4
- <% if turbo_native_app? %>
5
- <style>.hide-on-mobile { display: none; }</style>
6
- <% end %>
7
- HTML
8
-
9
3
  destination = Pathname(destination_root)
10
4
 
11
5
  say "Copy bridge controllers"
@@ -23,8 +17,12 @@ unless destination.join("app/assets/application.css").exist?
23
17
  end
24
18
  end
25
19
 
26
- say "Add hide-on-mobile style in application layout"
27
- insert_into_file APPLICATION_LAYOUT_PATH.to_s, "\n\n#{HIDE_ON_MOBILE_STYLE}", before: /\s*<\/head>/
20
+ say "Add hide-on-native style in application layout"
21
+ insert_into_file APPLICATION_LAYOUT_PATH.to_s, <<~ERB.indent(4).prepend("\n"), before: /^\s*<\/head>/
22
+ <% if turbo_native_app? %>
23
+ <style>.hide-on-native { display: none; }</style>
24
+ <% end %>
25
+ ERB
28
26
 
29
27
  say "Install Strada"
30
28
  run "bun add @hotwired/stimulus"
@@ -1,11 +1,5 @@
1
1
  APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
2
2
 
3
- HIDE_ON_MOBILE_STYLE = <<-HTML.chomp
4
- <% if turbo_native_app? %>
5
- <style>.hide-on-mobile { display: none; }</style>
6
- <% end %>
7
- HTML
8
-
9
3
  destination = Pathname(destination_root)
10
4
 
11
5
  say "Copy bridge controllers"
@@ -20,8 +14,12 @@ unless destination.join("app/assets/application.css").exist?
20
14
  end
21
15
  end
22
16
 
23
- say "Add hide-on-mobile style in application layout"
24
- insert_into_file APPLICATION_LAYOUT_PATH.to_s, "\n\n#{HIDE_ON_MOBILE_STYLE}", before: /\s*<\/head>/
17
+ say "Add hide-on-native style in application layout"
18
+ insert_into_file APPLICATION_LAYOUT_PATH.to_s, <<~ERB.indent(4).prepend("\n"), before: /^\s*<\/head>/
19
+ <% if turbo_native_app? %>
20
+ <style>.hide-on-native { display: none; }</style>
21
+ <% end %>
22
+ ERB
25
23
 
26
24
  say "Pin Strada"
27
25
  say %(Appending: pin "@hotwired/strada", to: "strada.js", preload: true")
@@ -1,11 +1,5 @@
1
1
  APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
2
2
 
3
- HIDE_ON_MOBILE_STYLE = <<-HTML.chomp
4
- <% if turbo_native_app? %>
5
- <style>.hide-on-mobile { display: none; }</style>
6
- <% end %>
7
- HTML
8
-
9
3
  destination = Pathname(destination_root)
10
4
 
11
5
  say "Copy bridge controllers"
@@ -23,8 +17,12 @@ unless destination.join("app/assets/application.css").exist?
23
17
  end
24
18
  end
25
19
 
26
- say "Add hide-on-mobile style in application layout"
27
- insert_into_file APPLICATION_LAYOUT_PATH.to_s, "\n\n#{HIDE_ON_MOBILE_STYLE}", before: /\s*<\/head>/
20
+ say "Add hide-on-native style in application layout"
21
+ insert_into_file APPLICATION_LAYOUT_PATH.to_s, <<~ERB.indent(4).prepend("\n"), before: /^\s*<\/head>/
22
+ <% if turbo_native_app? %>
23
+ <style>.hide-on-native { display: none; }</style>
24
+ <% end %>
25
+ ERB
28
26
 
29
27
  say "Install Strada"
30
28
  run "yarn add @hotwired/strada"
@@ -1,3 +1,3 @@
1
1
  module Strada
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strada-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-16 00:00:00.000000000 Z
11
+ date: 2023-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties