AdminSpace 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -7,12 +7,12 @@ AdminSpace handle admin namespace, controllers, views in your application
7
7
  Using bundler:
8
8
  In your Gemfile
9
9
  ```
10
- gem 'admin_space'
10
+ gem 'AdminSpace'
11
11
  ```
12
12
 
13
13
  Or manually :
14
14
  ```
15
- gem install admin_space
15
+ gem install AdminSpace
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -0,0 +1,7 @@
1
+ %dl{style: "clear: both; overflow: hidden;"}
2
+ - (@resource_class.accessible_attributes - [""]).each do |attr|
3
+ %dt{style: "clear: both; float: left; width: 100px;"}
4
+ %label= attr
5
+ %dd{style: "float: left"}
6
+ = f.text_field attr
7
+ = f.submit "Add"
@@ -0,0 +1 @@
1
+ = render partial: :form
@@ -0,0 +1,12 @@
1
+ %h1= @resource_name.camelize
2
+ %table
3
+ %thead
4
+ %tr
5
+ - (@resource_class.accessible_attributes - [""]).each do |attr|
6
+ %th= attr
7
+ %tbody
8
+ - @resources.each do |resource|
9
+ %tr
10
+ - (@resource_class.accessible_attributes - [""]).each do |attr|
11
+ %td= link_to resource.send(attr), [:admin, resource]
12
+ = link_to 'New', [:new, :admin, @resource_name]
@@ -0,0 +1,2 @@
1
+ = form_for @resource, url: [:admin, @resource] do |f|
2
+ = render partial: 'form', locals: { f: f }
@@ -0,0 +1,10 @@
1
+ %html
2
+ %head
3
+ %body
4
+ #menu
5
+ %ul
6
+ - Dir.glob( 'app/models/*' ).each do |model|
7
+ - model_name = File.basename(model).gsub( /^(.+).rb/, '\1').pluralize
8
+ %li= link_to model_name, [:admin, model_name]
9
+ .container
10
+ = yield
@@ -1,4 +1,4 @@
1
- require 'admin_space/route.rb'
1
+ require 'admin_space/route'
2
2
  require 'rails/engine'
3
3
  require 'admin_space/version'
4
4
 
@@ -5,8 +5,6 @@ module ActionDispatch::Routing
5
5
  with_options controller: :base do |admin|
6
6
  yield admin
7
7
  end
8
- # match ':type/:id', controller: :base, action: :show, constraints: { :id => /\d/ }
9
- # match ':type/(:action/(:id(.:format)))', controller: :base
10
8
 
11
9
  # List all model and build routes
12
10
  models = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AdminSpace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,23 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2012-11-19 00:00:00.000000000 Z
13
- dependencies: []
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: haml
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  description: AdminSpace handle admin namespace for you
15
31
  email:
16
32
  - thomas@lauro.fr
@@ -20,15 +36,14 @@ extra_rdoc_files: []
20
36
  files:
21
37
  - app/controllers/admin_space/base.rb
22
38
  - app/controllers/admin_space/base_controller.rb
23
- - app/views/admin_space/base/_form.html.erb
24
- - app/views/admin_space/base/edit.html.erb
25
- - app/views/admin_space/base/index.html.erb
26
- - app/views/admin_space/base/new.html.erb
27
- - app/views/admin_space/base/show.html.erb
28
- - app/views/layouts/admin_space.html.erb
39
+ - app/views/admin_space/base/_form.html.haml
40
+ - app/views/admin_space/base/edit.html.haml
41
+ - app/views/admin_space/base/index.html.haml
42
+ - app/views/admin_space/base/new.html.haml
43
+ - app/views/admin_space/base/show.html.haml
44
+ - app/views/layouts/admin_space.html.haml
29
45
  - lib/admin_space/route.rb
30
- - lib/admin_space/version.rb
31
- - lib/admin_space.rb
46
+ - lib/AdminSpace.rb
32
47
  - Gemfile
33
48
  - LICENSE.txt
34
49
  - README.md
@@ -1,9 +0,0 @@
1
- <dl style="clear: both; overflow: hidden;">
2
- <% (@resource_class.accessible_attributes - [""]).each do |attr| %>
3
- <dt style="clear: both; float: left; width: 100px;"><label><%= attr %></label></dt>
4
- <dd style="float: left">
5
- <%= f.text_field attr %>
6
- </dd>
7
- <% end %>
8
- </dl>
9
- <input type="submit" value="Add"/>
@@ -1 +0,0 @@
1
- <%= render partial: :form %>
@@ -1,20 +0,0 @@
1
- <h1><%= @resource_name.camelize %></h1>
2
- <table>
3
- <thead>
4
- <tr>
5
- <% (@resource_class.accessible_attributes - [""]).each do |attr| %>
6
- <th><%= attr %></th>
7
- <% end %>
8
- </tr>
9
- </thead>
10
- <tbody>
11
- <% @resources.each do |resource| %>
12
- <tr>
13
- <% (@resource_class.accessible_attributes - [""]).each do |attr| %>
14
- <td><%= link_to resource.send(attr), [:admin, resource] %></td>
15
- <% end %>
16
- </tr>
17
- <% end %>
18
- </tbody>
19
- </table>
20
- <a href="<%= new_admin_user_path %>">New</a>
@@ -1,3 +0,0 @@
1
- <%= form_for @resource, url: [:admin, @resource] do |f| %>
2
- <%= render partial: 'form', locals: { f: f } %>
3
- <% end %>
@@ -1,17 +0,0 @@
1
- <html>
2
- <head>
3
- </head>
4
- <body>
5
- <div id="menu">
6
- <ul>
7
- <% Dir.glob( 'app/models/*' ).each do |model| %>
8
- <% model_name = File.basename(model).gsub( /^(.+).rb/, '\1').pluralize %>
9
- <li><%= link_to model_name, [:admin, model_name] %></li>
10
- <% end %>
11
- </ul>
12
- </div>
13
- <div class="container">
14
- <%= yield %>
15
- </div>
16
- </body>
17
- </html>
@@ -1,3 +0,0 @@
1
- module AdminSpace
2
- VERSION = "0.0.1"
3
- end