tenon 1.0.26 → 1.0.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/tenon/templates/redirects/redirect_row.jst.eco +2 -4
- data/app/controllers/tenon/redirects_controller.rb +12 -0
- data/app/models/tenon/redirect.rb +4 -0
- data/app/views/tenon/pages/index.json.jbuilder +2 -2
- data/app/views/tenon/redirects/_redirect.json.jbuilder +2 -0
- data/config/routes.rb +1 -0
- data/lib/tenon/version.rb +1 -1
- data/spec/models/tenon/redirect_spec.rb +21 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34e1b1b1ecbd92e365d323988b5e9bafb32e19c1
|
4
|
+
data.tar.gz: e068e258a9520d70e0c9acf36afb870a4cbb13cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea19fd36996e7c42de91645ec5e67cc5b38c5865d2970772d4f7a84d2fd0cc6c469d10113809f59fe2d0c0be73cf7fe4f19ed16908f345a5b5c1599db31a42f3
|
7
|
+
data.tar.gz: a6fb89c25554d018a19ad6b2b9941c6a2c979daf1e2bb6b2ef3fa3410c6bfbdeba6af8ad934dfb1346c6d2e6d008a9ed8462f02a3dbdda7b9c02a5a016d7327d
|
@@ -3,14 +3,12 @@
|
|
3
3
|
<div class="record-actions">
|
4
4
|
<%- @redirect.delete_link %>
|
5
5
|
<%- @redirect.edit_link %>
|
6
|
-
|
7
|
-
<a data-tooltip="Active"><i class="fa fa-eye fa-fw"></i></span>
|
8
|
-
<% end %>
|
6
|
+
<%- @redirect.active_link %>
|
9
7
|
</div>
|
10
8
|
|
11
9
|
<div class="record-title">
|
12
10
|
<a href="<%= @redirect.edit_path %>">
|
13
|
-
|
11
|
+
<%= @redirect.in %>
|
14
12
|
<i class="fa fa-long-arrow-right" style="margin: 0 20px; opacity:0.3;" />
|
15
13
|
<%= @redirect.out %>
|
16
14
|
</a>
|
@@ -4,6 +4,18 @@ module Tenon
|
|
4
4
|
params.require(:redirect).permit!
|
5
5
|
end
|
6
6
|
|
7
|
+
def toggle_active
|
8
|
+
respond_to do |format|
|
9
|
+
if @redirect.toggle_active!
|
10
|
+
format.json { render json: @redirect.to_json }
|
11
|
+
format.html { flash[:notice] = 'redirect approved.' and redirect_to redirects_path }
|
12
|
+
else
|
13
|
+
format.json { render status: 500, nothing: true }
|
14
|
+
format.html { flash[:warning] = 'Error approving redirect.' and redirect_to redirects_path }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
7
19
|
private
|
8
20
|
|
9
21
|
def search_args
|
@@ -7,8 +7,8 @@ json.records do
|
|
7
7
|
json.updater page.updater.present? ? page.updater.email : 'Unknown User'
|
8
8
|
json.edit_path edit_page_path(page)
|
9
9
|
|
10
|
-
if page.published?
|
11
|
-
json.view_link action_link("View on Site",
|
10
|
+
if page.published?
|
11
|
+
json.view_link action_link("View on Site", page.path, "laptop")
|
12
12
|
end
|
13
13
|
|
14
14
|
json.subpage_link action_link("Create a Sub-Page", new_page_path(:parent_id => page.id), "plus")
|
data/config/routes.rb
CHANGED
data/lib/tenon/version.rb
CHANGED
@@ -7,4 +7,25 @@ describe Tenon::Redirect do
|
|
7
7
|
Tenon::Redirect.active
|
8
8
|
end
|
9
9
|
end
|
10
|
+
|
11
|
+
describe '#toggle_active!' do
|
12
|
+
let(:redirect) { Tenon::Redirect.new(active: active) }
|
13
|
+
context 'when active is true' do
|
14
|
+
let(:active) { true }
|
15
|
+
it 'should set active to false and save the redirect' do
|
16
|
+
expect(redirect).to receive(:active=).with(false)
|
17
|
+
expect(redirect).to receive(:save)
|
18
|
+
redirect.toggle_active!
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'when active is false' do
|
23
|
+
let(:active) { false }
|
24
|
+
it 'should set active to true and save the redirect' do
|
25
|
+
expect(redirect).to receive(:active=).with(true)
|
26
|
+
expect(redirect).to receive(:save)
|
27
|
+
redirect.toggle_active!
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
10
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tenon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- factor[e] design initiative
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: better_errors
|
@@ -1470,7 +1470,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1470
1470
|
version: '0'
|
1471
1471
|
requirements: []
|
1472
1472
|
rubyforge_project:
|
1473
|
-
rubygems_version: 2.
|
1473
|
+
rubygems_version: 2.2.2
|
1474
1474
|
signing_key:
|
1475
1475
|
specification_version: 4
|
1476
1476
|
summary: A highly flexible mountable Rails CMS built for rapid application development.
|