smithycms 0.6.10 → 0.7.0
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/smithy/application.js +1 -0
- data/app/assets/javascripts/smithy/layout.coffee +13 -0
- data/app/assets/stylesheets/smithy/application.scss +3 -0
- data/app/assets/stylesheets/smithy/layout.scss +32 -13
- data/app/assets/stylesheets/smithy/tabs.scss +3 -0
- data/app/controllers/smithy/assets_controller.rb +1 -1
- data/app/controllers/smithy/content_resources_controller.rb +1 -1
- data/app/controllers/smithy/pages_controller.rb +15 -1
- data/app/models/smithy/page.rb +14 -1
- data/app/models/smithy/permitted_params.rb +1 -1
- data/app/views/layouts/smithy/application.html.erb +16 -9
- data/app/views/smithy/pages/_content_tab.html.erb +14 -0
- data/app/views/smithy/pages/_form.html.erb +16 -32
- data/app/views/smithy/pages/_meta_tab.html.erb +8 -0
- data/app/views/smithy/pages/_page_related.html.erb +1 -0
- data/app/views/smithy/pages/_seo_tab.html.erb +5 -0
- data/config/routes.rb +3 -0
- data/lib/smithy/version.rb +1 -1
- data/vendor/cache/CFPropertyList-2.3.2.gem +0 -0
- data/vendor/cache/actionmailer-4.1.10.gem +0 -0
- data/vendor/cache/actionpack-4.1.10.gem +0 -0
- data/vendor/cache/actionview-4.1.10.gem +0 -0
- data/vendor/cache/activemodel-4.1.10.gem +0 -0
- data/vendor/cache/activerecord-4.1.10.gem +0 -0
- data/vendor/cache/activesupport-4.1.10.gem +0 -0
- data/vendor/cache/addressable-2.3.8.gem +0 -0
- data/vendor/cache/arel-5.0.1.20140414130214.gem +0 -0
- data/vendor/cache/autoprefixer-rails-6.3.5.gem +0 -0
- data/vendor/cache/awesome_nested_set-3.0.3.gem +0 -0
- data/vendor/cache/aws-sdk-2.2.31.gem +0 -0
- data/vendor/cache/aws-sdk-core-2.2.31.gem +0 -0
- data/vendor/cache/aws-sdk-resources-2.2.31.gem +0 -0
- data/vendor/cache/bcrypt-3.1.10.gem +0 -0
- data/vendor/cache/bootstrap-sass-3.2.0.2.gem +0 -0
- data/vendor/cache/builder-3.2.2.gem +0 -0
- data/vendor/cache/byebug-4.0.5.gem +0 -0
- data/vendor/cache/capybara-2.4.4.gem +0 -0
- data/vendor/cache/celluloid-0.16.0.gem +0 -0
- data/vendor/cache/coderay-1.1.0.gem +0 -0
- data/vendor/cache/coffee-rails-4.1.1.gem +0 -0
- data/vendor/cache/coffee-script-2.4.1.gem +0 -0
- data/vendor/cache/coffee-script-source-1.10.0.gem +0 -0
- data/vendor/cache/columnize-0.9.0.gem +0 -0
- data/vendor/cache/concurrent-ruby-1.0.1.gem +0 -0
- data/vendor/cache/coveralls-0.7.12.gem +0 -0
- data/vendor/cache/crass-1.0.2.gem +0 -0
- data/vendor/cache/database_cleaner-1.4.1.gem +0 -0
- data/vendor/cache/diff-lcs-1.2.5.gem +0 -0
- data/vendor/cache/docile-1.1.5.gem +0 -0
- data/vendor/cache/domain_name-0.5.23.gem +0 -0
- data/vendor/cache/dotenv-2.0.1.gem +0 -0
- data/vendor/cache/dotenv-rails-2.0.1.gem +0 -0
- data/vendor/cache/em-websocket-0.5.1.gem +0 -0
- data/vendor/cache/erubis-2.7.0.gem +0 -0
- data/vendor/cache/eventmachine-1.0.7.gem +0 -0
- data/vendor/cache/excon-0.49.0.gem +0 -0
- data/vendor/cache/execjs-2.6.0.gem +0 -0
- data/vendor/cache/factory_girl-4.5.0.gem +0 -0
- data/vendor/cache/factory_girl_rails-4.5.0.gem +0 -0
- data/vendor/cache/fakeweb-1.3.0.gem +0 -0
- data/vendor/cache/ffaker-2.0.0.gem +0 -0
- data/vendor/cache/ffi-1.9.8.gem +0 -0
- data/vendor/cache/fission-0.5.0.gem +0 -0
- data/vendor/cache/fog-1.38.0.gem +0 -0
- data/vendor/cache/fog-aliyun-0.1.0.gem +0 -0
- data/vendor/cache/fog-atmos-0.1.0.gem +0 -0
- data/vendor/cache/fog-aws-0.9.2.gem +0 -0
- data/vendor/cache/fog-brightbox-0.10.1.gem +0 -0
- data/vendor/cache/fog-cloudatcost-0.1.2.gem +0 -0
- data/vendor/cache/fog-core-1.36.0.gem +0 -0
- data/vendor/cache/fog-dynect-0.0.3.gem +0 -0
- data/vendor/cache/fog-ecloud-0.3.0.gem +0 -0
- data/vendor/cache/fog-google-0.1.0.gem +0 -0
- data/vendor/cache/fog-json-1.0.2.gem +0 -0
- data/vendor/cache/fog-local-0.3.0.gem +0 -0
- data/vendor/cache/fog-openstack-0.1.2.gem +0 -0
- data/vendor/cache/fog-powerdns-0.1.1.gem +0 -0
- data/vendor/cache/fog-profitbricks-0.0.5.gem +0 -0
- data/vendor/cache/fog-rackspace-0.1.1.gem +0 -0
- data/vendor/cache/fog-radosgw-0.0.5.gem +0 -0
- data/vendor/cache/fog-riakcs-0.1.0.gem +0 -0
- data/vendor/cache/fog-sakuracloud-1.7.5.gem +0 -0
- data/vendor/cache/fog-serverlove-0.1.2.gem +0 -0
- data/vendor/cache/fog-softlayer-1.1.0.gem +0 -0
- data/vendor/cache/fog-storm_on_demand-0.1.1.gem +0 -0
- data/vendor/cache/fog-terremark-0.1.0.gem +0 -0
- data/vendor/cache/fog-vmfusion-0.1.0.gem +0 -0
- data/vendor/cache/fog-voxel-0.1.0.gem +0 -0
- data/vendor/cache/fog-vsphere-0.6.3.gem +0 -0
- data/vendor/cache/fog-xenserver-0.2.3.gem +0 -0
- data/vendor/cache/fog-xml-0.1.2.gem +0 -0
- data/vendor/cache/font-awesome-sass-4.5.0.gem +0 -0
- data/vendor/cache/formatador-0.2.5.gem +0 -0
- data/vendor/cache/formtastic-3.1.4.gem +0 -0
- data/vendor/cache/formtastic-bootstrap-3.1.1.gem +0 -0
- data/vendor/cache/friendly_id-5.0.5.gem +0 -0
- data/vendor/cache/fuubar-2.0.0.gem +0 -0
- data/vendor/cache/guard-2.12.5.gem +0 -0
- data/vendor/cache/guard-compat-1.2.1.gem +0 -0
- data/vendor/cache/guard-livereload-2.4.0.gem +0 -0
- data/vendor/cache/guard-rspec-4.5.0.gem +0 -0
- data/vendor/cache/hitimes-1.2.2.gem +0 -0
- data/vendor/cache/http-cookie-1.0.2.gem +0 -0
- data/vendor/cache/http_parser.rb-0.6.0.gem +0 -0
- data/vendor/cache/httparty-0.13.7.gem +0 -0
- data/vendor/cache/i18n-0.7.0.gem +0 -0
- data/vendor/cache/inflecto-0.0.2.gem +0 -0
- data/vendor/cache/ipaddress-0.8.3.gem +0 -0
- data/vendor/cache/jmespath-1.1.3.gem +0 -0
- data/vendor/cache/jquery-rails-3.1.4.gem +0 -0
- data/vendor/cache/json-1.8.2.gem +0 -0
- data/vendor/cache/kaminari-0.16.3.gem +0 -0
- data/vendor/cache/kramdown-1.10.0.gem +0 -0
- data/vendor/cache/launchy-2.4.3.gem +0 -0
- data/vendor/cache/letter_opener-1.3.0.gem +0 -0
- data/vendor/cache/liquid-2.6.3.gem +0 -0
- data/vendor/cache/listen-2.10.0.gem +0 -0
- data/vendor/cache/lumberjack-1.0.9.gem +0 -0
- data/vendor/cache/mail-2.6.4.gem +0 -0
- data/vendor/cache/method_source-0.8.2.gem +0 -0
- data/vendor/cache/mime-types-2.4.3.gem +0 -0
- data/vendor/cache/mini_magick-4.5.1.gem +0 -0
- data/vendor/cache/mini_portile-0.6.2.gem +0 -0
- data/vendor/cache/minitest-5.5.1.gem +0 -0
- data/vendor/cache/multi_json-1.11.0.gem +0 -0
- data/vendor/cache/multi_xml-0.5.5.gem +0 -0
- data/vendor/cache/mysql2-0.3.18.gem +0 -0
- data/vendor/cache/nenv-0.2.0.gem +0 -0
- data/vendor/cache/netrc-0.10.3.gem +0 -0
- data/vendor/cache/nokogiri-1.6.6.2.gem +0 -0
- data/vendor/cache/nokogumbo-1.4.7.gem +0 -0
- data/vendor/cache/notiffany-0.0.6.gem +0 -0
- data/vendor/cache/pg-0.18.1.gem +0 -0
- data/vendor/cache/pry-0.10.1.gem +0 -0
- data/vendor/cache/rack-1.5.2.gem +0 -0
- data/vendor/cache/rack-cache-1.6.1.gem +0 -0
- data/vendor/cache/rack-livereload-0.3.15.gem +0 -0
- data/vendor/cache/rack-protection-1.5.3.gem +0 -0
- data/vendor/cache/rack-test-0.6.3.gem +0 -0
- data/vendor/cache/rails-4.1.10.gem +0 -0
- data/vendor/cache/railties-4.1.10.gem +0 -0
- data/vendor/cache/rake-10.4.2.gem +0 -0
- data/vendor/cache/rb-fsevent-0.9.4.gem +0 -0
- data/vendor/cache/rb-inotify-0.9.5.gem +0 -0
- data/vendor/cache/rbvmomi-1.8.2.gem +0 -0
- data/vendor/cache/refile-0.6.2.gem +0 -0
- data/vendor/cache/refile-mini_magick-0.2.0.gem +0 -0
- data/vendor/cache/refile-s3-0.2.0.gem +0 -0
- data/vendor/cache/remotipart-1.2.1.gem +0 -0
- data/vendor/cache/rest-client-1.8.0.gem +0 -0
- data/vendor/cache/rinku-1.7.3.gem +0 -0
- data/vendor/cache/rspec-3.2.0.gem +0 -0
- data/vendor/cache/rspec-core-3.2.2.gem +0 -0
- data/vendor/cache/rspec-expectations-3.2.0.gem +0 -0
- data/vendor/cache/rspec-mocks-3.2.1.gem +0 -0
- data/vendor/cache/rspec-rails-3.2.1.gem +0 -0
- data/vendor/cache/rspec-support-3.2.2.gem +0 -0
- data/vendor/cache/ruby-oembed-0.8.14.gem +0 -0
- data/vendor/cache/ruby-progressbar-1.7.5.gem +0 -0
- data/vendor/cache/sanitize-4.0.1.gem +0 -0
- data/vendor/cache/sass-3.4.22.gem +0 -0
- data/vendor/cache/sass-rails-5.0.4.gem +0 -0
- data/vendor/cache/shellany-0.0.1.gem +0 -0
- data/vendor/cache/shoulda-matchers-2.8.0.gem +0 -0
- data/vendor/cache/simplecov-0.9.2.gem +0 -0
- data/vendor/cache/simplecov-html-0.9.0.gem +0 -0
- data/vendor/cache/sinatra-1.4.7.gem +0 -0
- data/vendor/cache/slodown-0.1.3.gem +0 -0
- data/vendor/cache/slop-3.6.0.gem +0 -0
- data/vendor/cache/smithycms-auth-0.4.2.gem +0 -0
- data/vendor/cache/sprockets-3.5.2.gem +0 -0
- data/vendor/cache/sprockets-rails-2.3.3.gem +0 -0
- data/vendor/cache/sqlite3-1.3.10.gem +0 -0
- data/vendor/cache/term-ansicolor-1.3.0.gem +0 -0
- data/vendor/cache/terminal-notifier-guard-1.6.4.gem +0 -0
- data/vendor/cache/thor-0.19.1.gem +0 -0
- data/vendor/cache/thread_safe-0.3.5.gem +0 -0
- data/vendor/cache/tilt-2.0.2.gem +0 -0
- data/vendor/cache/timers-4.0.1.gem +0 -0
- data/vendor/cache/tins-1.3.5.gem +0 -0
- data/vendor/cache/trollop-2.1.2.gem +0 -0
- data/vendor/cache/tzinfo-1.2.2.gem +0 -0
- data/vendor/cache/unf-0.1.4.gem +0 -0
- data/vendor/cache/unf_ext-0.0.6.gem +0 -0
- data/vendor/cache/xml-simple-1.1.5.gem +0 -0
- data/vendor/cache/xpath-2.0.0.gem +0 -0
- metadata +176 -4
- data/app/views/layouts/smithy/wide.html.erb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e488b0b840e5746ecfb42f5afdc5c406759a13d
|
4
|
+
data.tar.gz: 981f62d7db553a5328609359a3d4a0af906cc68c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 612329465b66651222def0240823a9504d5675cca25f04cb1bd857cad8272bf505e0e7706111b55e616ad20ba7d56ff7623337bd122838c625589b94e2f57fa8
|
7
|
+
data.tar.gz: 33550ffcc8c8cbff5e6a11776f30729b23a025841442124db7d96d14d6dee4239d7acbaed6cdcdb99d8f5e83fef0571f8e013cd22e52657af8e90f5c982450b0
|
@@ -0,0 +1,13 @@
|
|
1
|
+
setLayoutHeight = ->
|
2
|
+
$('#content.with-sidebar').css('min-height', $('#side').prop('scrollHeight') - $('#main').height() - 48)
|
3
|
+
$('#side').css('max-height', $(window).height()).affix('checkPosition')
|
4
|
+
|
5
|
+
$ ->
|
6
|
+
$('#side').affix
|
7
|
+
offset:
|
8
|
+
top: ->
|
9
|
+
this.top = $('.navbar').outerHeight(true)
|
10
|
+
setLayoutHeight()
|
11
|
+
|
12
|
+
$(window).on 'load resize', (e) ->
|
13
|
+
setLayoutHeight()
|
@@ -19,6 +19,8 @@
|
|
19
19
|
*= depend_on smithy/templates.scss
|
20
20
|
*/
|
21
21
|
|
22
|
+
$tag-orange: #faa61a;
|
23
|
+
$tag-red: #C6311D;
|
22
24
|
@import 'bootstrap_and_overrides';
|
23
25
|
@import 'datatables/dataTables.bootstrap';
|
24
26
|
@import 'datatables-responsive';
|
@@ -26,6 +28,7 @@
|
|
26
28
|
@import 'forms';
|
27
29
|
@import 'guides';
|
28
30
|
@import 'pages';
|
31
|
+
@import 'tabs';
|
29
32
|
@import 'templates';
|
30
33
|
@import 'content_blocks';
|
31
34
|
@import 'assets';
|
@@ -14,12 +14,9 @@ body { background:#444; padding:0; }
|
|
14
14
|
}
|
15
15
|
|
16
16
|
#side {
|
17
|
-
// float:left; width:20%;
|
18
|
-
position:relative;
|
19
17
|
.actions { padding:16px 15px 0 15px ; }
|
20
18
|
.nav-list {
|
21
19
|
border-top:1px solid #393939;
|
22
|
-
margin:16px 0 0 0;
|
23
20
|
padding:0;
|
24
21
|
.nav-list { margin:0; }
|
25
22
|
li + .nav-header {
|
@@ -61,11 +58,38 @@ body { background:#444; padding:0; }
|
|
61
58
|
}
|
62
59
|
}
|
63
60
|
}
|
61
|
+
#body {
|
62
|
+
@include clearfix(); position:relative;
|
63
|
+
#main { @extend .col-xs-12; }
|
64
|
+
&.with-sidebar {
|
65
|
+
#side {
|
66
|
+
@extend .col-xs-5;
|
67
|
+
@extend .col-sm-3;
|
68
|
+
@extend .col-md-2;
|
69
|
+
overflow:auto; padding-top:$grid-gutter-width/2; padding-bottom:$grid-gutter-width/2;
|
70
|
+
@media screen and (min-width: $screen-sm-min) {
|
71
|
+
position:absolute; top:0;
|
72
|
+
&.affix { position:fixed; }
|
73
|
+
&.affix-top { bottom: auto; }
|
74
|
+
}
|
75
|
+
}
|
76
|
+
#main {
|
77
|
+
@extend .col-xs-7;
|
78
|
+
@extend .col-sm-9;
|
79
|
+
@extend .col-md-10;
|
80
|
+
@extend .col-sm-offset-3;
|
81
|
+
@extend .col-md-offset-2;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
#content { @extend .col-md-12; }
|
86
|
+
&.with-related {
|
87
|
+
#content { @extend .col-md-9; }
|
88
|
+
#related { @extend .col-md-3; }
|
89
|
+
}
|
90
|
+
}
|
64
91
|
#main {
|
65
|
-
// float:left; width:80%;
|
66
92
|
background:#f9f9f9; margin:-12px 0 0 0; padding:0 0 24px 0; position:relative;
|
67
|
-
-webkit-border-radius: 10px 0px 0px 10px;
|
68
|
-
border-radius: 10px 0px 0px 10px;
|
69
93
|
-webkit-box-shadow: 0px 0px 18px 0px rgba(0, 0, 0, 0.4);
|
70
94
|
box-shadow: 0px 0px 18px 0px rgba(0, 0, 0, 0.4);
|
71
95
|
> h1 { padding:24px 0 0 12px; }
|
@@ -74,14 +98,9 @@ body { background:#444; padding:0; }
|
|
74
98
|
#related {}
|
75
99
|
}
|
76
100
|
|
77
|
-
.wide #main {
|
78
|
-
> .container-fluid { padding-right:20px; }
|
79
|
-
#content { border-right:0; }
|
80
|
-
}
|
81
|
-
|
82
101
|
#main-wide { background:#f9f9f9; padding:0 0 24px 0; position:relative; }
|
83
102
|
|
84
103
|
#footer {
|
85
|
-
color:#BBB; font-size:12px; text-align:right; padding:1em;
|
86
|
-
a { color
|
104
|
+
color:#BBB; font-size:12px; text-align:right; padding:1em; a { color:#EEE; }
|
105
|
+
a { color:$tag-orange; }
|
87
106
|
}
|
@@ -8,7 +8,7 @@ module Smithy
|
|
8
8
|
|
9
9
|
def index
|
10
10
|
@asset_source = AssetSource.first
|
11
|
-
respond_with @assets
|
11
|
+
respond_with @assets do |format|
|
12
12
|
format.html
|
13
13
|
format.json { render json: ::Smithy::AssetsDatatable.new(view_context, params[:type]) }
|
14
14
|
end
|
@@ -6,7 +6,7 @@ module Smithy
|
|
6
6
|
include Smithy::Liquid::Rendering
|
7
7
|
before_filter :load_page_from_path, :only => [ :show ]
|
8
8
|
before_filter :initialize_page, :only => [ :new, :create ]
|
9
|
-
before_filter :load_page, :only => [ :edit, :update, :destroy ]
|
9
|
+
before_filter :load_page, :only => [ :edit, :update, :destroy, :duplicate ]
|
10
10
|
before_filter :load_parent, :except => [ :index, :show, :order, :selector_modal ]
|
11
11
|
before_filter :load_root, :only => [ :index ]
|
12
12
|
respond_to :html, :json
|
@@ -50,6 +50,20 @@ module Smithy
|
|
50
50
|
respond_with @page.parent ? @page.parent : @page
|
51
51
|
end
|
52
52
|
|
53
|
+
def duplicate
|
54
|
+
old_page = @page
|
55
|
+
@page = old_page.dup
|
56
|
+
@page.duplicate_page = old_page.id
|
57
|
+
@page.title << " (Copy)"
|
58
|
+
@page.permalink.clear
|
59
|
+
@page.browser_title.clear
|
60
|
+
@page.keywords.clear
|
61
|
+
@page.description.clear
|
62
|
+
respond_with @page do |format|
|
63
|
+
format.html { render(action: :new) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
53
67
|
def order
|
54
68
|
first = Smithy::Page.find(params[:order].shift)
|
55
69
|
@parent = first.parent
|
data/app/models/smithy/page.rb
CHANGED
@@ -3,6 +3,7 @@ module Smithy
|
|
3
3
|
validates_presence_of :template, :title
|
4
4
|
validate :validate_one_root
|
5
5
|
validate :validate_exclusion_of_reserved_words
|
6
|
+
validate :validate_duplicate_page_exists
|
6
7
|
|
7
8
|
belongs_to :template
|
8
9
|
has_many :containers, :through => :template
|
@@ -14,13 +15,14 @@ module Smithy
|
|
14
15
|
|
15
16
|
before_save :build_permalink
|
16
17
|
before_save :set_published_at
|
18
|
+
before_save :copy_content_from_duplicate, on: :create, if: -> { self.duplicate_page.present? }
|
17
19
|
|
18
20
|
accepts_nested_attributes_for :contents, :reject_if => lambda {|a| a['label'].blank? || a['container'].blank? || a['content_block'].blank? }, :allow_destroy => true
|
19
21
|
|
20
22
|
scope :included_in_navigation, -> { where("show_in_navigation=? AND published_at <= ?", true, Time.now) }
|
21
23
|
scope :published, -> { where('published_at <= ?', Time.now) }
|
22
24
|
|
23
|
-
attr_accessor :publish
|
25
|
+
attr_accessor :publish, :duplicate_page
|
24
26
|
attr_reader :liquid_context
|
25
27
|
|
26
28
|
def self.page_selector_options
|
@@ -96,11 +98,22 @@ module Smithy
|
|
96
98
|
self.permalink = self.root? ? title.parameterize : path.split('/').last unless self.permalink?
|
97
99
|
end
|
98
100
|
|
101
|
+
def copy_content_from_duplicate
|
102
|
+
duplicate_page = Page.find(self.duplicate_page)
|
103
|
+
duplicate_page.contents.each do |content|
|
104
|
+
self.contents << content.dup
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
99
108
|
def set_published_at
|
100
109
|
self.published_at = Time.now if self.publish.present?
|
101
110
|
self.published_at = nil if self.publish == false
|
102
111
|
end
|
103
112
|
|
113
|
+
def validate_duplicate_page_exists
|
114
|
+
errors.add(:duplicate_page, "this page could not be found. Please choose another and try again.") if self.duplicate_page.present? && Page.find_by(id: self.duplicate_page).blank?
|
115
|
+
end
|
116
|
+
|
104
117
|
def validate_exclusion_of_reserved_words
|
105
118
|
reserved = %w(index new edit session login logout users smithy)
|
106
119
|
errors.add(:title, "cannot contain reserved words (#{reserved.join(', ')})") if reserved.include?(self.title.to_s.parameterize)
|
@@ -38,7 +38,7 @@ module Smithy
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def page_attributes
|
41
|
-
[ :browser_title, :cache_length, :description, :external_link, :keywords, :permalink, :publish, :published_at, :show_in_navigation, :title, :parent_id, :template_id ]
|
41
|
+
[ :browser_title, :cache_length, :description, :external_link, :keywords, :permalink, :publish, :published_at, :show_in_navigation, :title, :parent_id, :template_id, :duplicate_page ]
|
42
42
|
end
|
43
43
|
|
44
44
|
def page_content_attributes
|
@@ -2,24 +2,31 @@
|
|
2
2
|
<body>
|
3
3
|
<%= render :partial => "layouts/smithy/shared/nav" %>
|
4
4
|
<div class="container-fluid">
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
<%- classes = 'row' -%>
|
6
|
+
<%- classes += ' with-sidebar' if content_for?(:secondary_nav) -%>
|
7
|
+
<%- classes += ' with-related' if content_for?(:related) -%>
|
8
|
+
<div id="body" class="<%= classes %>">
|
9
|
+
<% if content_for? :secondary_nav %>
|
10
|
+
<nav id="side" class="">
|
11
|
+
<%= yield :secondary_nav %>
|
12
|
+
</nav>
|
13
|
+
<% end %>
|
14
|
+
<div id="main">
|
10
15
|
<% if content_for? :title %><h1><%= yield :title %></h1><% end %>
|
11
16
|
<%= render :partial => "layouts/smithy/shared/flash", :locals => { flash: flash } %>
|
12
17
|
<%= yield :top_content %>
|
13
18
|
<div class="container-fluid">
|
14
19
|
<section class="row" id="content-container">
|
15
20
|
|
16
|
-
<article id="content"
|
21
|
+
<article id="content">
|
17
22
|
<%= yield %>
|
18
23
|
</article>
|
19
24
|
|
20
|
-
|
21
|
-
|
22
|
-
|
25
|
+
<% if content_for? :related %>
|
26
|
+
<aside id="related">
|
27
|
+
<%= yield :related %>
|
28
|
+
</aside>
|
29
|
+
<% end %>
|
23
30
|
|
24
31
|
</section>
|
25
32
|
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%= f.input :title %>
|
2
|
+
<%= f.input :parent, :include_blank => false, :collection => tree_for_select unless !@page.parent_id? %>
|
3
|
+
<%= f.input :show_in_navigation, :label => "Show page in site navigation" %>
|
4
|
+
<%= f.input :template, :as => :select, :collection => Smithy::Template.templates, :include_blank => false %>
|
5
|
+
|
6
|
+
<% if @page.persisted? && @page.external_link.blank? %>
|
7
|
+
<%= render :partial => "container", :collection => @page.containers, :locals => { :f => f } %>
|
8
|
+
<% elsif @page.external_link? %>
|
9
|
+
<%= f.inputs "Redirect" do %>
|
10
|
+
<%= f.input :external_link, :hint => "This page is currently being redirected to #{link_to @page.external_link, @page.external_link}".html_safe %>
|
11
|
+
<% end %>
|
12
|
+
<% else %>
|
13
|
+
<%= f.input :duplicate_page, as: :select, label: "Copy Content From", collection: tree_for_select %>
|
14
|
+
<% end %>
|
@@ -13,38 +13,22 @@
|
|
13
13
|
<% end %>
|
14
14
|
|
15
15
|
<%= semantic_form_for @page, :url => ( @page.persisted? ? page_path(@page.id) : pages_path ) do |f| %>
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
<%=
|
30
|
-
|
31
|
-
|
32
|
-
<h3 data-toggle="collapse" data-target="#page-meta">Meta <i class="fa fa-caret-down"></i></h3>
|
33
|
-
<%= content_tag :div, :id => "page-meta", :class => "collapse" do %>
|
34
|
-
<%= f.inputs do %>
|
35
|
-
<%= f.input(:external_link) unless @page.external_link? %>
|
36
|
-
<%= f.input :cache_length, :hint => "In seconds (eg. 600 is 10 minutes)" %>
|
37
|
-
<%= render :partial => "smithy/pages/meta_fields", :locals => { :f => f } if File.exists?(Rails.root.join('app', 'views', 'smithy', 'pages', '_meta_fields.html.erb')) %>
|
38
|
-
<% end %>
|
39
|
-
<% end %>
|
40
|
-
<h3 data-toggle="collapse" data-target="#page-seo">SEO <i class="fa fa-caret-down"></i></h3>
|
41
|
-
<%= content_tag :div, :id => "page-seo", :class => "collapse" do %>
|
42
|
-
<%= f.inputs do %>
|
43
|
-
<%= f.input :browser_title %>
|
44
|
-
<%= f.input :keywords, as: :string, input_html: { maxlength: nil } %>
|
45
|
-
<%= f.input :description %>
|
46
|
-
<% end %>
|
47
|
-
<% end %>
|
16
|
+
<ul class="nav nav-tabs" role="tablist">
|
17
|
+
<li class="active"><a href="#page_content" role="tab" data-toggle="tab">Content</a></li>
|
18
|
+
<li><a href="#meta" role="tab" data-toggle="tab">Meta</a></li>
|
19
|
+
<li><a href="#seo" role="tab" data-toggle="tab">SEO</a></li>
|
20
|
+
</ul>
|
21
|
+
<div class="tab-content">
|
22
|
+
<div role="tabpanel" class="tab-pane active" id="page_content">
|
23
|
+
<%= render partial: 'smithy/pages/content_tab', locals: { f: f } %>
|
24
|
+
</div>
|
25
|
+
<div role="tabpanel" class="tab-pane" id="meta">
|
26
|
+
<%= render partial: 'smithy/pages/meta_tab', locals: { f: f } %>
|
27
|
+
</div>
|
28
|
+
<div role="tabpanel" class="tab-pane" id="seo">
|
29
|
+
<%= render partial: 'smithy/pages/seo_tab', locals: { f: f } %>
|
30
|
+
</div>
|
31
|
+
</div>
|
48
32
|
|
49
33
|
<%= f.actions do %>
|
50
34
|
<% if @page.published? %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= f.inputs do %>
|
2
|
+
<%= f.input :permalink, :hint => "This will be auto-created if blank. Only fill it in if you know what you're doing" %>
|
3
|
+
<%= render :partial => "smithy/pages/page_fields", :locals => { :f => f } if File.exists?(Rails.root.join('app', 'views', 'smithy', 'pages', '_page_fields.html.erb')) %>
|
4
|
+
|
5
|
+
<%= f.input(:external_link) unless @page.external_link? %>
|
6
|
+
<%= f.input :cache_length, :hint => "In seconds (eg. 600 is 10 minutes)" %>
|
7
|
+
<%= render :partial => "smithy/pages/meta_fields", :locals => { :f => f } if File.exists?(Rails.root.join('app', 'views', 'smithy', 'pages', '_meta_fields.html.erb')) %>
|
8
|
+
<% end %>
|
@@ -19,4 +19,5 @@
|
|
19
19
|
|
20
20
|
<%= content_tag :p, link_to("View Page", @page.path, class: 'btn btn-primary') if @page.persisted? && @page.published? %></p>
|
21
21
|
<%= content_tag :p, link_to("Delete Page", page_path(@page.id), method: :delete, data: { confirm: "Are you sure you want to delete this page?" }, class: 'btn btn-danger') if @page.persisted? %></p>
|
22
|
+
<%= content_tag :p, link_to("Duplicate", duplicate_page_path(@page.id), method: :post, class: 'btn btn-info') if @page.persisted? %></p>
|
22
23
|
<% end %>
|
data/config/routes.rb
CHANGED
data/lib/smithy/version.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|