AdminSpace 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,46 @@
1
+ body
2
+ margin: 0
3
+ padding: 0
4
+ font-family: Helvetica, Arial
5
+
6
+ #menu
7
+ margin-botton: 40px
8
+ background-color: #333
9
+ a
10
+ color: #eee
11
+ text-decoration: none
12
+ ul
13
+ display: block
14
+ overflow: hidden
15
+ li
16
+ float: left
17
+ list-style: none
18
+ height: 30px
19
+ padding-top: 7px
20
+ padding-left: 7px
21
+ padding-right: 7px
22
+ font-weight: bold
23
+ li.active
24
+ background: #444
25
+
26
+ .container
27
+ padding-left: 30px
28
+ dl
29
+ overflow: hidden
30
+ clear: both
31
+ dt
32
+ float: left
33
+ clear: both
34
+ width: 100px
35
+ dd
36
+ float: left
37
+
38
+ table
39
+ border-spacing: 0
40
+ border-collapse: collapse
41
+ tr
42
+ th, td
43
+ padding: 0
44
+ border-bottom: 1px solid gray
45
+ line-height: 18px
46
+ padding: 8px
@@ -19,7 +19,7 @@ module AdminSpace
19
19
  end
20
20
 
21
21
  def update
22
- @resource.update_attributes params[@model]
22
+ @resource.update_attributes params[resource_class.to_s.downcase]
23
23
  redirect_to [:admin, @resource]
24
24
  end
25
25
 
@@ -1,7 +1,6 @@
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"
1
+ %dl
2
+ - (@resource_class.accessible_attributes - [""]).each do |attr|
3
+ %dt
4
+ %label= attr
5
+ %dd
6
+ = f.text_field attr
@@ -1 +1,5 @@
1
- = render partial: :form
1
+ = form_for @resource, url: [:admin, @resource] do |f|
2
+ = render partial: 'form', locals: { f: f }
3
+ .form_actions
4
+ = link_to 'Cancel', [:admin, @resource_class]
5
+ = f.submit "Save"
@@ -1,4 +1,6 @@
1
- %h1= @resource_name.camelize
1
+ %h1
2
+ = @resource_name.camelize
3
+ = link_to 'Add new', [:new, :admin, @resource_name]
2
4
  %table
3
5
  %thead
4
6
  %tr
@@ -8,5 +10,4 @@
8
10
  - @resources.each do |resource|
9
11
  %tr
10
12
  - (@resource_class.accessible_attributes - [""]).each do |attr|
11
- %td= link_to resource.send(attr), [:admin, resource]
12
- = link_to 'New', [:new, :admin, @resource_name]
13
+ %td= link_to resource.send(attr), [:admin, resource]
@@ -1,2 +1,8 @@
1
+ %h1
2
+ New
3
+ = @resource_name
1
4
  = form_for @resource, url: [:admin, @resource] do |f|
2
- = render partial: 'form', locals: { f: f }
5
+ = render partial: 'form', locals: { f: f }
6
+ .form_actions
7
+ = link_to 'Cancel', [:admin, @resource_class]
8
+ = f.submit "Add"
@@ -0,0 +1,8 @@
1
+ %h1= @resource_name.camelize
2
+ %dl
3
+ - (@resource_class.accessible_attributes - [""]).each do |attr|
4
+ %dt= attr
5
+ %dd= eval("@resource.#{attr}")
6
+ .actions
7
+ = link_to 'Edit', [:edit, :admin, @resource]
8
+ = link_to 'Delete', [:admin, @resource], method: :delete, confirm: 'Are you sure?'
@@ -1,10 +1,11 @@
1
1
  %html
2
2
  %head
3
+ = stylesheet_link_tag 'admin_space'
3
4
  %body
4
5
  #menu
5
6
  %ul
6
7
  - Dir.glob( 'app/models/*' ).each do |model|
7
8
  - model_name = File.basename(model).gsub( /^(.+).rb/, '\1').pluralize
8
- %li= link_to model_name, [:admin, model_name]
9
+ %li{class: model_name.singularize == @resource_name ? 'active' : ''}= link_to model_name, [:admin, model_name]
9
10
  .container
10
11
  = yield
@@ -1,6 +1,5 @@
1
1
  require 'admin_space/route'
2
2
  require 'rails/engine'
3
- require 'admin_space/version'
4
3
 
5
4
  module AdminSpace
6
5
  def self.setup
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.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: sass-rails
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
30
46
  description: AdminSpace handle admin namespace for you
31
47
  email:
32
48
  - thomas@lauro.fr
@@ -34,6 +50,7 @@ executables: []
34
50
  extensions: []
35
51
  extra_rdoc_files: []
36
52
  files:
53
+ - app/assets/stylesheets/admin_space.css.sass
37
54
  - app/controllers/admin_space/base.rb
38
55
  - app/controllers/admin_space/base_controller.rb
39
56
  - app/views/admin_space/base/_form.html.haml