imagine_cms 3.0.15 → 3.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/management.css +9 -0
- data/app/controllers/cms/content_controller.rb +2 -2
- data/app/controllers/management/cms_controller.rb +1 -1
- data/app/helpers/cms_application_helper.rb +2 -2
- data/app/models/cms_page.rb +1 -1
- data/app/views/imagine_cms/_toolbar.html.erb +1 -1
- data/app/views/management/cms/_edit_page.html.erb +11 -11
- data/app/views/management/cms/_template_options.html.erb +9 -3
- data/app/views/management/cms/toolbar_preview.html.erb +3 -3
- data/lib/hash_object.rb +2 -0
- data/lib/imagine_cms/version.rb +1 -1
- metadata +2 -2
@@ -98,6 +98,15 @@ img { display: inline; border: none; margin: 0; padding: 0; }
|
|
98
98
|
#management-content ol { list-style-type: decimal; list-style-position: outside; margin: 0 0 15px 20px; }
|
99
99
|
|
100
100
|
|
101
|
+
.form_button {
|
102
|
+
margin: 0;
|
103
|
+
font-size: 11px;
|
104
|
+
color: #ffffff;
|
105
|
+
text-decoration: none;
|
106
|
+
text-indent: 0;
|
107
|
+
background-color: #333;
|
108
|
+
}
|
109
|
+
|
101
110
|
/** auto complete **/
|
102
111
|
|
103
112
|
div.auto_complete {
|
@@ -212,14 +212,14 @@ module Cms # :nodoc:
|
|
212
212
|
@pages = []
|
213
213
|
|
214
214
|
if params[:q]
|
215
|
-
@terms = params[:q].split(
|
215
|
+
@terms = params[:q].split(/[^\w\-]+/).reject { |t| t.length < 3 }
|
216
216
|
end
|
217
217
|
|
218
218
|
CmsPage.index_all
|
219
219
|
unless @terms.empty?
|
220
220
|
term_variants = []
|
221
221
|
@terms.each do |term|
|
222
|
-
term_variants << [ term, term.singularize, term.pluralize ].uniq.map { |v| v.gsub(/[\[\]
|
222
|
+
term_variants << [ term, term.singularize, term.pluralize ].uniq.map { |v| v.gsub(/[\[\]\|\:\>\(\)\?]/, '').gsub(/\+/, '\+') }.join('|')
|
223
223
|
end
|
224
224
|
|
225
225
|
conds = [ 'published_version >= 0' ]
|
@@ -1040,7 +1040,7 @@ class Management::CmsController < Management::ApplicationController # :nodoc:
|
|
1040
1040
|
|
1041
1041
|
data = params[:gallery_file][:data]
|
1042
1042
|
data_dest = File.join(temp_location, data.original_filename)
|
1043
|
-
File.open(data_dest,
|
1043
|
+
File.open(data_dest, 'wb') { |f| f.write(data.read) }
|
1044
1044
|
|
1045
1045
|
last_id = images.size
|
1046
1046
|
ext = File.extname(data_dest).downcase
|
@@ -122,7 +122,7 @@ module CmsApplicationHelper
|
|
122
122
|
request.fullpath
|
123
123
|
end
|
124
124
|
|
125
|
-
# Returns the first non-
|
125
|
+
# Returns the first non-blank string in its arg list.
|
126
126
|
def first_non_empty(*args)
|
127
127
|
while !args.empty?
|
128
128
|
ret = args.shift
|
@@ -862,7 +862,7 @@ module CmsApplicationHelper
|
|
862
862
|
|
863
863
|
ret = <<EOF
|
864
864
|
<span><a href="#" onclick="showDatePicker('#{object}', '#{method_prefix}'); return false;"><span id="date_picker_#{object}_#{method_prefix}_value">#{default_value.strftime('%a %m/%d/%y')}</span></a></span>
|
865
|
-
<span id="date_picker_#{object}_#{method_prefix}icon"><a href="#" onclick="showDatePicker('#{object}', '#{method_prefix}'); return false;"><img src="/assets/
|
865
|
+
<span id="date_picker_#{object}_#{method_prefix}icon"><a href="#" onclick="showDatePicker('#{object}', '#{method_prefix}'); return false;"><img src="/assets/management/icon_time.gif" style="float: none" alt="date picker" /></a></span>
|
866
866
|
<div id="date_picker_#{object}_#{method_prefix}main" style="display: none; background-color: white; border: 1px solid gray; padding: 3px; z-index: 101;" class="date-picker-main">
|
867
867
|
<table width="190">
|
868
868
|
<tr>
|
data/app/models/cms_page.rb
CHANGED
@@ -2,7 +2,7 @@ class CmsPage < ActiveRecord::Base
|
|
2
2
|
include ActsAsTree
|
3
3
|
|
4
4
|
attr_accessible :cms_template_id, :cms_template_version, :parent_id,
|
5
|
-
:name, :title, :path, :summary, :position,
|
5
|
+
:name, :title, :path, :html_head, :summary, :position,
|
6
6
|
:article_date, :article_end_date, :published_date, :expiration_date, :expires,
|
7
7
|
:thumbnail_path, :feature_image_path, :comment_count, :version, :published_version,
|
8
8
|
:search_index, :updated_by, :updated_by_username
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div dojoType="Editor2" widgetId="main_toolbar" useActiveX="false" htmlEditing="true" focusOnLoad="false"
|
12
12
|
toolbarTemplatePath="<%= url_for :controller => '/management/cms', :action => 'toolbar_edit', :id => @pg, :version => params[:version] %>"
|
13
13
|
toolbarTemplateCssPath="/assets/dojo/src/widget/templates/EditorToolbarFullFeature.css"
|
14
|
-
toolbarAlwaysVisible="true" style="height:
|
14
|
+
toolbarAlwaysVisible="true" style="height: 22px; vertical-align: middle" toolbarGroup="main">
|
15
15
|
</div>
|
16
16
|
<%- else -%>
|
17
17
|
<div dojoType="Editor2" widgetId="main_toolbar" useActiveX="false" htmlEditing="false" focusOnLoad="false"
|
@@ -27,18 +27,12 @@
|
|
27
27
|
<td>Title:</td>
|
28
28
|
<td><%= text_field :pg, :title, :class => 'form', :style => 'width: 100%;' %></td>
|
29
29
|
</tr>
|
30
|
-
<%- if @pg.respond_to?(:html_head) -%>
|
31
|
-
<tr>
|
32
|
-
<td valign="top"><div style="margin-top: 4px;">HTML Head:<br/>(for advanced users)</div></td>
|
33
|
-
<td><%= text_area :pg, :html_head, :class => 'form', :style => 'width: 100%; height: 50px; overflow: auto;' %></td>
|
34
|
-
</tr>
|
35
|
-
<%- end -%>
|
36
30
|
<tr>
|
37
31
|
<td valign="top"><div style="margin-top: 4px;">Template:</div></td>
|
38
32
|
<td>
|
39
|
-
<%= select :pg, :cms_template_id, CmsTemplate.find(:all, :order => 'name').collect { |t| [ t.name, t.id ] }, {}, :class => 'form', :style => 'width: 100%;'
|
33
|
+
<%= select :pg, :cms_template_id, CmsTemplate.find(:all, :order => 'name').collect { |t| [ t.name, t.id ] }, {}, :class => 'form', :style => 'width: 100%;' %>
|
40
34
|
|
41
|
-
<div id="edit_page_template_options" style="background-color: white; width: 100%;
|
35
|
+
<div id="edit_page_template_options" style="display: none; background-color: white; width: 100%; border: 1px solid #aaaaaa;">
|
42
36
|
<%= render :partial => 'template_options' %>
|
43
37
|
</div>
|
44
38
|
<%= observe_field 'pg_cms_template_id', :update => 'edit_page_template_options', :with => 'template_id',
|
@@ -70,8 +64,8 @@
|
|
70
64
|
<td><%= text_field_tag :tags, @tags, :class => 'form', :style => 'width: 100%' %></td>
|
71
65
|
</tr>
|
72
66
|
<tr>
|
73
|
-
<td>
|
74
|
-
<td><%= select :pg, :published_version, [ [ '[
|
67
|
+
<td>Publish Version:</td>
|
68
|
+
<td><%= select :pg, :published_version, [ [ '[ None (offline) ]', -1 ], [ '[ Latest ]', 0 ] ].concat(@pg.versions.reverse.map { |pg| [ "#{pg.version} - #{ts_to_str pg.updated_on}#{" by #{pg.updated_by_username}" unless pg.updated_by_username.blank? }", pg.version ] }), {}, :class => 'form', :style => 'width: 100%' %></td>
|
75
69
|
</tr>
|
76
70
|
<tr>
|
77
71
|
<td>Publish Date:</td>
|
@@ -142,8 +136,14 @@
|
|
142
136
|
</td>
|
143
137
|
</tr>
|
144
138
|
<%- end -%>
|
139
|
+
<%- if @pg.respond_to?(:html_head) -%>
|
140
|
+
<tr>
|
141
|
+
<td valign="top"><div style="margin-top: 4px;">HTML Head:<br>(advanced)</div></td>
|
142
|
+
<td><%= text_area :pg, :html_head, :class => 'form', :style => 'width: 100%; height: 35px; overflow: auto;' %></td>
|
143
|
+
</tr>
|
144
|
+
<%- end -%>
|
145
145
|
<tr>
|
146
|
-
<td valign="top"><div style="margin-top: 4px;">Custom Attributes
|
146
|
+
<td valign="top"><div style="margin-top: 4px;">Custom Attributes:<br>(advanced)</div></td>
|
147
147
|
<td>
|
148
148
|
<table cellspacing="0" cellpadding="0" border="0">
|
149
149
|
<tr>
|
@@ -1,18 +1,24 @@
|
|
1
|
+
<%- if @template_options.nil? || @template_options.empty? -%>
|
2
|
+
<%= javascript_tag "Element.hide('edit_page_template_options');" %>
|
3
|
+
<%- else -%>
|
4
|
+
<%= javascript_tag "Element.show('edit_page_template_options');" %>
|
5
|
+
<%- end -%>
|
6
|
+
|
1
7
|
<%-
|
2
8
|
@template_options.each do |name, type|
|
3
9
|
key = name.gsub(/[^\w\d]/, '_')
|
4
10
|
-%>
|
5
11
|
<table width="100%">
|
6
12
|
<col width="45%" /><col width="55%" />
|
7
|
-
<tr
|
8
|
-
<td><%=
|
13
|
+
<tr>
|
14
|
+
<td><%= name %></td>
|
9
15
|
<td>
|
10
16
|
<%=
|
11
17
|
case type
|
12
18
|
when :checkbox
|
13
19
|
check_box :page_objects, "obj-option-checkbox-#{key}"
|
14
20
|
when :string, :text
|
15
|
-
text_field :page_objects, "obj-option-string-#{key}", :style => 'width: 100
|
21
|
+
text_field :page_objects, "obj-option-string-#{key}", :style => 'width: 100%;'
|
16
22
|
end
|
17
23
|
%>
|
18
24
|
</td>
|
@@ -42,7 +42,7 @@
|
|
42
42
|
</td>
|
43
43
|
|
44
44
|
<td style="vertical-align: middle;">
|
45
|
-
<span style="font-family: Arial">Preview:</span>
|
45
|
+
<span style="font-family: Arial">Preview Version:</span>
|
46
46
|
</td>
|
47
47
|
<td style="vertical-align: middle;">
|
48
48
|
<%= form_tag('/' + @pg.path, { :method => 'get' }) do -%>
|
@@ -60,7 +60,7 @@
|
|
60
60
|
</td>
|
61
61
|
|
62
62
|
<td style="vertical-align: middle;">
|
63
|
-
<span style="font-family: Arial; margin-left: 10px;">Publish:</span>
|
63
|
+
<span style="font-family: Arial; margin-left: 10px;">Publish Version:</span>
|
64
64
|
</td>
|
65
65
|
|
66
66
|
<td style="vertical-align: middle;">
|
@@ -70,7 +70,7 @@
|
|
70
70
|
:complete => "$('set_page_version_loading').hide();" + (@pg ? "$('pg_published_version_container').style.borderColor = ($('pg_published_version').value == '0' || $('pg_published_version').value == '#{@pg.versions.last.version}') ? '#EBEBEB' : 'red';" : '')) do -%>
|
71
71
|
<div id="pg_published_version_container" style="border-color: <%= @pg && (@pg.published_version == 0 || @pg.published_version == @pg.versions.last.version) ? '#EBEBEB' : 'red' %>; border-style: solid; border-width: 2px;">
|
72
72
|
<select name="pg[published_version]" id="pg_published_version" style="font-size: 8pt; width: 210px;" onchange="this.form.onsubmit();">
|
73
|
-
<%- [ [ '[
|
73
|
+
<%- [ [ '[ None (offline) ]', -1 ], [ '[ Latest ]', 0 ] ].concat(@pg.versions.reverse.map { |pg| [ "#{pg.version} - #{date_to_str(pg.updated_on)} #{time_to_str(pg.updated_on)}#{" by #{pg.updated_by_username}" unless pg.updated_by_username.blank? }", pg.version ] }).each do |label, version| %>
|
74
74
|
<option value="<%= version %>"<%= (@pg && @pg.published_version == version.to_i) ? ' selected="selected"' : '' %>><%= label %></option>
|
75
75
|
<%- end -%>
|
76
76
|
</select>
|
data/lib/hash_object.rb
CHANGED
data/lib/imagine_cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imagine_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|