13 changed files with 1299 additions and 52 deletions
-
1Gemfile
-
39Gemfile.lock
-
25README.md
-
4TODO.md
-
3app/assets/tailwind/application.css
-
124app/assets/tailwind/daisyui-theme.js
-
1031app/assets/tailwind/daisyui.js
-
7app/views/layouts/application.html.erb
-
36app/views/layouts/components/_flash.html.erb
-
15app/views/layouts/components/_navbar.html.erb
-
25app/views/notification/index.html.erb
-
12config/importmap.rb
-
29config/initializers/get_smart.rb
@ -1,24 +1,11 @@ |
|||
# README |
|||
# Notification |
|||
|
|||
This README would normally document whatever steps are necessary to get the |
|||
application up and running. |
|||
quick try-out app for displaying toaster as flash message based on Rails8 |
|||
|
|||
Things you may want to cover: |
|||
## run (mode dev) |
|||
|
|||
* Ruby version |
|||
* bin/dev |
|||
|
|||
* System dependencies |
|||
## building process |
|||
|
|||
* Configuration |
|||
|
|||
* Database creation |
|||
|
|||
* Database initialization |
|||
|
|||
* How to run the test suite |
|||
|
|||
* Services (job queues, cache servers, search engines, etc.) |
|||
|
|||
* Deployment instructions |
|||
|
|||
* ... |
|||
* bin/importmap pin toastify-js |
@ -0,0 +1,4 @@ |
|||
TODO |
|||
==== |
|||
|
|||
* [ ] resolve daisyui and daisyui-theme via importmap |
@ -1 +1,4 @@ |
|||
@import "tailwindcss"; |
|||
|
|||
@plugin "./daisyui.js"; |
|||
@plugin "./daisyui-theme.js"; |
124
app/assets/tailwind/daisyui-theme.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1031
app/assets/tailwind/daisyui.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,16 +1,22 @@ |
|||
<% if flash.any? %> |
|||
<h2 class='bold text-2xl'>FLASH</h2> |
|||
<ul> |
|||
<li> |
|||
<% if flash.key?(:alert) %> |
|||
ALERT = <%= flash.alert %> |
|||
<% end %> |
|||
</li> |
|||
<footer class="footer sm:footer-horizontal footer-center bg-base-300 text-base-content p-4"> |
|||
<aside> |
|||
<p>Copyleft AGPLv3</p> |
|||
</aside> |
|||
|
|||
<li> |
|||
<% if flash.key?(:notice) %> |
|||
NOTICE = <%= flash.notice %> |
|||
<% end %> |
|||
</li> |
|||
</ul> |
|||
<% end %> |
|||
<% if flash.any? %> |
|||
<h2 class='bold text-2xl'>FLASH</h2> |
|||
<ul> |
|||
<li> |
|||
<% if flash.key?(:alert) %> |
|||
ALERT = <%= flash.alert %> |
|||
<% end %> |
|||
</li> |
|||
|
|||
<li> |
|||
<% if flash.key?(:notice) %> |
|||
NOTICE = <%= flash.notice %> |
|||
<% end %> |
|||
</li> |
|||
</ul> |
|||
<% end %> |
|||
</footer> |
@ -0,0 +1,15 @@ |
|||
<div class="navbar bg-base-100 shadow-sm"> |
|||
<div class="flex-none"> |
|||
<button class="btn btn-square btn-ghost"> |
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="inline-block h-5 w-5 stroke-current"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path> </svg> |
|||
</button> |
|||
</div> |
|||
<div class="flex-1"> |
|||
<a class="btn btn-ghost text-xl"><%= Rails.application.name.upcase %> app</a> |
|||
</div> |
|||
<div class="flex-none"> |
|||
<button class="btn btn-square btn-ghost"> |
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="inline-block h-5 w-5 stroke-current"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"></path> </svg> |
|||
</button> |
|||
</div> |
|||
</div> |
@ -1,11 +1,22 @@ |
|||
<div> |
|||
<h1 class="font-bold text-4xl">Notification#index</h1> |
|||
<h1 class="font-bold text-4xl">Try out our Toaster Flash rendering</h1> |
|||
</div> |
|||
|
|||
<div> |
|||
<h2 class="text-bold text-2xl">Links</h2> |
|||
<ul> |
|||
<li><%= link_to 'Notice', notification_show_notice_path%></li> |
|||
<li><%= link_to 'Alert', notification_show_alert_path%></li> |
|||
<li><%= link_to 'Nothing', notification_index_path%></li> |
|||
</ul> |
|||
<h2 class="text-bold text-2xl"> |
|||
By using |
|||
<span class="italic">redirect_to</span> |
|||
</h2> |
|||
|
|||
<ul class="list bg-base-100 rounded-box shadow-md"> |
|||
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide"> |
|||
<%= link_to 'Notice', notification_show_notice_path, class: 'btn btn-primary'%> |
|||
</li> |
|||
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide"> |
|||
<%= link_to 'Alert', notification_show_alert_path, class: 'btn btn-secondary'%> |
|||
</li> |
|||
<li class="p-4 pb-2 text-xs opacity-60 tracking-wide"> |
|||
<%= link_to 'Nothing', notification_index_path, class: 'btn btn-accent btn-outline'%> |
|||
</li> |
|||
</ul> |
|||
</div> |
@ -1,7 +1,9 @@ |
|||
# Pin npm packages by running ./bin/importmap |
|||
|
|||
pin "application" |
|||
pin "@hotwired/turbo-rails", to: "turbo.min.js" |
|||
pin "@hotwired/stimulus", to: "stimulus.min.js" |
|||
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" |
|||
pin_all_from "app/javascript/controllers", under: "controllers" |
|||
pin 'application' |
|||
pin '@hotwired/turbo-rails', to: 'turbo.min.js' |
|||
pin '@hotwired/stimulus', to: 'stimulus.min.js' |
|||
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js' |
|||
pin_all_from 'app/javascript/controllers', under: 'controllers' |
|||
|
|||
pin 'toastify-js' # @1.12.0 |
@ -0,0 +1,29 @@ |
|||
if defined?(Get::Smart) |
|||
Get::Smart.setup do |config| |
|||
# Enable or disable Get::Smart. Default: Rails.env.development? |
|||
config.enabled = Rails.env.development? |
|||
|
|||
# Specify level, by default it's [:any], you can specify multiple levels |
|||
# Available options: [:any, :beginner, :middle, :advanced, :expert] |
|||
# Example: |
|||
# config.level = [:beginner, :advanced] |
|||
# config.level = [:advanced, :expert] |
|||
# config.level = :any |
|||
config.level = :any |
|||
|
|||
# Frequency for showing tips. Default: :always |
|||
# Available options: |
|||
# :always, :half_hourly, :hourly, :every_two_hours, :every_three_hours, |
|||
# :every_four_hours, :every_five_hours, :every_six_hours, :every_seven_hours, |
|||
# :every_eight_hours, :every_nine_hours, :every_ten_hours, :every_eleven_hours, |
|||
# :every_twelve_hours, :daily, :every_two_days, :weekly, |
|||
config.frequency = :always |
|||
|
|||
# Path to the file that will store the last shown tip. Default: ~/.get-smart-memory |
|||
# config.memory_file_path = File.expand_path("~/.get-smart-memory") |
|||
# |
|||
|
|||
# Print file details with the tip. Default: false |
|||
config.print_file_details = true |
|||
end |
|||
end |
Write
Preview
Loading…
Cancel
Save
Reference in new issue