optimacms 0.1.28 → 0.1.31

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
  SHA1:
3
- metadata.gz: 5ee7e2a04857fa28ad4149d8afad96c0fd8530cf
4
- data.tar.gz: 87ae1a3f8cc53df939860161547aed5bac5d33f2
3
+ metadata.gz: 353479f1ae94c50832c1965cc45701d6f03d5d19
4
+ data.tar.gz: 05b974c6e72a258fc7631f420c5cdfbe62a192a6
5
5
  SHA512:
6
- metadata.gz: 6f0eac7054f320b77b04a0e5fc36c0e3e73368004c06b062ae177f89ff01e70765b9e38a115d29ec4df3bd1de844be2f3f7defb5e1b9b1613256ce85400cceff
7
- data.tar.gz: e2b3209e1a4222622e586e00153bf346c520a5c4d4f7d4a0f834309dc2b552551801ab474ea9f3dcb9ea303908e996355ce31a41af1045654e5c5317a2a3e761
6
+ metadata.gz: 8c0bcb2730876ad11509ec858bcb51e81b4bd21a591618a93c1f76b5976bd6c04f61550319f408cc29a2fa54e61a9a1f99bf77c4205259dc93284583ca4384f2
7
+ data.tar.gz: 938403ff48dd802ea3fde5c0f472e93ae13da27a3b97ad9b8aa9a4b95f8373d032896105235ff5d8a73ed5ff04e62f2cf38ada8b75cd93b88c323d60ddb7b3c4
@@ -14,7 +14,9 @@ module Optimacms
14
14
 
15
15
  #### modal
16
16
 
17
- def set_layout_modal
17
+
18
+
19
+ def set_layout_modal_old
18
20
  if @modal==1
19
21
  self.class.layout false
20
22
  end
@@ -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 :init_tabledata, :only => [:index, :search]
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
 
@@ -9,7 +9,7 @@ module Optimacms
9
9
  end
10
10
 
11
11
  def elfinder
12
- dirpath = Optimacms.files_dir_path || 'uploads'
12
+ dirpath = Optimacms.files_dir_path
13
13
  rootpath = File.join(Rails.public_path, dirpath)
14
14
  rooturl = '/'+dirpath
15
15
 
@@ -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'
@@ -1,33 +1,6 @@
1
- !!! Strict
2
- %html
3
- %head
4
- %title= h(yield(:title) || "Admin Area" )
5
- = yield(:head)
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,4 @@
1
+ - content_for :main do
2
+ = yield
3
+
4
+ = render :template => 'optimacms/admin/layouts/application'
@@ -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
- =link_to 'Pages', pages_path
16
- %li
17
- =link_to 'Templates', templates_path
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 Products
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 'Templates', "typography.html"
31
- %li=link_to 'Templates', "typography.html"
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
@@ -16,7 +16,7 @@ module Optimacms
16
16
  include PageProcessService
17
17
 
18
18
  def controller_class
19
- Object.const_get controller.to_s.classify+'Controller'
19
+ Object.const_get controller.to_s.camelize+'Controller'
20
20
  end
21
21
 
22
22
  def url_vars
@@ -1,3 +1,3 @@
1
1
  module Optimacms
2
- VERSION = "0.1.28"
2
+ VERSION = "0.1.31"
3
3
  end
data/lib/optimacms.rb CHANGED
@@ -4,5 +4,9 @@ require "optimacms/engine"
4
4
  module Optimacms
5
5
  mattr_accessor :files_dir_path
6
6
 
7
+ def files_dir_path
8
+ @@files_dir_path || 'uploads'
9
+ end
10
+
7
11
 
8
12
  end
@@ -10,6 +10,7 @@
10
10
 
11
11
  %ul
12
12
  %li= link_to '/about.html', '/about.html'
13
+ %li= link_to '/text1.html', '/text1.html'
13
14
  %li= link_to '/news.html', '/news.html'
14
15
  %li= link_to '/news-p2.html', '/news-p2.html'
15
16
  %li= link_to '/newsitem-5.html', '/newsitem-5.html'
@@ -0,0 +1,2 @@
1
+ <p>1</p>
2
+ <p><img src="/img/funny-cats-and-kittens-wallpapers-12.jpg" alt="" width="640" height="480" /></p>
@@ -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
- config.action_controller.perform_caching = true
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.