caboose-cms 0.2.64 → 0.2.65

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzgwMDA5N2FjZjllMDg4YTU3NjNkYjQ0NGZhNTI3MmRlNmU2MGZhNQ==
4
+ OGQ1Mzc1ZTI2OWIwMzZiZDc5NmZjNjAyY2ZkODk3YzkxYjVmNDVjYw==
5
5
  data.tar.gz: !binary |-
6
- MTE0OWFlNmQwMGRkM2FkZmYxODNlYzRmZDFhOWNjYzY0MWViMDViZQ==
6
+ MWQwOGQ0OWExZWYwMjUzY2ZjOTM4NmRkMDQ3ZGVlZGNkZGVhOWRkNA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Y2I2NzcwM2UzOWQ3OWUyZTNhZGFkY2ViYmNkYmQwNWI3ZGIyZGRlYjllZGU1
10
- OTc2ZjBlMzg0MGE4MzUzZDE1ZGYwMDZjYTAzZTRhODkzM2U5NjNkNDc1Yjg1
11
- NTUwODNiNjU1OGZiNjFjNzY1ZmQ4Njg3ODBlZDhmMGZlNjA5OTM=
9
+ ZGJkMGExMzdkM2E3Yjc4ZWU1NThjMzk1ODY3ODg0NjlhNDJjZGM0ZWEzNWMw
10
+ NGQyYjFmZjkxZjI4MmIwYmViYmQwNmFiZDNiZDA3MjgyM2Y0ZmUxNGI1ZWVk
11
+ NmI0MDUzMjU1MzI0ZGQ1N2U4NGE5MmQ4NTlmZjdlMDM5ZjhlMTQ=
12
12
  data.tar.gz: !binary |-
13
- NjY2NzQ2Y2EwYjMzMDBlOWQyZDNlMjcyY2JlODY1MjBlNWVhZTMzYjVkNGFj
14
- ODljNjlkNjNkOWM3ZDNjZjk2NzczMjJhNTA4ODMzNDBlZDUyYTJhOTY5OWMz
15
- YmExNjcxMTBiYzdjZDEwOGUyNjVlMWRiNThkYmNlMWFkNDY4OWQ=
13
+ YzNhMzU3YjNlYTZmNzJlYTRlNzBlMzNlNzcxZDhkYzRlNTNkNTZlMDBkYTI4
14
+ Nzc5MjBiNWIzNTY4OGEzMDVkNzk1MmUwYzhiNDk3YWFiMzZmZjJjNmE5MmRi
15
+ ZjkxNjYzNzNlN2NiYTlkZTVhODI2MDUwMTQ0NmEwNDk5ZjlhYjM=
@@ -106,7 +106,7 @@ module Caboose
106
106
  # GET /admin/pages/new
107
107
  def admin_new
108
108
  return unless user_is_allowed('pages', 'add')
109
- @parent_id = params[:parent_id].nil? ? params[:parent_id] : 1
109
+ @parent_id = params[:parent_id] ? params[:parent_id] : 1
110
110
  @parent = Page.find(@parent_id)
111
111
  render :layout => 'caboose/admin'
112
112
  end
@@ -194,7 +194,7 @@ module Caboose
194
194
  Caboose::Page.update_authorized_for_action(page.id, 'edit', editors)
195
195
 
196
196
  # Send back the response
197
- resp.redirect = "/pages/#{page.id}/edit"
197
+ resp.redirect = "/admin/pages/#{page.id}/edit"
198
198
  render json: resp
199
199
  end
200
200
 
@@ -297,14 +297,21 @@ module Caboose
297
297
  render json: resp
298
298
  end
299
299
 
300
+ # GET /admin/pages/1/delete
301
+ def admin_delete_form
302
+ return unless user_is_allowed('pages', 'delete')
303
+ @page = Page.find(params[:id])
304
+ render :layout => 'caboose/admin'
305
+ end
306
+
300
307
  # DELETE /admin/pages/1
301
- def admin_destroy
308
+ def admin_delete
302
309
  return unless user_is_allowed('pages', 'delete')
303
- user = Page.find(params[:id])
304
- user.destroy
310
+ p = Page.find(params[:id])
311
+ p.destroy
305
312
 
306
313
  resp = StdClass.new({
307
- 'redirect' => '/pages'
314
+ 'redirect' => '/admin/pages'
308
315
  })
309
316
  render json: resp
310
317
  end
@@ -2,9 +2,9 @@
2
2
  <%= render :partial => 'caboose/pages/admin_header' %>
3
3
 
4
4
  <div id='message'>
5
- <p class='note warning'>Are you sure you want to delet the page? This can't be undone.<br /><br />
6
- <input type='button' onclick='delete_page(<%= @page.id %>, true);' />
7
- <input type='button' onclick="window.location='/admin/pages/<%= @page.id %>/edit';" />
5
+ <p class='note error'>Are you sure you want to delet the page? This can't be undone.<br /><br />
6
+ <input type='button' value='Yes' onclick='delete_page(<%= @page.id %>, true);' />
7
+ <input type='button' value='No' onclick="window.location='/admin/pages/<%= @page.id %>/edit';" />
8
8
  </p>
9
9
  </div>
10
10
 
@@ -17,7 +17,7 @@ function delete_page(page_id, confirm)
17
17
  {
18
18
  $('#message').html("<p class='loading'>Deleting page...</p>");
19
19
  $.ajax({
20
- url: '/admin/pages/' + page_id + '/delete',
20
+ url: '/admin/pages/' + page_id,
21
21
  type: 'delete',
22
22
  success: function(resp) {
23
23
  if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
@@ -1,5 +1,5 @@
1
1
  <h1>Pages</h1>
2
2
 
3
- <p><a href='/pages/new'>New Page</a></p>
3
+ <p><a href='/admin/pages/new'>New Page</a></p>
4
4
 
5
5
  <%= raw pages_list(@home_page) %>
@@ -3,7 +3,10 @@
3
3
  <p>Parent: <%= @parent ? @parent.title : "Home" %></p>
4
4
  <input type='hidden' id='parent_id' name='parent_id' value='<%= @parent_id %>' />
5
5
  <p><input type='text' id='title' name='title' placeholder='Title' style="width: 400px;" /></p>
6
- <p><input type='submit' value='Add Page' onclick='add_page();' /></p>
6
+ <p>
7
+ <input type='button' value='< Back' onclick="window.location='/admin/pages';" />
8
+ <input type='submit' value='Add Page' onclick='add_page();' />
9
+ </p>
7
10
 
8
11
  <% content_for :caboose_js do %>
9
12
  <%= javascript_include_tag "caboose/model/all" %>
@@ -18,7 +21,7 @@ function add_page()
18
21
  {
19
22
  modal.autosize("<p class='loading'>Adding page...</p>");
20
23
  $.ajax({
21
- url: '/pages',
24
+ url: '/admin/pages',
22
25
  type: 'post',
23
26
  data: {
24
27
  parent_id: $('#parent_id').val(),
@@ -50,7 +50,8 @@ Caboose::Engine.routes.draw do
50
50
  get "admin/pages/sitemap-options" => "pages#admin_sitemap_options"
51
51
  get "admin/pages/robots-options" => "pages#admin_robots_options"
52
52
  get "admin/pages/format-options" => "pages#admin_content_format_options"
53
- get "admin/pages/new" => "pages#admin_new"
53
+ get "admin/pages/new" => "pages#admin_new"
54
+ get "admin/pages/:id/delete" => "pages#admin_delete_form"
54
55
  get "admin/pages/:id/sitemap" => "pages#admin_sitemap"
55
56
  get "admin/pages/:id/edit" => "pages#admin_edit_general"
56
57
  get "admin/pages/:id/css" => "pages#admin_edit_css"
@@ -60,7 +61,7 @@ Caboose::Engine.routes.draw do
60
61
  put "admin/pages/:id" => "pages#admin_update"
61
62
  get "admin/pages" => "pages#admin_index"
62
63
  post "admin/pages" => "pages#admin_create"
63
- delete "admin/pages/:id" => "pages#admin_destroy"
64
+ delete "admin/pages/:id" => "pages#admin_delete"
64
65
 
65
66
  match '*path' => 'pages#show'
66
67
  root :to => 'pages#show'
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.2.64'
2
+ VERSION = '0.2.65'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.64
4
+ version: 0.2.65
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
@@ -217,7 +217,7 @@ files:
217
217
  - app/views/caboose/login/index.html.erb
218
218
  - app/views/caboose/pages/_admin_footer.html.erb
219
219
  - app/views/caboose/pages/_admin_header.html.erb
220
- - app/views/caboose/pages/admin_delete.html.erb
220
+ - app/views/caboose/pages/admin_delete_form.html.erb
221
221
  - app/views/caboose/pages/admin_edit_content.html.erb
222
222
  - app/views/caboose/pages/admin_edit_css.html.erb
223
223
  - app/views/caboose/pages/admin_edit_general.html.erb