adva 0.1.0 → 0.1.2

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: da23aa37a656e830d04873424caa65522c9fb2e7032894266d0e7573fe6f6054
4
- data.tar.gz: d04fc86b13d83a1bcd83a3b5d89572417b468914e634e4ff3a3359ee6a4fbcf0
3
+ metadata.gz: ee3ba355548f2d435cab4bed75a24bcd57ce604bccb9ce8040895c7cd7071cb1
4
+ data.tar.gz: c97a5d6de8e170695e217513ad3f915d6057c363ac909edd4d99af4d6b7e71a8
5
5
  SHA512:
6
- metadata.gz: 658a74eacd08172e9be90bc4c888d995b055df6e94a2355eb11c9448004dc80b21176e2e37187290f5dab427b157426074e089a1d49105828cd86d93b6e4ffea
7
- data.tar.gz: bcf0e907845beb83f018e3211fc3afe44cf65c82eecd94337a3f5a712f076cee03e43d0a79f70abb5161e48b73070b9674c0043db5137146ad5119ca04833ac1
6
+ metadata.gz: d49f370f2085930f92abce6373b902416ababc8d903c1fa019151363d4575d2258bf98413c171e8f5c5b915f32974ae17c7a59683ebfde49c2a39d03ea2df792
7
+ data.tar.gz: ed9b3eba97128897b5ed432e727fca912a02fc2e0b2ac60ff45b4f327a1c41275a50dbeec73bd5f54fb602ef1a068446fc1b23cceec38f7f4029d07a7fb98430
data/.gitignore CHANGED
@@ -17,5 +17,6 @@ public/themes
17
17
  vendor/engines/adva_rbac/spec/db/*.sqlite3
18
18
  vendor/engines/adva_rbac/spec/log/*
19
19
  .DS_Store
20
+ pkg
20
21
  *~
21
- /nbproject
22
+ /nbproject
@@ -1,9 +1,9 @@
1
1
  class Admin::UsersController < Admin::BaseController
2
- before_action :set_users, :only => [:index]
3
2
  before_action :set_user, :only => [:show, :edit, :update, :destroy]
4
3
  before_action :authorize_access
5
4
 
6
5
  def index
6
+ @users = User.where(admin: true).to_a + @site.users.to_a
7
7
  end
8
8
 
9
9
  def show
@@ -59,10 +59,6 @@ class Admin::UsersController < Admin::BaseController
59
59
  @menu = Menus::Admin::Users.new
60
60
  end
61
61
 
62
- def set_users
63
- @users = @site.users
64
- end
65
-
66
62
  def set_user
67
63
  @user = User.find(params[:id])
68
64
  end
@@ -1,48 +1,4 @@
1
1
  module Admin::BaseHelper
2
- def self.define_shallow_resource_helpers options
3
- from = options.delete(:from)
4
- to = options.delete(:to)
5
-
6
- from_namespace = from[0..-2].collect(&:to_s).join("_")
7
- to_namespace = to[0..-2].collect(&:to_s).join("_")
8
- resource = from[-1].to_s
9
-
10
- def self.define_path_and_url_methods options
11
- from = options.delete(:from)
12
- to = options.delete(:to)
13
-
14
- %w(path url).each do |suffix|
15
- eval "def #{from}_#{suffix} *args; #{to}_#{suffix} *args; end"
16
- end
17
- end
18
-
19
- # index
20
- define_path_and_url_methods \
21
- :from => [from_namespace, resource.pluralize].join("_"),
22
- :to => [to_namespace, resource.pluralize].join("_")
23
-
24
- # show
25
- define_path_and_url_methods \
26
- :from => [from_namespace, resource].join("_"),
27
- :to => [to_namespace, resource].join("_")
28
-
29
- # new
30
- define_path_and_url_methods \
31
- :from => [:new, from_namespace, resource].join("_"),
32
- :to => [:new, to_namespace, resource].join("_")
33
-
34
- # edit
35
- define_path_and_url_methods \
36
- :from => [:edit, from_namespace, resource].join("_"),
37
- :to => [:edit, to_namespace, resource].join("_")
38
- end
39
-
40
- define_shallow_resource_helpers :from => [:admin, :category], :to => [:admin, :section, :category]
41
- define_shallow_resource_helpers :from => [:admin, :content], :to => [:admin, :section, :content]
42
- define_shallow_resource_helpers :from => [:admin, :article], :to => [:admin, :section, :article]
43
- define_shallow_resource_helpers :from => [:admin, :link], :to => [:admin, :section, :link]
44
-
45
-
46
2
  def save_or_cancel_links(builder, options = {})
47
3
  save_text = options.delete(:save_text) || t(:'adva.common.save')
48
4
  or_text = options.delete(:or_text) || t(:'adva.common.connector.or')
@@ -1,19 +1,19 @@
1
1
  <h2><%= t(:'adva.categories.titles.new') %></h2>
2
-
2
+
3
3
  <%= form_for [:admin, @section, @category] do |f| %>
4
- <% f.field_set do %>
4
+ <fieldset>
5
5
  <div class="col">
6
- <%= f.text_field :title, :label => true, :hint => :'adva.hints.categories' %>
7
- </col>
8
-
9
- <% unless @section.categories.size < 2 %>
6
+ <%= f.text_field :title, :label => true, :hint => :'adva.hints.categories' %>
7
+ </div>
8
+
9
+ <% unless @section.categories.size < 2 %>
10
10
  <div class="col">
11
- <%= f.select :parent_id, @section.categories.collect {|p| [p.title, p.id] unless p == @category }.compact, { :include_blank => true, :label => true } %>
12
- <span class="hint" for="category_parent_id"><%= t :'adva.categories.hints.parent_setting' %></span>
13
- </col>
14
- <% end %>
15
- <% end %>
11
+ <%= f.select :parent_id, @section.categories.collect {|p| [p.title, p.id] unless p == @category }.compact, { :include_blank => true, :label => true } %>
12
+ <span class="hint" for="category_parent_id"><%= t :'adva.categories.hints.parent_setting' %></span>
13
+ </div>
14
+ <% end %>
15
+ </fieldset>
16
16
 
17
- <% save_or_cancel_links(f, :cancel_url => admin_categories_path) %>
17
+ <% save_or_cancel_links(f, cancel_url: [:admin, @section, :categories]) %>
18
18
  <% end %>
19
19
 
@@ -150,7 +150,7 @@ module Menus
150
150
  menu :left, :class => 'left', :type => Sections::Content
151
151
  menu :actions, :class => 'actions' do
152
152
  activates object.parent.find(:categories)
153
- item :new, :action => :new, :resource => [@section, :category]
153
+ item :new, content: link_to("New", [:new, :admin, @section, :category])
154
154
  if @category && !@category.new_record?
155
155
  item :edit, :action => :edit, :resource => @category
156
156
  item :delete, :content => link_to("Delete", [:admin, @section, @category], :method => :delete)
data/lib/adva/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Adva
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adva
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-01 00:00:00.000000000 Z
11
+ date: 2022-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: will_paginate
@@ -1170,7 +1170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1170
1170
  - !ruby/object:Gem::Version
1171
1171
  version: '0'
1172
1172
  requirements: []
1173
- rubygems_version: 3.2.3
1173
+ rubygems_version: 3.2.32
1174
1174
  signing_key:
1175
1175
  specification_version: 4
1176
1176
  summary: cutting edge cms, blog, wiki, forum