tenon 1.0.76 → 1.1.1
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/ckeditor/CHANGES.md +987 -0
- data/app/assets/javascripts/ckeditor/LICENSE.md +1420 -0
- data/app/assets/javascripts/ckeditor/README.md +39 -0
- data/app/assets/javascripts/ckeditor/adapters/jquery.js +10 -0
- data/app/assets/javascripts/ckeditor/build-config.js +74 -0
- data/app/assets/javascripts/ckeditor/ckeditor.js +820 -0
- data/app/assets/javascripts/ckeditor/config.js +38 -0
- data/app/assets/javascripts/ckeditor/contents.css +132 -0
- data/app/assets/javascripts/ckeditor/lang/en.js +5 -0
- data/app/assets/javascripts/ckeditor/lang/fr-ca.js +5 -0
- data/app/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +11 -0
- data/app/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +4 -0
- data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +7 -0
- data/app/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +26 -0
- data/app/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/linktoasset/plugin.js +24 -0
- data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +32 -0
- data/app/assets/javascripts/ckeditor/plugins/sourcedialog/dialogs/sourcedialog.js +6 -0
- data/app/assets/javascripts/ckeditor/samples/css/samples.css +1640 -0
- data/app/assets/javascripts/ckeditor/samples/img/github-top.png +0 -0
- data/app/assets/javascripts/ckeditor/samples/img/header-bg.png +0 -0
- data/app/assets/javascripts/ckeditor/samples/img/header-separator.png +0 -0
- data/app/assets/javascripts/ckeditor/samples/img/logo.png +0 -0
- data/app/assets/javascripts/ckeditor/samples/img/navigation-tip.png +0 -0
- data/app/assets/javascripts/ckeditor/samples/index.html +128 -0
- data/app/assets/javascripts/ckeditor/samples/js/sample.js +53 -0
- data/app/assets/javascripts/ckeditor/samples/js/sf.js +17 -0
- data/app/assets/javascripts/ckeditor/samples/old/ajax.html +85 -0
- data/app/assets/javascripts/ckeditor/samples/old/api.html +210 -0
- data/app/assets/javascripts/ckeditor/samples/old/appendto.html +59 -0
- data/app/assets/javascripts/ckeditor/samples/old/assets/inlineall/logo.png +0 -0
- data/app/assets/javascripts/ckeditor/samples/old/assets/outputxhtml/outputxhtml.css +204 -0
- data/app/assets/javascripts/ckeditor/samples/old/assets/posteddata.php +59 -0
- data/app/assets/javascripts/ckeditor/samples/old/assets/sample.jpg +0 -0
- data/app/assets/javascripts/ckeditor/samples/old/assets/uilanguages/languages.js +7 -0
- data/app/assets/javascripts/ckeditor/samples/old/datafiltering.html +508 -0
- data/app/assets/javascripts/ckeditor/samples/old/dialog/assets/my_dialog.js +48 -0
- data/app/assets/javascripts/ckeditor/samples/old/dialog/dialog.html +190 -0
- data/app/assets/javascripts/ckeditor/samples/old/divreplace.html +144 -0
- data/app/assets/javascripts/ckeditor/samples/old/enterkey/enterkey.html +106 -0
- data/app/assets/javascripts/ckeditor/samples/old/index.html +125 -0
- data/app/assets/javascripts/ckeditor/samples/old/inlineall.html +314 -0
- data/app/assets/javascripts/ckeditor/samples/old/inlinebycode.html +124 -0
- data/app/assets/javascripts/ckeditor/samples/old/inlinetextarea.html +113 -0
- data/app/assets/javascripts/ckeditor/samples/old/jquery.html +103 -0
- data/app/assets/javascripts/ckeditor/samples/old/readonly.html +76 -0
- data/app/assets/javascripts/ckeditor/samples/old/replacebyclass.html +60 -0
- data/app/assets/javascripts/ckeditor/samples/old/replacebycode.html +59 -0
- data/app/assets/javascripts/ckeditor/samples/old/sample.css +357 -0
- data/app/assets/javascripts/ckeditor/samples/old/sample.js +50 -0
- data/app/assets/javascripts/ckeditor/samples/old/sample_posteddata.php +16 -0
- data/app/assets/javascripts/ckeditor/samples/old/sourcedialog/sourcedialog.html +121 -0
- data/app/assets/javascripts/ckeditor/samples/old/tabindex.html +78 -0
- data/app/assets/javascripts/ckeditor/samples/old/toolbar/toolbar.html +235 -0
- data/app/assets/javascripts/ckeditor/samples/old/uicolor.html +72 -0
- data/app/assets/javascripts/ckeditor/samples/old/uilanguages.html +122 -0
- data/app/assets/javascripts/ckeditor/samples/old/wysiwygarea/fullpage.html +80 -0
- data/app/assets/javascripts/ckeditor/samples/old/xhtmlstyle.html +234 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/css/fontello.css +55 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/LICENSE.txt +10 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/config.json +28 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.eot +0 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.svg +14 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.ttf +0 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/font/fontello.woff +0 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/index.html +446 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js +13 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js +9 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js +33 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/js/toolbartextmodifier.js +14 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/LICENSE +19 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.css +325 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/codemirror.js +288 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/javascript.js +25 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/neo.css +36 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.css +38 -0
- data/app/assets/javascripts/ckeditor/samples/toolbarconfigurator/lib/codemirror/show-hint.js +16 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_ie7.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/dialog_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/editor.css +7 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_gecko.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_ie.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_ie7.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_ie8.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/editor_iequirks.css +5 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/icons_hidpi.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/arrow.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/close.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/hidpi/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/lock-open.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/lock.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/images/refresh.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/moono-dark/readme.md +51 -0
- data/app/assets/javascripts/ckeditor/styles.js +111 -0
- data/app/assets/javascripts/tenon/features/editor.js.coffee +24 -0
- data/app/assets/javascripts/tenon/features/modal_windows.js.coffee +48 -21
- data/app/assets/javascripts/tenon/features/tenon_content/asset_link.js.coffee +9 -3
- data/app/assets/javascripts/tenon/features/tenon_content/editor.js.coffee +10 -3
- data/app/assets/javascripts/tenon/tenon.js +1 -2
- data/app/assets/javascripts/tenon/tenon_manifest.js +1 -1
- data/app/assets/stylesheets/tenon/{colors-custom.css.scss → colors-custom.scss} +0 -0
- data/app/assets/stylesheets/tenon/{colors-named.css.scss → colors-named.scss} +0 -0
- data/app/assets/stylesheets/tenon/{helpers.css.scss → helpers.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{assets.css.scss → assets.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{breakpoints.css.scss → breakpoints.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{global.css.scss → global.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{grid.css.scss → grid.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{main-nav.css.scss → main-nav.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{margins.css.scss → margins.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{mobile.css.scss → mobile.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{sidebar.css.scss → sidebar.scss} +0 -0
- data/app/assets/stylesheets/tenon/layout/{util-nav.css.scss → util-nav.scss} +0 -0
- data/app/assets/stylesheets/tenon/{mixins.css.scss → mixins.scss} +0 -0
- data/app/assets/stylesheets/tenon/{styleguide.css.scss → styleguide.scss} +0 -0
- data/app/assets/stylesheets/tenon/{tenon.css.scss → tenon.scss} +0 -0
- data/app/assets/stylesheets/tenon/{typography.css.scss → typography.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{alerts.css.scss → alerts.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{asset-attachment.css.scss → asset-attachment.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{asset-cropping.css.scss → asset-cropping.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{asset-uploads.css.scss → asset-uploads.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{buttons.css.scss → buttons.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{callouts.css.scss → callouts.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{comments.css.scss → comments.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{forms.css.scss → forms.scss} +16 -0
- data/app/assets/stylesheets/tenon/ui/{generic-loader.css.scss → generic-loader.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{header-tools.css.scss → header-tools.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{i18n.css.scss → i18n.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{list-style-toggle.css.scss → list-style-toggle.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{login.css.scss → login.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{medium-editor.css.scss → medium-editor.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{modals.css.scss → modals.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{pagination.css.scss → pagination.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{progress-bars.css.scss → progress-bars.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{quick-search.css.scss → quick-search.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{record-grids.css.scss → record-grids.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{record-lists.css.scss → record-lists.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{section-headers.css.scss → section-headers.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{select2-custom.css.scss → select2-custom.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{tables.css.scss → tables.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{tabs.css.scss → tabs.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{tenon-content-library.css.scss → tenon-content-library.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{tenon-content-popped-out.css.scss → tenon-content-popped-out.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{tenon-content.css.scss → tenon-content.scss} +0 -15
- data/app/assets/stylesheets/tenon/ui/{thinking.css.scss → thinking.scss} +0 -0
- data/app/assets/stylesheets/tenon/ui/{toolbox.css.scss → toolbox.scss} +0 -0
- data/app/assets/stylesheets/tenon/{z-indexes.css.scss → z-indexes.scss} +0 -0
- data/app/assets/stylesheets/{tenon_addons.css.scss → tenon_addons.scss} +0 -0
- data/app/form_builders/tenon/form_builder.rb +39 -19
- data/app/models/tenon/page.rb +6 -0
- data/app/views/tenon/fields/_asset.html.haml +32 -0
- data/app/views/tenon/fields/_rich_text.html.haml +8 -0
- data/app/views/tenon/galleries/_photo_fields.html.haml +2 -2
- data/app/views/tenon/posts/_form.html.haml +2 -5
- data/app/views/tenon/tenon_content/_row.html.haml +2 -2
- data/app/views/tenon/tenon_content/piece_types/form/_text.html.haml +2 -3
- data/lib/generators/tenon/scaffold/templates/view__form.html.haml +1 -1
- data/lib/tenon/version.rb +1 -1
- data/spec/controllers/tenon/pages_controller_spec.rb +1 -1
- data/vendor/assets/stylesheets/{bootstrap.css.scss → bootstrap.scss} +0 -0
- data/vendor/assets/stylesheets/{bootstrap.tables.css.scss → bootstrap.tables.scss} +0 -0
- data/vendor/assets/stylesheets/{jscrollpane.css.scss → jscrollpane.scss} +0 -0
- metadata +168 -63
- data/app/assets/javascripts/tenon/features/medium.js.coffee +0 -13
- data/app/views/tenon/shared/_asset_field.html.haml +0 -29
@@ -1,5 +1,11 @@
|
|
1
1
|
class Tenon.features.tenonContent.AssetLink extends Tenon.features.tenonContent.AssetAttachment
|
2
2
|
_setFields: ($li) =>
|
3
|
-
$
|
4
|
-
|
5
|
-
|
3
|
+
$link = $('<a />').attr('href', $li.data('style-urls')['original'])
|
4
|
+
selected = @$browseButton.getSelection().getSelectedText()
|
5
|
+
text = if selected.length then selected else 'Asset Link'
|
6
|
+
$link.html(text)
|
7
|
+
@$browseButton.insertHtml($link[0].outerHTML)
|
8
|
+
|
9
|
+
# Create a virtual input to hold the data
|
10
|
+
_getAssetField: =>
|
11
|
+
$('<input />').attr('type', 'hidden')
|
@@ -6,10 +6,14 @@ class Tenon.features.tenonContent.Editor
|
|
6
6
|
for div in $('.tn-tc')
|
7
7
|
@_updateButtons($(div))
|
8
8
|
|
9
|
+
CKEDITOR.on 'instanceReady', ->
|
10
|
+
Tenon.features.Editor.watchChanges()
|
11
|
+
|
9
12
|
_rowInserted: (e) =>
|
10
|
-
|
11
|
-
|
12
|
-
@
|
13
|
+
# Reactivate Editor
|
14
|
+
$wrap = $(e.currentTarget).closest('.tn-tc')
|
15
|
+
@_redrawCkeditor()
|
16
|
+
@_updateButtons($wrap)
|
13
17
|
|
14
18
|
_rowRemoved: (e) =>
|
15
19
|
@_updateButtons($(e.currentTarget).closest('.tn-tc'))
|
@@ -25,3 +29,6 @@ class Tenon.features.tenonContent.Editor
|
|
25
29
|
else
|
26
30
|
$wrap.find('.tn-tc-add-content').hide()
|
27
31
|
$wrap.find('.tn-tc-pop-out').show()
|
32
|
+
|
33
|
+
_redrawCkeditor: =>
|
34
|
+
Tenon.features.Editor.reinitInline()
|
@@ -45,7 +45,7 @@ var Tenon = {
|
|
45
45
|
new Tenon.features.QuickSearch();
|
46
46
|
new Tenon.features.DateTimePicker();
|
47
47
|
new Tenon.features.ItemVersionAutosave();
|
48
|
-
new Tenon.features.ModalWindows();
|
48
|
+
Tenon.modals = new Tenon.features.ModalWindows();
|
49
49
|
new Tenon.features.ModalForms();
|
50
50
|
new Tenon.features.ProtectChanges();
|
51
51
|
new Tenon.features.RecordApproval();
|
@@ -60,7 +60,6 @@ var Tenon = {
|
|
60
60
|
new Tenon.features.SortableNestedFields();
|
61
61
|
new Tenon.features.videoFeeds();
|
62
62
|
new Tenon.features.tenonContent.Base();
|
63
|
-
new Tenon.features.Medium();
|
64
63
|
|
65
64
|
|
66
65
|
Tenon.dispatcher.initialize();
|
@@ -8,6 +8,7 @@
|
|
8
8
|
//= require bootstrap.modal
|
9
9
|
//= require bootstrap.tabs
|
10
10
|
//= require canvasjs.min
|
11
|
+
//= require ckeditor/ckeditor
|
11
12
|
//= require cocoon
|
12
13
|
//= require imagesloaded
|
13
14
|
//= require jquery-fileupload/basic
|
@@ -21,7 +22,6 @@
|
|
21
22
|
//= require jquery.twoLevelSort
|
22
23
|
//= require jquery.ui.sortable
|
23
24
|
//= require js-routes
|
24
|
-
//= require ./medium-on-tenon
|
25
25
|
//= require select2
|
26
26
|
//= require uri
|
27
27
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -44,6 +44,22 @@ textarea {
|
|
44
44
|
height: 180px;
|
45
45
|
}
|
46
46
|
|
47
|
+
.editable-text {
|
48
|
+
min-height: 50px;
|
49
|
+
padding: 5px;
|
50
|
+
outline: none;
|
51
|
+
background: #fff;
|
52
|
+
h1, h2, h3, h4, h5, h6, p, ul, ol {
|
53
|
+
margin: 0 0 $tn-margin;
|
54
|
+
padding-top: 0;
|
55
|
+
}
|
56
|
+
.btn {
|
57
|
+
margin: 0 10px;
|
58
|
+
color: white;
|
59
|
+
background-color: $tn-primary;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
47
63
|
label, h4.box-label {
|
48
64
|
color: $tn-box-label;
|
49
65
|
text-transform: uppercase;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/app/assets/stylesheets/tenon/ui/{tenon-content-library.css.scss → tenon-content-library.scss}
RENAMED
File without changes
|
File without changes
|
@@ -136,21 +136,6 @@
|
|
136
136
|
> div {
|
137
137
|
min-height: 100%;
|
138
138
|
}
|
139
|
-
.editable-text {
|
140
|
-
min-height: 50px;
|
141
|
-
padding: 5px;
|
142
|
-
outline: none;
|
143
|
-
background: #fff;
|
144
|
-
h1, h2, h3, h4, h5, h6, p, ul, ol {
|
145
|
-
margin: 0 0 $tn-margin;
|
146
|
-
padding-top: 0;
|
147
|
-
}
|
148
|
-
.btn {
|
149
|
-
margin: 0 10px;
|
150
|
-
color: white;
|
151
|
-
background-color: $tn-primary;
|
152
|
-
}
|
153
|
-
}
|
154
139
|
a.add-image {
|
155
140
|
span {
|
156
141
|
font-family: $tn-open-sans;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -5,20 +5,40 @@ module Tenon
|
|
5
5
|
alias_method :super_label, :label
|
6
6
|
|
7
7
|
def tenon_content(method_name)
|
8
|
-
@template.render 'tenon/tenon_content/builder',
|
8
|
+
@template.render 'tenon/tenon_content/builder',
|
9
|
+
f: self,
|
10
|
+
field: method_name
|
9
11
|
end
|
10
12
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
13
|
+
def asset(method_name, opts = {})
|
14
|
+
defaults = {
|
15
|
+
label: nil,
|
16
|
+
# Remove button triggers cocoon's remove child event?
|
17
|
+
remove_association: false
|
18
|
+
}
|
19
|
+
opts = defaults.merge(opts)
|
20
|
+
|
21
|
+
@template.render 'tenon/fields/asset',
|
22
|
+
f: self,
|
23
|
+
label_tag: label(method_name, opts[:label]),
|
24
|
+
field: method_name,
|
25
|
+
proxy_attachment: object.send(method_name),
|
26
|
+
opts: opts
|
14
27
|
end
|
15
28
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
29
|
+
def rich_text(method_name, opts = {})
|
30
|
+
defaults = {
|
31
|
+
placeholder: '--',
|
32
|
+
}
|
33
|
+
opts = defaults.merge(opts)
|
34
|
+
|
35
|
+
@template.render 'tenon/fields/rich_text',
|
36
|
+
f: self,
|
37
|
+
field: method_name,
|
38
|
+
label_tag: label(method_name, opts[:label]),
|
39
|
+
opts: opts
|
21
40
|
end
|
41
|
+
alias_method :me_text, :rich_text
|
22
42
|
|
23
43
|
alias_method :super_text_field, :text_field
|
24
44
|
def text_field(method_name, options = {})
|
@@ -73,6 +93,16 @@ module Tenon
|
|
73
93
|
|
74
94
|
private
|
75
95
|
|
96
|
+
def label(method_name, label, language = nil, language_title = nil)
|
97
|
+
if label == false
|
98
|
+
''.html_safe
|
99
|
+
else
|
100
|
+
label ||= method_name.to_s.titleize
|
101
|
+
label = language_title ? label + " (#{language_title.to_s.titleize})" : label
|
102
|
+
super(get_method(method_name, language), label.html_safe)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
76
106
|
def build_content(generator, method_name, options)
|
77
107
|
content = send(generator, method_name, options)
|
78
108
|
content = internationalize_content(generator, method_name, content, options) if Tenon::I18nLookup.new(@object.class).fields.include? method_name.to_s
|
@@ -95,16 +125,6 @@ module Tenon
|
|
95
125
|
explanation ? content_tag(:div, explanation.html_safe, class: 'explanation') : ''
|
96
126
|
end
|
97
127
|
|
98
|
-
def label(method_name, label, language = nil, language_title = nil)
|
99
|
-
if label == false
|
100
|
-
''.html_safe
|
101
|
-
else
|
102
|
-
label ||= method_name.to_s.titleize
|
103
|
-
label = language_title ? label + " (#{language_title.to_s.titleize})" : label
|
104
|
-
super(get_method(method_name, language), label.html_safe)
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
128
|
def get_method(method, language = nil)
|
109
129
|
language ? "#{method}_#{language}" : method
|
110
130
|
end
|
data/app/models/tenon/page.rb
CHANGED
@@ -71,6 +71,12 @@ module Tenon
|
|
71
71
|
publish_at.present? ? publish_at <= Time.now : false
|
72
72
|
end
|
73
73
|
|
74
|
+
# Update each subpage.path up the tree:
|
75
|
+
after_save :update_subpage_slugs
|
76
|
+
def update_subpage_slugs
|
77
|
+
subpages.each(&:save)
|
78
|
+
end
|
79
|
+
|
74
80
|
protected
|
75
81
|
|
76
82
|
def path_is_not_route
|
@@ -0,0 +1,32 @@
|
|
1
|
+
= raw(label_tag)
|
2
|
+
|
3
|
+
- if opts[:explanation].present?
|
4
|
+
.explanation= raw opts[:explanation]
|
5
|
+
|
6
|
+
.tn-tc-asset-field
|
7
|
+
= f.hidden_field "#{field}_id", class: 'asset-id-field'
|
8
|
+
|
9
|
+
.thumbnail
|
10
|
+
- if proxy_attachment.try(:asset)
|
11
|
+
= asset_icon(proxy_attachment.asset)
|
12
|
+
- else
|
13
|
+
= image_tag default_asset_thumbnail(proxy_attachment)
|
14
|
+
|
15
|
+
.details
|
16
|
+
.asset-info
|
17
|
+
- if proxy_attachment
|
18
|
+
= proxy_attachment.display_name
|
19
|
+
- else
|
20
|
+
No asset selected.
|
21
|
+
|
22
|
+
.browse-button-holder{ class: ('with-remove' if opts[:remove_association]) }
|
23
|
+
.browse-button
|
24
|
+
= link_to 'Browse', new_item_asset_path, class: 'btn btn-comp browse', data: { modal_remote: true, modal_title: "Select #{field.to_s.titleize}", modal_handler: 'Tenon.features.AssetAttachment' }
|
25
|
+
- if opts[:remove_association]
|
26
|
+
%small
|
27
|
+
or
|
28
|
+
= link_to_remove_association "remove", f
|
29
|
+
- else
|
30
|
+
%small
|
31
|
+
or
|
32
|
+
= link_to "remove", '#', class: 'remove-asset', data: { confirm: 'Are you sure?' }
|
@@ -1,3 +1,3 @@
|
|
1
1
|
%li.nested-fields{:style => ('display: none;' if f.object._destroy)}
|
2
|
-
=
|
3
|
-
= f.hidden_field :list_order
|
2
|
+
= f.asset :file, remove_association: true, label: false
|
3
|
+
= f.hidden_field :list_order
|
@@ -20,11 +20,8 @@
|
|
20
20
|
.form-group
|
21
21
|
= f.text_field :title, :explanation => "Give your post a title."
|
22
22
|
|
23
|
-
.form-group
|
24
|
-
|
25
|
-
.editable-text{contenteditable: true}
|
26
|
-
= raw @post.excerpt
|
27
|
-
= f.hidden_field :excerpt
|
23
|
+
.form-group
|
24
|
+
= f.rich_text :excerpt
|
28
25
|
|
29
26
|
.form-group
|
30
27
|
= f.tenon_content :content
|
@@ -5,7 +5,7 @@
|
|
5
5
|
%i.fa.fa-arrows.drag-anchor
|
6
6
|
|
7
7
|
= link_to '#', class: 'tn-tc-open-library above', data: { modal_target: ".tenon-library", modal_closest: '.tn-tc', modal_title: "Insert Content", modal_handler: 'Tenon.features.tenonContent.Library', modal_clone: 'true', tooltip: '' }, title: 'Insert Content' do
|
8
|
-
|
8
|
+
%i.fa.fa-fw.fa-plus-circle
|
9
9
|
|
10
10
|
= link_to_remove_association(fa_icon('trash-o'), f, {'data-confirm' => 'Are you sure?', 'data-wrapper-class' => 'tn-tc-row'})
|
11
11
|
|
@@ -16,4 +16,4 @@
|
|
16
16
|
.tn-tc-bottombar
|
17
17
|
.actions
|
18
18
|
= link_to '#', class: 'tn-tc-open-library below', data: { modal_target: ".tenon-library", modal_closest: '.tn-tc', modal_title: "Insert Content", modal_handler: 'Tenon.features.tenonContent.Library', modal_clone: 'true', modal_closest: '.tn-tc', tooltip: ''}, title: 'Insert Content' do
|
19
|
-
|
19
|
+
%i.fa.fa-fw.fa-plus-circle
|
data/lib/tenon/version.rb
CHANGED