optimacms 0.1.34 → 0.1.36

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
  SHA1:
3
- metadata.gz: af38a4fa9a81bdada06d16f387634f6909d3fe0e
4
- data.tar.gz: c89c6bbb8a8437d4a4462078f9025acf6c57a48b
3
+ metadata.gz: 38988f238025c66a2d5ce6aa29d9aa44fa8c12f6
4
+ data.tar.gz: 2d52afa77828c9cf7eb7e479fed6ede2805dd630
5
5
  SHA512:
6
- metadata.gz: 9453f80617abf58a68fb85d1ef11dc62d10db2345c45e2687460b4844b9f292fe6b0c3b8a50773b6d285616e0acaa15bcd2c80d798c6be615254518e2bf5ccff
7
- data.tar.gz: 70f282bca6e3df8361a0532c9d4e8601ba8f1a09ebd9445dadaa45acd58f952f9eb7427b0a095d76f290f7e0d45a6365a16cfe0e1602f3ab59edf547431c2817
6
+ metadata.gz: 5807d02977790f7f5b462b7502b11dfffaea57f98c75d1e9fbbe684114af78e70a5e6618f04489dfdd12747221a12d9cd3a4aab9a6ed28a15c36bae5cc217237
7
+ data.tar.gz: 3a58168544a0d1d9f2f940aab414d93f2d56ff7dcc024d11d79cca73f07d539ea10ee8e4d85fbf1fe9350909b22c2071fdadac7d498fec31fbf94b6d1f719996
@@ -13,9 +13,6 @@ module Optimacms
13
13
 
14
14
 
15
15
  #### modal
16
-
17
-
18
-
19
16
  def set_layout_modal_old
20
17
  if @modal==1
21
18
  self.class.layout false
@@ -24,6 +21,8 @@ module Optimacms
24
21
  end
25
22
 
26
23
 
24
+ ### devise
25
+
27
26
  def after_sign_in_path_for(resource)
28
27
  if resource.is_a?(CmsAdminUser)
29
28
  dashboard_path
@@ -34,6 +33,13 @@ module Optimacms
34
33
  end
35
34
 
36
35
 
36
+ ### redirects
37
+ def redirect_to_res(res)
38
+ v_res = res ? 1 : 0
39
+ redirect_to res_common_path(res: v_res)
40
+ end
41
+
37
42
  end
43
+
38
44
  end
39
45
  end
@@ -0,0 +1,19 @@
1
+ module Optimacms
2
+ class Admin::AppSysController < Admin::AdminBaseController
3
+
4
+ def index
5
+
6
+ end
7
+
8
+
9
+
10
+
11
+ def restart
12
+ @res = Optimacms::Sys::AppFunctions.restart
13
+
14
+
15
+ redirect_to_res @res
16
+ end
17
+ end
18
+ end
19
+
@@ -0,0 +1,14 @@
1
+ class Optimacms::Admin::CommonController < Optimacms::Admin::AdminBaseController
2
+
3
+ before_filter :init_data
4
+
5
+ def init_data
6
+ @res = params[:res].to_i
7
+ end
8
+
9
+
10
+ def res
11
+
12
+ end
13
+ end
14
+
@@ -8,7 +8,7 @@ module Optimacms
8
8
 
9
9
 
10
10
  def index
11
- @items = model.by_filter(@filter)
11
+ @items = model.includes(:template).by_filter(@filter)
12
12
  #@items = model.where(@filter.where).order(@filter.order_string).page(@filter.page)
13
13
 
14
14
  #
@@ -0,0 +1,2 @@
1
+ %h2 Restart app
2
+ =link_to 'Restart', restart_app_sys_path, :class=>'btn btn-primary btn-sm'
@@ -0,0 +1,9 @@
1
+ %h1 Result
2
+
3
+ - if @res==1
4
+ .alert.alert-success
5
+ Operation done successfully
6
+ - else
7
+ .alert.alert-danger
8
+ Error occurred
9
+
@@ -44,6 +44,7 @@
44
44
  = link_to 'Title', '#'
45
45
  %th Name
46
46
  %th URL
47
+ %th Template
47
48
  %th Commands
48
49
 
49
50
  - @items.each do |item|
@@ -59,6 +60,15 @@
59
60
  =item.name
60
61
  %td
61
62
  =item.url
63
+ %td
64
+ - if item.template
65
+ =link_to edit_template_path(item.template) do
66
+ =item.template.title
67
+ %br
68
+ =item.template.basepath
69
+ - else
70
+ N/A
71
+
62
72
  %td
63
73
  =link_to 'Edit', (item.is_folder? ? editfolder_page_path(item) : edit_page_path(item))
64
74
  =link_to 'Delete', page_path(item), :method => :delete, data: { confirm: 'Are you sure?' }
@@ -14,7 +14,7 @@
14
14
  %li=link_to 'Pages', pages_path
15
15
  %li=link_to 'Templates', templates_path
16
16
  -#%li=link_to 'Layouts', layouts_path
17
- %li=link_to 'Data Blocks', 'datablocks_path'
17
+ %li=link_to 'Data Blocks - NOT WORK', 'datablocks_path'
18
18
  %li=link_to 'Media', mediafiles_path
19
19
 
20
20
  %li
@@ -26,3 +26,16 @@
26
26
  %ul#submenu2.submenu.collapse
27
27
  %li=link_to 'News', "#"
28
28
  %li=link_to 'Categories', "#"
29
+
30
+
31
+ %li
32
+ =link_to '#submenu_system', :"data-toggle"=>"collapse", :"aria-expanded"=>"false", :"aria-controls"=>"submenu_system" do
33
+ %span System
34
+ %b.arrow.fa.fa-angle-down.for-expanded
35
+ %b.arrow.fa.fa-angle-left.for-collapsed
36
+
37
+ %ul#submenu_system.submenu_system.collapse
38
+ %li=link_to 'App', app_sys_path
39
+ %li=link_to 'Maintenance', "#"
40
+ %li=link_to 'Backups', "#"
41
+ %li=link_to 'Info', "#"
data/config/routes.rb CHANGED
@@ -6,6 +6,8 @@ Optimacms::Engine.routes.draw do
6
6
 
7
7
  get '/' => 'dashboard#index', as: :dashboard
8
8
 
9
+ get '/res' => 'common#res', as: :res_common
10
+
9
11
  resources :pages do
10
12
  collection do
11
13
  post 'search'
@@ -46,6 +48,13 @@ Optimacms::Engine.routes.draw do
46
48
  match '/media_elfinder' => 'mediafiles#elfinder', via: [:get, :post]
47
49
 
48
50
 
51
+ resources :app_sys do
52
+ collection do
53
+ get :restart
54
+ end
55
+
56
+ end
57
+
49
58
 
50
59
  end
51
60
 
@@ -0,0 +1,12 @@
1
+ module Optimacms
2
+ module Sys
3
+ class AppFunctions
4
+ def self.restart
5
+
6
+ system("touch tmp/restart.txt")
7
+
8
+ true
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Optimacms
2
- VERSION = "0.1.34"
2
+ VERSION = "0.1.36"
3
3
  end