optimacms 0.1.28 → 0.1.31
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 +4 -4
- data/app/controllers/optimacms/admin/admin_base_controller.rb +3 -1
- data/app/controllers/optimacms/admin/mediafiles_controller.rb +42 -0
- data/app/controllers/optimacms/admin/templates_controller.rb +10 -5
- data/app/controllers/optimacms/elfinder_controller.rb +1 -1
- data/app/views/optimacms/admin/layouts/application.html.haml +17 -0
- data/app/views/optimacms/admin/layouts/basic.html.haml +20 -0
- data/app/views/optimacms/admin/layouts/blank.html.haml +1 -0
- data/app/views/optimacms/admin/layouts/main.html.haml +5 -32
- data/app/views/optimacms/admin/layouts/modal.html.haml +4 -0
- data/app/views/optimacms/admin/mediafiles/index.html.erb +55 -0
- data/app/views/optimacms/admin/shared/_leftmenu.html.haml +8 -12
- data/config/routes.rb +6 -0
- data/lib/optimacms/page_services/page_data.rb +1 -1
- data/lib/optimacms/version.rb +1 -1
- data/lib/optimacms.rb +4 -0
- data/test/dummy/app/views/home/index.html.haml +1 -0
- data/test/dummy/app/views/pages/text1.html +2 -0
- data/test/dummy/config/environments/development.rb +2 -0
- data/test/dummy/config/environments/production.rb +5 -1
- data/test/dummy/log/development.log +7339 -0
- data/test/dummy/public/img/cat_red.jpg +0 -0
- data/test/dummy/public/img/funny-cats-and-kittens-wallpapers-12.jpg +0 -0
- metadata +14 -4
- data/test/dummy/tmp/pids/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 353479f1ae94c50832c1965cc45701d6f03d5d19
|
4
|
+
data.tar.gz: 05b974c6e72a258fc7631f420c5cdfbe62a192a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0bcb2730876ad11509ec858bcb51e81b4bd21a591618a93c1f76b5976bd6c04f61550319f408cc29a2fa54e61a9a1f99bf77c4205259dc93284583ca4384f2
|
7
|
+
data.tar.gz: 938403ff48dd802ea3fde5c0f472e93ae13da27a3b97ad9b8aa9a4b95f8373d032896105235ff5d8a73ed5ff04e62f2cf38ada8b75cd93b88c323d60ddb7b3c4
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Optimacms
|
2
|
+
class Admin::MediafilesController < Admin::AdminBaseController
|
3
|
+
skip_before_filter :verify_authenticity_token, :only => ['elfinder']
|
4
|
+
|
5
|
+
#layout 'optimacms/admin/layouts/blank'
|
6
|
+
layout 'optimacms/admin/layouts/basic'
|
7
|
+
#layout 'optimacms/admin/layouts/elfinder'
|
8
|
+
|
9
|
+
def index
|
10
|
+
#render :layout => false
|
11
|
+
end
|
12
|
+
|
13
|
+
def elfinder
|
14
|
+
dirpath = Optimacms.files_dir_path
|
15
|
+
rootpath = File.join(Rails.public_path, dirpath)
|
16
|
+
rooturl = '/'+dirpath
|
17
|
+
|
18
|
+
h, r = ElFinder::Connector.new(
|
19
|
+
:root => rootpath,
|
20
|
+
:url => rooturl,
|
21
|
+
:perms => {
|
22
|
+
#/^(Welcome|README)$/ => {:read => true, :write => false, :rm => false},
|
23
|
+
'.' => {:read => true, :write => true, :rm => true}, # '.' is the proper way to specify the home/root directory.
|
24
|
+
#/^test$/ => {:read => true, :write => true, :rm => false},
|
25
|
+
#'logo.png' => {:read => true},
|
26
|
+
#/\.png$/ => {:read => false} # This will cause 'logo.png' to be unreadable.
|
27
|
+
# Permissions err on the safe side. Once false, always false.
|
28
|
+
},
|
29
|
+
:thumbs => true
|
30
|
+
).run(params)
|
31
|
+
|
32
|
+
headers.merge!(h)
|
33
|
+
|
34
|
+
if r.empty?
|
35
|
+
(render :nothing => true) and return
|
36
|
+
end
|
37
|
+
|
38
|
+
render :json => r, :layout => false
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
@@ -1,21 +1,26 @@
|
|
1
|
-
#require_dependency "../../../../lib/optimacms/filters/form_filter.rb"
|
2
|
-
|
3
1
|
module Optimacms
|
4
2
|
class Admin::TemplatesController < Admin::AdminBaseController
|
5
3
|
|
6
4
|
before_action :set_item, only: [:show, :edit, :update, :destroy]
|
7
5
|
before_action :init_common
|
8
6
|
before_action :init_data_form, only: [:new, :edit, :newfolder, :editfolder, :newattach]
|
9
|
-
#before_action :
|
10
|
-
|
11
|
-
before_action :set_layout_modal
|
7
|
+
#before_action :set_layout_modal
|
12
8
|
|
13
9
|
|
14
10
|
def init_common
|
15
11
|
@modal = (params[:modal] || 0).to_i
|
12
|
+
set_layout_modal(@modal)
|
16
13
|
|
17
14
|
end
|
18
15
|
|
16
|
+
def set_layout_modal(modal)
|
17
|
+
if modal.to_i==1
|
18
|
+
#self.class.layout false
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
|
19
24
|
def index
|
20
25
|
#@filter.clear_data
|
21
26
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
!!! Strict
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%title= h(yield(:title) || "Admin Area" )
|
5
|
+
= yield(:head)
|
6
|
+
|
7
|
+
= csrf_meta_tag
|
8
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
9
|
+
|
10
|
+
= stylesheet_link_tag "optimacms/admin", media: "all"
|
11
|
+
= stylesheet_link_tag "optimacms/admin_tpl", media: "all"
|
12
|
+
|
13
|
+
= javascript_include_tag "optimacms/application"
|
14
|
+
= javascript_include_tag "optimacms/admin"
|
15
|
+
|
16
|
+
%body.no-skin
|
17
|
+
= yield :main
|
@@ -0,0 +1,20 @@
|
|
1
|
+
- content_for :main do
|
2
|
+
#wrapper
|
3
|
+
= render 'optimacms/admin/shared/top'
|
4
|
+
|
5
|
+
.main-container
|
6
|
+
#sidebar.sidebar
|
7
|
+
= render 'optimacms/admin/shared/leftmenu'
|
8
|
+
|
9
|
+
.main-content
|
10
|
+
.main-content-inner
|
11
|
+
= render 'optimacms/admin/shared/breadcrumbs'
|
12
|
+
= render 'optimacms/admin/shared/flash'
|
13
|
+
|
14
|
+
.page-content
|
15
|
+
= yield
|
16
|
+
|
17
|
+
|
18
|
+
= render 'optimacms/admin/shared/footer'
|
19
|
+
|
20
|
+
= render :template => 'optimacms/admin/layouts/application'
|
@@ -0,0 +1 @@
|
|
1
|
+
=yield
|
@@ -1,33 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
- modal = (@modal || 0).to_i
|
2
|
+
- if modal==1
|
3
|
+
= render :template => 'optimacms/admin/layouts/modal'
|
4
|
+
- else
|
5
|
+
= render :template => 'optimacms/admin/layouts/basic'
|
6
6
|
|
7
|
-
= csrf_meta_tag
|
8
|
-
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
9
|
-
|
10
|
-
= stylesheet_link_tag "optimacms/admin", media: "all"
|
11
|
-
= stylesheet_link_tag "optimacms/admin_tpl", media: "all"
|
12
|
-
|
13
|
-
= javascript_include_tag "optimacms/application"
|
14
|
-
= javascript_include_tag "optimacms/admin"
|
15
|
-
|
16
|
-
%body.no-skin
|
17
|
-
#wrapper
|
18
|
-
= render 'optimacms/admin/shared/top'
|
19
|
-
|
20
|
-
.main-container
|
21
|
-
#sidebar.sidebar
|
22
|
-
= render 'optimacms/admin/shared/leftmenu'
|
23
|
-
|
24
|
-
.main-content
|
25
|
-
.main-content-inner
|
26
|
-
= render 'optimacms/admin/shared/breadcrumbs'
|
27
|
-
= render 'optimacms/admin/shared/flash'
|
28
|
-
|
29
|
-
.page-content
|
30
|
-
= yield
|
31
|
-
|
32
|
-
|
33
|
-
= render 'optimacms/admin/shared/footer'
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>File Manager</title>
|
5
|
+
|
6
|
+
<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/smoothness/jquery-ui.css" />
|
7
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
8
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
|
9
|
+
|
10
|
+
<script type="text/javascript" src="/elfinder/js/elfinder.min.js"></script>
|
11
|
+
<script src="/elfinder/js/proxy/elFinderSupportVer1.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script type="text/javascript" src="/elfinder/js/i18n/elfinder.ru.js"></script>
|
13
|
+
|
14
|
+
<link rel="stylesheet" type="text/css" media="screen" href="/elfinder/css/elfinder.min.css">
|
15
|
+
<link rel="stylesheet" type="text/css" media="screen" href="/elfinder/css/theme.css">
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<div id="elfinder"></div>
|
21
|
+
|
22
|
+
<script type="text/javascript">
|
23
|
+
var FileBrowserDialogue = {
|
24
|
+
init: function() {
|
25
|
+
// Here goes your code for setting your custom things onLoad.
|
26
|
+
},
|
27
|
+
mySubmit: function (URL) {
|
28
|
+
// pass selected file path to TinyMCE
|
29
|
+
parent.tinymce.activeEditor.windowManager.getParams().setUrl(URL);
|
30
|
+
|
31
|
+
// close popup window
|
32
|
+
parent.tinymce.activeEditor.windowManager.close();
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
$().ready(function() {
|
37
|
+
var rails_csrf = {};
|
38
|
+
rails_csrf[$('meta[name=csrf-param]').attr('content')] = $('meta[name=csrf-token]').attr('content');
|
39
|
+
|
40
|
+
var elf = $('#elfinder').elfinder({
|
41
|
+
// set your elFinder options here
|
42
|
+
url: '/cmsadmin/media_elfinder', // connector URL
|
43
|
+
transport : new elFinderSupportVer1(),
|
44
|
+
|
45
|
+
getFileCallback: function(file) { // editor callback
|
46
|
+
// file.url - commandsOptions.getfile.onlyURL = false (default)
|
47
|
+
// file - commandsOptions.getfile.onlyURL = true
|
48
|
+
FileBrowserDialogue.mySubmit(file); // pass selected file path to TinyMCE
|
49
|
+
}
|
50
|
+
}).elfinder('instance');
|
51
|
+
});
|
52
|
+
</script>
|
53
|
+
|
54
|
+
</body>
|
55
|
+
</html>
|
@@ -11,22 +11,18 @@
|
|
11
11
|
%b.arrow.fa.fa-angle-left.for-collapsed
|
12
12
|
|
13
13
|
%ul#submenu1.submenu.collapse.in
|
14
|
-
%li
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
%li
|
19
|
-
=link_to 'Layouts', layouts_path
|
20
|
-
%li
|
21
|
-
=link_to 'Data Blocks', 'datablocks_path'
|
14
|
+
%li=link_to 'Pages', pages_path
|
15
|
+
%li=link_to 'Templates', templates_path
|
16
|
+
-#%li=link_to 'Layouts', layouts_path
|
17
|
+
%li=link_to 'Data Blocks', 'datablocks_path'
|
18
|
+
%li=link_to 'Media', mediafiles_path
|
22
19
|
|
23
20
|
%li
|
24
21
|
=link_to '#submenu2', :"data-toggle"=>"collapse", :"aria-expanded"=>"false", :"aria-controls"=>"submenu2" do
|
25
|
-
%span
|
22
|
+
%span News
|
26
23
|
%b.arrow.fa.fa-angle-down.for-expanded
|
27
24
|
%b.arrow.fa.fa-angle-left.for-collapsed
|
28
25
|
|
29
26
|
%ul#submenu2.submenu.collapse
|
30
|
-
%li=link_to '
|
31
|
-
%li=link_to '
|
32
|
-
%li=link_to 'Templates', "typography.html"
|
27
|
+
%li=link_to 'News', "#"
|
28
|
+
%li=link_to 'Categories', "#"
|
data/config/routes.rb
CHANGED
@@ -41,6 +41,12 @@ Optimacms::Engine.routes.draw do
|
|
41
41
|
|
42
42
|
resources :layouts
|
43
43
|
|
44
|
+
resources :mediafiles, only: [:index]
|
45
|
+
#get '/elfinder_manager', to: 'elfinder#index'
|
46
|
+
match '/media_elfinder' => 'mediafiles#elfinder', via: [:get, :post]
|
47
|
+
|
48
|
+
|
49
|
+
|
44
50
|
end
|
45
51
|
|
46
52
|
# dev
|
data/lib/optimacms/version.rb
CHANGED
data/lib/optimacms.rb
CHANGED
@@ -13,7 +13,9 @@ Rails.application.configure do
|
|
13
13
|
|
14
14
|
# Show full error reports and disable caching.
|
15
15
|
config.consider_all_requests_local = true
|
16
|
+
|
16
17
|
config.action_controller.perform_caching = false
|
18
|
+
config.action_view.cache_template_loading = false
|
17
19
|
|
18
20
|
# Don't care if the mailer can't send.
|
19
21
|
config.action_mailer.raise_delivery_errors = false
|
@@ -12,7 +12,11 @@ Rails.application.configure do
|
|
12
12
|
|
13
13
|
# Full error reports are disabled and caching is turned on.
|
14
14
|
config.consider_all_requests_local = false
|
15
|
-
|
15
|
+
|
16
|
+
# caching
|
17
|
+
config.action_controller.perform_caching = false
|
18
|
+
|
19
|
+
config.action_view.cache_template_loading = false
|
16
20
|
|
17
21
|
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
22
|
# Add `rack-cache` to your Gemfile before enabling this.
|