adva 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/admin/users_controller.rb +1 -5
- data/app/controllers/base_controller.rb +5 -1
- data/app/helpers/admin/base_helper.rb +0 -44
- data/lib/adva/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7551b32c7b09d3b8d8fb27a688ab26de8181b18b9eef24e222414458aa89b4dd
|
4
|
+
data.tar.gz: 5cefaf35f1c471072301d1d468d3f15a95dd0e8346ab1f0c0fa0bc8d0b0fd7bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42b3bf7c35ab19fb5e9984ef2832f4ba09fa4a5144297bf13ec3f458538c4058163414ef660e3992e670be08371d3b453ee7a9b214307563a7847f0f0e713bb7
|
7
|
+
data.tar.gz: 027cf9c46de27d5c1bb124349c2f0f7055f8bd514a652dad1e1c63377c119b4ca4714cd805078c9fa28298e8e0333852ae0961ec8d7c825df078c591120d1127
|
@@ -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
|
@@ -28,7 +28,11 @@ class BaseController < ApplicationController
|
|
28
28
|
|
29
29
|
def set_section
|
30
30
|
@section ||= begin
|
31
|
-
|
31
|
+
if params.key?(:section_permalink)
|
32
|
+
sections.find_by_permalink!(params[:section_permalink])
|
33
|
+
else
|
34
|
+
sections.first
|
35
|
+
end
|
32
36
|
end
|
33
37
|
raise ActiveRecord::RecordNotFound unless @section.published?(true) || current_user.admin?
|
34
38
|
@section
|
@@ -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')
|
data/lib/adva/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-06 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.
|
1173
|
+
rubygems_version: 3.1.6
|
1174
1174
|
signing_key:
|
1175
1175
|
specification_version: 4
|
1176
1176
|
summary: cutting edge cms, blog, wiki, forum
|