roda-kabk 1.0.0 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5508b1dac33bf7629b9c147a7f1798a67e78280862aaacc77fa6114944df277
4
- data.tar.gz: 459908e88eb476e96592aa97f8832c53c5bbcd01b446ace3e977b6aca14c1bea
3
+ metadata.gz: f7f7945ce2a5625326dd3c9057bca23fd64e6c2c8de06de37217f6fcd3842b47
4
+ data.tar.gz: f14bcea41e4fb4c70d044ef515788e9f629cc4fbd7b396168de8fb7521073b05
5
5
  SHA512:
6
- metadata.gz: e3be59177e76c02daad67d4d00c1c6b6c6effd42ad0acee508e1b75b85516760552f0e1839c47e9d9eccc4bec16c6f2f171619f14c533b5dfc4afa001f1302dc
7
- data.tar.gz: 1f322e901a43c63bb5ceaec3ebb6314bed76c3384a951e144b79ddf68c7b6b13c189768f03f57d516da856d3bc9680f7a56923dc9e62b248264b6bc617d7d587
6
+ metadata.gz: 4b1ffc0544294cefec2f2b5e59c549f8172770dbf23fff16270cd50a8de08ef470b431adab577af0dcdd06e3adc6fc29568e86433e53d1a094194a0e26136f7f
7
+ data.tar.gz: 963655c33496a3a1e7bb3ff2c9706df770aeebdf7b266da803fdd93c2d952d90cef3e2486d3beb0cacd88fc535115fce2b1c26a3832b15b21d0f1d19dd608000
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roda-kabk (0.2.0)
5
- kabk (~> 0.2.0)
4
+ roda-kabk (1.0.2)
5
+ kabk (~> 1.0)
6
6
  roda (~> 3.0)
7
7
 
8
8
  GEM
@@ -11,7 +11,7 @@ GEM
11
11
  bigdecimal (4.1.2)
12
12
  concurrent-ruby (1.3.8)
13
13
  diff-lcs (1.6.2)
14
- kabk (0.2.0)
14
+ kabk (1.0.0)
15
15
  concurrent-ruby (~> 1.1)
16
16
  sequel (~> 5.0)
17
17
  logger (1.7.0)
@@ -58,7 +58,7 @@ CHECKSUMS
58
58
  bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
59
59
  concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
60
60
  diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
61
- kabk (0.2.0) sha256=96b8cbea6b28d8ef0e5b9b4d935851833a617d87f14c7b0c39bc50142bf78118
61
+ kabk (1.0.0)
62
62
  logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
63
63
  nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1
64
64
  puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb
@@ -66,7 +66,7 @@ CHECKSUMS
66
66
  rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463
67
67
  rackup (2.3.1) sha256=6c79c26753778e90983761d677a48937ee3192b3ffef6bc963c0950f94688868
68
68
  roda (3.106.0) sha256=1a1cfb13c6690db158a3929e9c9ece88e697fb23b05baae63f07b0773e3bbade
69
- roda-kabk (0.2.0)
69
+ roda-kabk (1.0.2)
70
70
  rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
71
71
  rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
72
72
  rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
data/README.md CHANGED
@@ -107,29 +107,30 @@ class App < Roda
107
107
  plugin :sessions, secret: ENV.fetch("SESSION_SECRET", "super_secret_key_that_is_long_enough_for_session")
108
108
  plugin :json
109
109
  plugin :kabk,
110
- system_config: {
111
- title: { en: "Admin Dashboard", fa: "پنل مدیریت" },
112
- default_locale: "en",
113
- supported_locales: ["en", "fa"],
114
- direction: "ltr",
115
- show_demo_credentials: false,
116
- endpoints: {
117
- upload: "/admin/api/uploads"
118
- },
119
- auth: {
120
- strategy: "session",
121
- sso_redirect_url: nil,
122
- login_url: "/admin/api/auth/login",
123
- me_url: "/admin/api/auth/me",
124
- logout_url: "/admin/api/auth/logout",
125
- refresh_url: "/admin/api/auth/refresh",
126
- show_demo_credentials: false,
127
- login_fields: [
128
- { name: "username", label: { en: "Username", fa: "نام کاربری" }, type: "text", required: true },
129
- { name: "password", label: { en: "Password", fa: "کلمه عبور" }, type: "password", required: true }
130
- ]
131
- }
132
- },
110
+ system_config: {
111
+ title: { en: "Admin Dashboard", fa: "پنل مدیریت" },
112
+ subtitle: { en: "Content & Data Management System", fa: "سامانه مدیریت محتوا و داده‌ها" },
113
+ default_locale: "en",
114
+ supported_locales: ["en", "fa"],
115
+ direction: "ltr",
116
+ endpoints: {
117
+ upload: "/admin/api/uploads"
118
+ },
119
+ auth: {
120
+ strategy: "session",
121
+ sso_redirect_url: nil,
122
+ login_url: "/admin/api/auth/login",
123
+ me_url: "/admin/api/auth/me",
124
+ logout_url: "/admin/api/auth/logout",
125
+ refresh_url: "/admin/api/auth/refresh",
126
+ show_demo_credentials: false,
127
+ subtitle: { en: "Sign in to Admin Dashboard", fa: "ورود به پنل مدیریت" },
128
+ login_fields: [
129
+ { name: "username", label: { en: "Username", fa: "نام کاربری" }, type: "text", required: true },
130
+ { name: "password", label: { en: "Password", fa: "کلمه عبور" }, type: "password", required: true }
131
+ ]
132
+ }
133
+ },
133
134
  upload_handler: ->(file_param, req) {
134
135
  {
135
136
  url: "/uploads/#{file_param[:filename]}",
data/TUTORIAL.md CHANGED
@@ -22,11 +22,15 @@ class AdminApp < Roda
22
22
  plugin :kabk,
23
23
  system_config: {
24
24
  title: { en: "Simurgh Panel", fa: "پنل مدیریت سیمرغ" },
25
+ subtitle: { en: "Content & Data Management System", fa: "سامانه مدیریت محتوا و داده‌ها" },
25
26
  logo_url: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=100&h=100&fit=crop&crop=faces",
26
27
  default_locale: "en",
27
28
  supported_locales: ["en", "fa"],
28
29
  direction: "ltr",
29
- show_demo_credentials: false,
30
+ auth: {
31
+ show_demo_credentials: false,
32
+ subtitle: { en: "Sign in to Simurgh Admin Panel", fa: "ورود به پنل ادمین سیمرغ" }
33
+ },
30
34
  custom_fonts: [
31
35
  {
32
36
  name: "Inter",
data/examples/app.rb CHANGED
@@ -130,16 +130,17 @@ class App < Roda
130
130
  plugin :kabk,
131
131
  system_config: {
132
132
  title: { en: "Simurgh Panel", fa: "پنل مدیریت سیمرغ" },
133
+ subtitle: { en: "Content & Data Management System", fa: "سامانه مدیریت محتوا و داده‌ها" },
133
134
  default_locale: "en",
134
135
  supported_locales: ["en", "fa"],
135
136
  direction: "ltr",
136
- show_demo_credentials: false,
137
137
  logo_url: "/simurgh-logo.svg",
138
138
  endpoints: {
139
139
  upload: "/api/admin/uploads"
140
140
  },
141
141
  auth: {
142
142
  show_demo_credentials: false,
143
+ subtitle: { en: "Sign in to Simurgh Admin Panel", fa: "ورود به پنل ادمین سیمرغ" },
143
144
  login_url: "/api/admin/auth/login",
144
145
  logout_url: "/api/admin/auth/logout",
145
146
  me_url: "/api/admin/auth/me"
@@ -55,6 +55,7 @@ module RodaPlugins
55
55
  me_url: "/auth/me",
56
56
  refresh_url: "/auth/refresh",
57
57
  show_demo_credentials: false,
58
+ subtitle: { en: "Sign in to Simurgh Admin Panel", fa: "ورود به پنل ادمین سیمرغ" },
58
59
  login_fields: [
59
60
  {
60
61
  name: "username",
@@ -73,12 +74,15 @@ module RodaPlugins
73
74
  ]
74
75
  }
75
76
  auth = auth_defaults.merge(raw_config[:auth] || {})
77
+ if raw_config.key?(:show_demo_credentials) && (raw_config[:auth].nil? || !raw_config[:auth].key?(:show_demo_credentials))
78
+ auth[:show_demo_credentials] = raw_config[:show_demo_credentials]
79
+ end
76
80
 
77
81
  base_defaults = {
82
+ subtitle: { en: "Content & Data Management System", fa: "سامانه مدیریت محتوا و داده‌ها" },
78
83
  direction: "ltr",
79
84
  default_locale: "en",
80
- supported_locales: ["en", "fa"],
81
- show_demo_credentials: false
85
+ supported_locales: ["en", "fa"]
82
86
  }
83
87
 
84
88
  base_defaults.merge(raw_config).merge(endpoints: endpoints, auth: auth)
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Roda
4
+ module RodaPlugins
5
+ module Kabk
6
+ # Current version of the roda-kabk gem
7
+ VERSION = "1.0.2"
8
+ end
9
+ end
10
+ end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "kabk"
4
+ require_relative "kabk/version"
4
5
  require_relative "kabk/helpers"
5
6
 
6
7
  class Roda