-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
390 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,6 @@ | |
/test/dummy/storage/ | ||
/test/dummy/tmp/ | ||
.byebug_history | ||
*.gem | ||
*.gem | ||
node_modules/ | ||
test/dummy/mkmf.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/), and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [0.0.4] - 2024-01-31 | ||
### Added | ||
- Integration of Flowbite, including configuration and installer (`Add Flowbite config and installer`). | ||
- Flowbite framework to enhance UI/UX design (`Add Flowbite`). | ||
- Horizontal scrolling for tables to improve UI (`Feature: Add overflow scroll x on tables`). | ||
|
||
### Upgrade | ||
- Add [documentation](docs/upgrade_to_0.0.4.md) to upgrade from previous versions | ||
|
||
## [0.0.3] - 2024-01-31 | ||
### Changed | ||
- Update to generator tool or script (`Update generator`). | ||
|
||
### Fixed | ||
- Improvements to project specifications or tests (`Fix specs`). | ||
|
||
## [0.0.2] - 2024-01-24 | ||
### Added | ||
- GitHub Actions workflow for automated gem pushing (`Add GitHub Actions for gem push`). | ||
|
||
### Changed | ||
- Update to `.gitignore` to refine project configuration. | ||
|
||
## [0.0.1] - 2024-01-17 | ||
### Added | ||
- Initial release with basic theme setup. | ||
|
||
## [0.0.0] - 2024-01-10 | ||
### Fixed | ||
- Minor bug fixes and performance improvements. | ||
|
||
### Changed | ||
- Adjustments to `.gitignore` and initial project setup. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- Default Sidebar --> | ||
<aside id="default-sidebar" class="fixed top-0 left-0 z-40 w-64 h-screen transition-transform -translate-x-full sm:translate-x-0" aria-label="Sidebar"> | ||
<div class="h-full px-3 py-4 overflow-y-auto bg-gray-50 dark:bg-gray-800"> | ||
<ul class="space-y-2 font-medium"> | ||
<% if defined?(root_path) %> | ||
<li> | ||
<%= link_to(root_path, class: "flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group") do %> | ||
<svg class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 22 21"> | ||
<path d="M4 10L3.29289 10.7071L2.58579 10L3.29289 9.29289L4 10ZM21 18C21 18.5523 20.5523 19 20 19C19.4477 19 19 18.5523 19 18L21 18ZM8.29289 15.7071L3.29289 10.7071L4.70711 9.29289L9.70711 14.2929L8.29289 15.7071ZM3.29289 9.29289L8.29289 4.29289L9.70711 5.70711L4.70711 10.7071L3.29289 9.29289ZM4 9L14 9L14 11L4 11L4 9ZM21 16L21 18L19 18L19 16L21 16ZM14 9C17.866 9 21 12.134 21 16L19 16C19 13.2386 16.7614 11 14 11L14 9Z" fill="#33363F"/> | ||
</svg> | ||
<span class="ms-3"> | ||
<%= t("administrate.navigation.back_to_app") %> | ||
</span> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
<% Administrate::Namespace.new(namespace).resources_with_index_route.each do |resource| %> | ||
<% if accessible_action?(model_from_resource(resource), :index) %> | ||
<%= link_to(resource_index_route(resource), class: "flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group #{'bg-gray-100' if nav_link_state(resource)&.to_sym == :active }") do %> | ||
<% if icon?(resource) %> | ||
<%= render partial: "administrate/navigation/icons/#{resource}" %> | ||
<% end %> | ||
<span class="ms-3"> | ||
<%= display_resource_name(resource) %> | ||
</span> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</ul> | ||
</div> | ||
</aside> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!-- Flowbite Sidebar --> | ||
<button data-drawer-target="default-sidebar" data-drawer-toggle="default-sidebar" aria-controls="default-sidebar" type="button" class="inline-flex items-center p-2 mt-2 ml-3 text-sm text-gray-500 rounded-lg sm:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"> | ||
<button data-drawer-target="sidebar-multi-level-sidebar" data-drawer-toggle="sidebar-multi-level-sidebar" aria-controls="sidebar-multi-level-sidebar" type="button" class="inline-flex items-center p-2 mt-2 ms-3 text-sm text-gray-500 rounded-lg sm:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"> | ||
<span class="sr-only">Open sidebar</span> | ||
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> | ||
<path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path> | ||
</svg> | ||
</button> | ||
|
||
<aside id="sidebar-multi-level-sidebar" class="fixed top-0 left-0 z-40 w-64 h-screen transition-transform -translate-x-full sm:translate-x-0" aria-label="Sidebar"> | ||
<div class="h-full px-3 py-4 overflow-y-auto bg-gray-50 dark:bg-gray-800"> | ||
<ul class="space-y-2 font-medium"> | ||
<% if defined?(root_path) %> | ||
<li> | ||
<%= link_to(root_path, class: "flex items-center p-2 text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group") do %> | ||
<svg class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 22 21"> | ||
<path d="M4 10L3.29289 10.7071L2.58579 10L3.29289 9.29289L4 10ZM21 18C21 18.5523 20.5523 19 20 19C19.4477 19 19 18.5523 19 18L21 18ZM8.29289 15.7071L3.29289 10.7071L4.70711 9.29289L9.70711 14.2929L8.29289 15.7071ZM3.29289 9.29289L8.29289 4.29289L9.70711 5.70711L4.70711 10.7071L3.29289 9.29289ZM4 9L14 9L14 11L4 11L4 9ZM21 16L21 18L19 18L19 16L21 16ZM14 9C17.866 9 21 12.134 21 16L19 16C19 13.2386 16.7614 11 14 11L14 9Z" fill="#33363F"/> | ||
</svg> | ||
<span class="ms-3"> | ||
<%= t("administrate.navigation.back_to_app") %> | ||
</span> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
<% grouped_resources.map do |group_name, resources| %> | ||
<li> | ||
<button type="button" class="flex items-center w-full p-2 text-base text-gray-900 transition duration-75 rounded-lg group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700" aria-controls="dropdown-example-<%= group_name %>" data-collapse-toggle="dropdown-example-<%= group_name %>"> | ||
<% if icon?(group_name) %> | ||
<%= render partial: "administrate/navigation/icons/#{group_name}" %> | ||
<% end %> | ||
<span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap"> | ||
<%= group_name.to_s.capitalize %> | ||
</span> | ||
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/> | ||
</svg> | ||
</button> | ||
<ul id="dropdown-example-<%= group_name %>" class="hidden py-2 space-y-2"> | ||
<% resources.map do |resource| %> | ||
<% if accessible_action?(model_from_resource(resource), :index) %> | ||
<li> | ||
<%= link_to(resource_index_route(resource), class: "flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700 #{'bg-gray-200' if nav_link_state(resource)&.to_sym == :active }") do %> | ||
<% if icon?(resource) %> | ||
<%= render partial: "administrate/navigation/icons/#{resource}" %> | ||
<% end %> | ||
<span class="ms-3"> | ||
<%= display_resource_name(resource) %> | ||
</span> | ||
<% end %> | ||
</li> | ||
<% end %> | ||
<% end %> | ||
</ul> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
</aside> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 22 21"> | ||
<path d="M21.66,10.25l-9-8a1,1,0,0,0-1.32,0l-9,8a1,1,0,0,0-.27,1.11A1,1,0,0,0,3,12H4v9a1,1,0,0,0,1,1H19a1,1,0,0,0,1-1V12h1a1,1,0,0,0,.93-.64A1,1,0,0,0,21.66,10.25ZM13,20H11V17a1,1,0,0,1,2,0Zm5,0H15V17a3,3,0,0,0-6,0v3H6V12H18ZM5.63,10,12,4.34,18.37,10Z"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# How to Upgrade to Include Flowbite | ||
|
||
Upgrading from a version prior to 0.0.4 to include Flowbite in your project involves several key steps. Follow this guide to ensure a smooth transition and to leverage the enhancements offered by Flowbite within your administrate-tailwind-theme setup. | ||
|
||
## Step 1: Upgrade the Gem | ||
|
||
First, ensure that you update the `administrate-tailwind-theme` gem to the latest version. Modify your Gemfile to specify the new version: | ||
|
||
```ruby | ||
gem 'administrate-tailwind-theme', '~> 0.4.0' | ||
``` | ||
|
||
Then, run `bundle update administrate-tailwind-theme` to update the gem in your project. | ||
|
||
## Step 2: Install Flowbite | ||
|
||
Flowbite must be installed manually using npm to ensure it's properly integrated into your project. Navigate to the root of your project and run the following command: | ||
|
||
```bash | ||
npm install flowbite --save | ||
``` | ||
|
||
This command adds Flowbite to your project's dependencies, ensuring you have the latest version compatible with the administrate-tailwind-theme. | ||
|
||
## Step 3: Update Tailwind Configuration | ||
|
||
Modify your `tailwind.config.js` file to include the necessary configurations for Flowbite. You should add Flowbite as a plugin in your Tailwind configuration. Here is an example modification: | ||
|
||
```javascript | ||
module.exports = { | ||
// Existing configuration... | ||
content: [ | ||
// Other content... | ||
'./node_modules/flowbite/**/*.js', | ||
], | ||
plugins: [ | ||
// Other plugins... | ||
require('flowbite/plugin') | ||
], | ||
}; | ||
``` | ||
|
||
Ensure you merge this snippet with your existing Tailwind configuration, paying special attention not to overwrite any existing settings. | ||
|
||
## Step 4: Enable Flowbite in the Initializer | ||
|
||
After installing the gem, an initializer file is generated for the administrate-tailwind-theme. You'll need to modify this initializer to enable Flowbite within your project. Open the initializer (typically found at `config/initializers/administrate_tailwind_theme.rb`) and add or modify the following line: | ||
|
||
```ruby | ||
AdministrateTailwindTheme.config.flowbite = true | ||
``` | ||
|
||
This line ensures that Flowbite is enabled and that the administrate-tailwind-theme will utilize its components and styling. | ||
|
||
## Final Steps | ||
```shell | ||
./bin/dev | ||
``` | ||
|
||
After completing these steps, ensure that you test your application thoroughly to confirm that the upgrade has been successful and that Flowbite components are correctly integrated and functioning as expected. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module AdministrateTailwindTheme | ||
class Configuration | ||
class << self | ||
attr_accessor :flowbite | ||
|
||
def configure | ||
yield(self) | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.