administration-zero 0.0.1 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.documentation/screenshot.png +0 -0
- data/Gemfile.lock +1 -1
- data/README.md +16 -3
- data/lib/administration_zero/version.rb +1 -1
- data/lib/generators/admin/install/install_generator.rb +2 -1
- data/lib/generators/admin/install/templates/erb/admin/users/index.html.erb +2 -0
- data/lib/generators/admin/install/templates/seeds.rb +9 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dfec2196620eeb4f41eecb79c5de4836af5743f0fdb52a0595cb70a7b43fb69
|
4
|
+
data.tar.gz: 900f10c4b40c19d76f38cb6532f81685487be7c096ed3fa79bb12a1da3e0c1d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d2c0498d00525f4f1fa2ad0d52e1365a567e435414329326ba914fa4ac814e24e294ad61ac57ccd1a4942d81a21afbe7aa304ba05444f383ed48a309a4e1aec
|
7
|
+
data.tar.gz: 06166e51591ef895a5f482bb282fcc205934055cefa7273df74eaf77f589da47afdfb8002f6f67a4ea6a7a2517f3b0830ea089fba8b6a4857c8e5890de217147
|
Binary file
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
The purpose of administration zero is to generate a pre-built administration panel into a rails application.
|
4
4
|
|
5
|
+
<img src=".documentation/screenshot.png" alt="Demo" style="max-width: 100%;">
|
6
|
+
|
5
7
|
## Features
|
6
8
|
|
7
9
|
- [Beautiful interface](https://github.com/tabler/tabler)
|
@@ -16,18 +18,29 @@ The purpose of administration zero is to generate a pre-built administration pan
|
|
16
18
|
Add this line to your application's Gemfile:
|
17
19
|
|
18
20
|
```ruby
|
19
|
-
gem "
|
21
|
+
gem "administration-zero"
|
20
22
|
```
|
21
23
|
|
22
24
|
Then run `bundle install`
|
23
25
|
|
26
|
+
You'll need to create a model to be administrated, if you don't have one. for this example let's use the following:
|
27
|
+
|
28
|
+
```
|
29
|
+
$ rails generate model posts title:string body:text published:boolean
|
30
|
+
```
|
31
|
+
|
24
32
|
## Usage
|
25
33
|
|
26
34
|
```
|
27
35
|
$ rails generate admin:install
|
28
36
|
```
|
29
37
|
|
30
|
-
Then run `bundle install` again
|
38
|
+
Then run `bundle install` again
|
39
|
+
|
40
|
+
Then run `rails db:seed`, you can access the admin panel in `/admin`, using `email: "admin@example.com", password: "Password9957"`
|
41
|
+
|
42
|
+
|
43
|
+
Now you're ready to generate your admin scaffolds.
|
31
44
|
|
32
45
|
```
|
33
46
|
$ rails generate admin:scaffold posts title:string body:text published:boolean
|
@@ -37,7 +50,7 @@ $ rails generate admin:scaffold posts title:string body:text published:boolean
|
|
37
50
|
|
38
51
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
39
52
|
|
40
|
-
To
|
53
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
41
54
|
|
42
55
|
## Contributing
|
43
56
|
|
@@ -14,7 +14,8 @@ module Admin
|
|
14
14
|
gem "spreadsheet_architect", comment: "Spreadsheet Architect is a library that allows you to create XLSX, ODS, or CSV spreadsheets super easily [https://github.com/westonganger/spreadsheet_architect]"
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
17
|
+
def create_db_files
|
18
|
+
copy_file "seeds.rb", "db/seeds.rb", force: true
|
18
19
|
migration_template "migrations/create_admin_users.rb", "#{db_migrate_path}/create_admin_users.rb"
|
19
20
|
end
|
20
21
|
|
@@ -37,6 +37,7 @@
|
|
37
37
|
<table class="table table-vcenter card-table table-striped">
|
38
38
|
<thead>
|
39
39
|
<tr>
|
40
|
+
<th><%= sort_link @search, :id %></th>
|
40
41
|
<th><%= sort_link @search, :email %></th>
|
41
42
|
<th><%= sort_link @search, :created_at %></th>
|
42
43
|
<th></th>
|
@@ -45,6 +46,7 @@
|
|
45
46
|
<tbody>
|
46
47
|
<% @admin_users.each do |admin_user| %>
|
47
48
|
<tr>
|
49
|
+
<td><%= link_to admin_user.id, admin_user %></td>
|
48
50
|
<td><%= admin_user.email %></td>
|
49
51
|
<td><%= l(admin_user.created_at, format: :long) %></td>
|
50
52
|
<td>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
|
7
|
+
# Character.create(name: "Luke", movie: movies.first)
|
8
|
+
|
9
|
+
AdminUser.create(email: "admin@example.com", password: "Password9957", password_confirmation: "Password9957")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administration-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nixon
|
@@ -17,6 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".documentation/screenshot.png"
|
20
21
|
- ".gitignore"
|
21
22
|
- CHANGELOG.md
|
22
23
|
- CODE_OF_CONDUCT.md
|
@@ -457,6 +458,7 @@ files:
|
|
457
458
|
- lib/generators/admin/install/templates/models/admin/current.rb
|
458
459
|
- lib/generators/admin/install/templates/models/admin_user.rb
|
459
460
|
- lib/generators/admin/install/templates/models/application_record.rb
|
461
|
+
- lib/generators/admin/install/templates/seeds.rb
|
460
462
|
- lib/generators/admin/install/templates/test_unit/admin_users.yml
|
461
463
|
- lib/generators/admin/install/templates/test_unit/application_system_test_case.rb
|
462
464
|
- lib/generators/admin/install/templates/test_unit/controllers/admin/home_controller_test.rb
|