administration-zero 1.0.0 → 1.0.1

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: f33382ad3760ecfd1ab0cea402939763e49c2c80913abda93e23c9142fdf3293
4
- data.tar.gz: 35c3b4570ea9d480cd142df44ef676daf5fc794734827749606f1a449809b49e
3
+ metadata.gz: 5535d5c246174e4d3f6db561d68f9e89466752094029e9cfdc45735b220bce78
4
+ data.tar.gz: b93e1c1793e35aae39e5b8d127c9253524ca3a022a5692fce47a7c342b766209
5
5
  SHA512:
6
- metadata.gz: 2332226c5e149e3888d81e62583855938992d23e35502c0b2718e42b53abb678ab28029870776a79484513db2ae000553c19d5e56b6d1ed0005921145f60712b
7
- data.tar.gz: 5c6303d63569190b71e0f99b81df55308fccf6dc6f39042ebac8031f1e2a3e237bba37d0a8664d59370384b3cbf20c75e34c03aa9daf0dda0766aee2a696bd39
6
+ metadata.gz: f3f3660673d5698081315d20630b4d72835bab63c3aa038b05b355d80df5a6522e1208ab8c179e5b6cf5014b9bb2e73ef20872f8a9ed2f99e3dd5f1fefdefcac
7
+ data.tar.gz: e1ba7313c918f5b294ec59fe4211c1a5a3e059d44cbb3812deb48818bc803f5aed11da75f2f146aa3a0dffbc7306e29da522937e6f81a23f3a507ae899addceb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- administration-zero (1.0.0)
4
+ administration-zero (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -22,22 +22,23 @@ The purpose of administration zero is to generate a pre-built administration pan
22
22
  bundle add administration-zero
23
23
  ```
24
24
 
25
- You'll need to create a model to be administrated, if you don't have one. for this example let's use the following:
26
-
27
- ```
28
- rails generate model posts title:string body:text published:boolean
29
- ```
30
-
31
25
  ## Usage
32
26
 
33
27
  ```
34
28
  rails generate admin:install
35
29
  ```
36
30
 
37
- Then run `bundle install` again
31
+ Then run `bundle install`
38
32
 
39
- Then run `rails db:migrate db:seed`, you can access the admin panel in `/admin`, using `email: "admin@example.com", password: "Password9957"`
33
+ Then run `rails db:migrate db:seed`
40
34
 
35
+ You can access the admin panel in `/admin`, using `email: "admin@example.com", password: "Password9957"`
36
+
37
+ You'll need to create a model to be administrated, if you don't have one. for this example let's use the following:
38
+
39
+ ```
40
+ rails generate model posts title:string body:text published:boolean
41
+ ```
41
42
 
42
43
  Now you're ready to generate your admin scaffolds.
43
44
 
@@ -1,3 +1,3 @@
1
1
  module AdministrationZero
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -3,7 +3,7 @@
3
3
  <div class="navbar navbar-light">
4
4
  <div class="container-xl">
5
5
  <ul class="navbar-nav">
6
- <li class="nav-item <%= active_nav_item 'admin/home' %>">
6
+ <li class="nav-item <%= active_nav_item("admin/home") %>">
7
7
  <%= link_to admin_path, class: "nav-link" do %>
8
8
  <span class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
9
9
  <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><polyline points="5 12 3 12 12 3 21 12 19 12" /><path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" /><path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" /></svg>
@@ -13,7 +13,7 @@
13
13
  </span>
14
14
  <% end %>
15
15
  </li>
16
- <li class="nav-item <%= active_nav_item 'admin/users' %>">
16
+ <li class="nav-item <%= active_nav_item("admin/users") %>">
17
17
  <%= link_to admin_users_path, class: "nav-link" do %>
18
18
  <span class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
19
19
  <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><circle cx="9" cy="7" r="4"></circle><path d="M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path><path d="M21 21v-2a4 4 0 0 0 -3 -3.85"></path></svg>
@@ -5,12 +5,7 @@ module Admin::ApplicationHelper
5
5
  content_for(:title) || Rails.application.class.to_s.split("::").first
6
6
  end
7
7
 
8
- def active_nav_item(controller, actions = %w(index show new edit create update))
9
- active_actions?(controller, actions) ? "active" : ""
8
+ def active_nav_item(*names)
9
+ names.include?(controller_path) ? "active" : ""
10
10
  end
11
-
12
- private
13
- def active_actions?(controller, actions)
14
- params[:controller].include?(controller) && actions.include?(params[:action])
15
- end
16
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administration-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-02 00:00:00.000000000 Z
11
+ date: 2023-03-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: