caboose-cms 0.7.18 → 0.7.19

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: d9baf1edd2864a1be3b9e24d0a66d68d07209510
4
- data.tar.gz: f5154b7aaed3c72d584f9af8c1f48463019d197e
3
+ metadata.gz: 00bb4a2e48e9627eee28198c3377b6163ec84a89
4
+ data.tar.gz: 34fcca5c39a38ac8cf68e6d277270476e4e46fb1
5
5
  SHA512:
6
- metadata.gz: 5b1390e70d8018860ac722c6169fe2458ecb2aeb16f130033b18baceea04853a625d540d79a0be24d04d26f811a64280f60ea6034cddbe9135e5ec4871874d95
7
- data.tar.gz: cb03acae980b4124446c432252b83099ec323edff690a4ccfcf505d3e3b2a811c068742a8d0d22a715089150e9a6b09ce1a634d25ab1bff5022133d2f8a9e909
6
+ metadata.gz: c49e10f38e901e6a0837829e433a64cab3b2eed708234c04c61f03d178fa300c89ba7b0635f6de2e8ef333fd55a219d820110ca56d84c299f8d7ccaf4be9ed8d
7
+ data.tar.gz: 412015ee0d678c1b96ba5f46a479971797fb9100fecbda56db33701fbac8ac88200bb180697b3f906485db5d7445b7c0e2e471d1d61d83df63cfb8105444625d
@@ -287,7 +287,9 @@ module Caboose
287
287
  pd = d.site.primary_domain
288
288
  if pd && pd.domain != request.host
289
289
  url = "#{request.protocol}#{pd.domain}"
290
- if request.fullpath && request.fullpath.strip.length > 0 && request.fullpath.strip != '/'
290
+ if d.forward_to_uri && d.forward_to_uri.strip.length > 0
291
+ url << d.forward_to_uri
292
+ elsif request.fullpath && request.fullpath.strip.length > 0 && request.fullpath.strip != '/'
291
293
  url << request.fullpath
292
294
  end
293
295
  redirect_to url
@@ -41,6 +41,7 @@ module Caboose
41
41
  when 'domain' then d.domain = value
42
42
  when 'under_construction' then d.under_construction = value
43
43
  when 'forward_to_primary' then d.forward_to_primary = value
44
+ when 'forward_to_uri' then d.forward_to_uri = value
44
45
  when 'primary' then
45
46
  d.primary = value
46
47
  Domain.where(:site_id => params[:site_id]).all.each do |d2|
@@ -30,7 +30,9 @@ module Caboose
30
30
  pd = d.site.primary_domain
31
31
  if pd && pd.domain != request.host
32
32
  url = "#{request.protocol}#{pd.domain}"
33
- if request.fullpath && request.fullpath.strip.length > 0 && request.fullpath.strip != '/'
33
+ if d.forward_to_uri && d.forward_to_uri.strip.length > 0
34
+ url << d.forward_to_uri
35
+ elsif request.fullpath && request.fullpath.strip.length > 0 && request.fullpath.strip != '/'
34
36
  url << request.fullpath
35
37
  end
36
38
  redirect_to url
@@ -3,6 +3,6 @@ class Caboose::Domain < ActiveRecord::Base
3
3
  self.table_name = "domains"
4
4
 
5
5
  belongs_to :site, :class_name => 'Caboose::Site'
6
- attr_accessible :id, :site_id, :domain, :primary, :under_construction, :forward_to_primary
6
+ attr_accessible :id, :site_id, :domain, :primary, :under_construction, :forward_to_primary, :forward_to_uri
7
7
 
8
8
  end
@@ -280,7 +280,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
280
280
  [ :domain , :string ],
281
281
  [ :primary , :boolean, { :default => false }],
282
282
  [ :under_construction , :boolean, { :default => false }],
283
- [ :forward_to_primary , :boolean, { :default => false }]
283
+ [ :forward_to_primary , :boolean, { :default => false }],
284
+ [ :forward_to_uri , :string ]
284
285
  ],
285
286
  Caboose::Font => [
286
287
  [ :site_id , :integer ],
@@ -25,6 +25,7 @@ user_ids = [] if user_ids.nil?
25
25
  <th>Primary</th>
26
26
  <th>Under Construction</th>
27
27
  <th>Forward to Primary</th>
28
+ <th>Forward to URI</th>
28
29
  <th>Delete</th>
29
30
  </tr>
30
31
  <% @site.domains.order(:id).all.each do |d| %>
@@ -33,6 +34,7 @@ user_ids = [] if user_ids.nil?
33
34
  <td align='center'><input type='radio' name='primary_domain' <%= d.primary? ? "checked='true'" : '' %> onclick="set_primary_domain(<%= s.id %>, <%= d.id %>);" /></td>
34
35
  <td align='center'><input type='checkbox' name='under_construction_<%= d.id %>' <%= d.under_construction ? "checked='true'" : '' %> onclick="set_under_construction(<%= s.id %>, <%= d.id %>, $(this).prop('checked'));" /></td>
35
36
  <td align='center'><input type='checkbox' name='forward_to_primary_<%= d.id %>' <%= d.forward_to_primary ? "checked='true'" : '' %> onclick="set_forward_to_primary(<%= s.id %>, <%= d.id %>, $(this).prop('checked'));" /></td>
37
+ <td align='center'><input type='text' name='forward_to_uri_<%= d.id %>' value="<%= d.forward_to_uri %>" onchange="set_forward_to_uri(<%= s.id %>, <%= d.id %>, $(this).val());" /></td>
36
38
  <td align='center'><input type='button' value='Delete' onclick="delete_domain(<%= @site.id %>, <%= d.id %>);" /></td>
37
39
  </tr>
38
40
  <% end %>
@@ -98,6 +100,15 @@ function set_forward_to_primary(site_id, domain_id, checked)
98
100
  });
99
101
  }
100
102
 
103
+ function set_forward_to_uri(site_id, domain_id, val)
104
+ {
105
+ $.ajax({
106
+ url: '/admin/sites/' + site_id + '/domains/' + domain_id,
107
+ type: 'put',
108
+ data: { forward_to_uri: val }
109
+ });
110
+ }
111
+
101
112
  function add_site_membership(site_id, user_id, role)
102
113
  {
103
114
  $.ajax({
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.7.18'
2
+ VERSION = '0.7.19'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.18
4
+ version: 0.7.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-02 00:00:00.000000000 Z
11
+ date: 2015-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg