comfortable_mexican_loveseat 0.0.23 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +12 -0
- data/app/assets/stylesheets/comfy/admin/cms/application.sass +12 -0
- data/app/assets/stylesheets/comfy/admin/cms/seo_form.sass +35 -0
- data/app/controllers/comfy/admin/cms/seo_snippets_controller.rb +58 -0
- data/app/services/corporate_contact.rb +25 -0
- data/app/services/country_codes.rb +255 -0
- data/app/services/seo_snippet.rb +42 -0
- data/app/services/write_seo_snippet.rb +140 -0
- data/app/views/comfy/admin/cms/_left.html.haml +20 -0
- data/app/views/comfy/admin/cms/pages/_form_blocks.html.haml +9 -0
- data/app/views/comfy/admin/cms/seo_snippets/_add_corporate_contact.html.haml +5 -0
- data/app/views/comfy/admin/cms/seo_snippets/_corporate_contact.html.haml +15 -0
- data/app/views/comfy/admin/cms/seo_snippets/_corporate_contact_labeled.html.haml +25 -0
- data/app/views/comfy/admin/cms/seo_snippets/_seo_form.html.haml +91 -0
- data/app/views/comfy/admin/cms/seo_snippets/_social_profiles.html.haml +38 -0
- data/app/views/comfy/admin/cms/seo_snippets/new.html.haml +5 -0
- data/app/views/comfy/admin/cms/snippets/index.html.haml +33 -0
- data/config/locales/de.yml +43 -15
- data/config/locales/en.yml +48 -18
- data/lib/comfortable_mexican_loveseat.rb +1 -0
- data/lib/comfortable_mexican_loveseat/cms_admin.rb +41 -0
- data/lib/comfortable_mexican_loveseat/form_builder.rb +2 -1
- metadata +35 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01af1f1cd0dc796bb216cb8cced5a61f4dff24ff
|
4
|
+
data.tar.gz: 226019a58c8a20587b7e48872f5cf5d9376850cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85ae1a29736b7db38100a8b67ee78da5a6c6762c02a0d37e9f4eab1fae58ad46465c2bb38c0995e2a1bed876aa5153a2ed1c6209c07f0107b69530bca1b4767e
|
7
|
+
data.tar.gz: 78b5e0338fbe6ed103b8241e35c40592f7dc0d6bbc2495cf910929de9da367db36de61a5ec0ede071bf3a688d5cea2daf6b7cbcfb0a2d8651feec753933b1920
|
data/README.rdoc
CHANGED
@@ -31,6 +31,18 @@ When you want to import fixtures you can now use the following commands:
|
|
31
31
|
rake cms:export
|
32
32
|
rake cms:export FROM=somewhere
|
33
33
|
rake cms:export FROM=somewhere TO=something LOCALE=de
|
34
|
+
|
35
|
+
To export a zipped folder of all fixtures (useful for syncing fixtures from different servers) you can run:
|
36
|
+
|
37
|
+
rake cms:zip
|
38
|
+
|
39
|
+
To get this working on cloud66, log into SSH and run the following commands from the <tt>/var/deploy/YOUR_APP_NAME_HERE/web_head/current</tt> directory:
|
40
|
+
|
41
|
+
# change the group of the public folder from nginx to app_writers
|
42
|
+
sudo chown :app_writers public
|
43
|
+
|
44
|
+
#change the permissions on the folder to 775
|
45
|
+
sudo chmod 775 public
|
34
46
|
|
35
47
|
=== SEO Features
|
36
48
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@import "jquery-ui"
|
2
|
+
@import "codemirror"
|
3
|
+
@import "bootstrap-sprockets"
|
4
|
+
@import "bootstrap"
|
5
|
+
@import "comfy/admin/cms/lib/redactor"
|
6
|
+
@import "comfy/admin/cms/lib/bootstrap-datetimepicker"
|
7
|
+
@import "comfy/admin/cms/bootstrap_overrides"
|
8
|
+
@import "comfy/admin/cms/codemirror_overrides"
|
9
|
+
@import "comfy/admin/cms/redactor_overrides"
|
10
|
+
@import "comfy/admin/cms/base"
|
11
|
+
@import "comfy/admin/cms/seo_form"
|
12
|
+
@import "comfy/admin/cms/custom"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#seo_tab_title_logo,
|
2
|
+
#seo_tab_title_contact,
|
3
|
+
#seo_tab_title_profiles
|
4
|
+
display: block
|
5
|
+
float: left
|
6
|
+
padding: 10px
|
7
|
+
color: blue
|
8
|
+
text-decoration: underline
|
9
|
+
|
10
|
+
#seo_tab_title_logo.seo_tab_title_clicked,
|
11
|
+
#seo_tab_title_contact.seo_tab_title_clicked,
|
12
|
+
#seo_tab_title_profiles.seo_tab_title_clicked
|
13
|
+
@extend #seo_tab_title_logo
|
14
|
+
color: green
|
15
|
+
text-decoration: none
|
16
|
+
|
17
|
+
.seo_tab_content
|
18
|
+
border: 1px solid black
|
19
|
+
clear: left
|
20
|
+
padding: 5px
|
21
|
+
margin-bottom: 10px
|
22
|
+
|
23
|
+
.seo_logo
|
24
|
+
display: block
|
25
|
+
h5
|
26
|
+
color: green
|
27
|
+
|
28
|
+
.seo_contact,
|
29
|
+
.seo_profiles
|
30
|
+
display: none
|
31
|
+
h5
|
32
|
+
color: green
|
33
|
+
|
34
|
+
#add_corporate_contact
|
35
|
+
@extend #seo_tab_title_logo
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class Comfy::Admin::Cms::SeoSnippetsController < Comfy::Admin::Cms::BaseController
|
2
|
+
|
3
|
+
before_action :authorize
|
4
|
+
|
5
|
+
def index
|
6
|
+
raise NotImplementedError, "You should never see this, use Snippet Index instead"
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@seo_snippet = SeoSnippet.new
|
11
|
+
render
|
12
|
+
end
|
13
|
+
|
14
|
+
def create
|
15
|
+
@seo_snippet = SeoSnippet.new(params[:seo_snippet])
|
16
|
+
if seo_snippet_enhanced_params_are_valid?(params[:seo_snippet])
|
17
|
+
WriteSeoSnippet.write_snippet(params)
|
18
|
+
@snippet = @site.snippets.new(params.fetch(:snippet, {}).permit!)
|
19
|
+
@snippet.save!
|
20
|
+
flash[:success] = I18n.t('comfy.admin.cms.snippets.created')
|
21
|
+
redirect_to controller: 'snippets', action: 'edit', id: @snippet
|
22
|
+
else
|
23
|
+
array=[]
|
24
|
+
@seo_snippet.errors.messages.each do |error_key, error_message|
|
25
|
+
array << I18n.t('seo_snippet.'+error_key.to_s+'.'+error_message.join)
|
26
|
+
end
|
27
|
+
flash.now[:danger] = array.join(', ')
|
28
|
+
render :action => :new
|
29
|
+
end
|
30
|
+
rescue ActiveRecord::RecordInvalid
|
31
|
+
flash.now[:danger] = I18n.t('comfy.admin.cms.snippets.creation_failure')
|
32
|
+
render :action => :new
|
33
|
+
end
|
34
|
+
|
35
|
+
protected
|
36
|
+
|
37
|
+
def enhance_seo_snippet(seo_params)
|
38
|
+
@seo_snippet.url = seo_params[:url]
|
39
|
+
@seo_snippet.label = seo_params[:label]
|
40
|
+
end
|
41
|
+
|
42
|
+
def validate_corporate_contacts
|
43
|
+
contacts_error_hash = @seo_snippet.corporate_contacts_validator
|
44
|
+
unless contacts_error_hash.empty?
|
45
|
+
contacts_error_hash.each do |error_name, error_message|
|
46
|
+
@seo_snippet.errors.add(error_name, error_message)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def seo_snippet_enhanced_params_are_valid?(seo_params)
|
52
|
+
enhance_seo_snippet(seo_params)
|
53
|
+
# .valid? overrides validate_corporate_contacts, so don't switch the order!
|
54
|
+
@seo_snippet.valid?
|
55
|
+
validate_corporate_contacts
|
56
|
+
return @seo_snippet.errors.empty?
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CorporateContact
|
2
|
+
include ActiveModel::Model
|
3
|
+
|
4
|
+
|
5
|
+
attr_accessor :telephone, :contact_url, :contact_type, :area_served,
|
6
|
+
:available_language
|
7
|
+
|
8
|
+
validates :telephone,
|
9
|
+
format: { with: /(\A\+[1-9][\d*| *|\-]+\z|\A\z)/,
|
10
|
+
message: 'international_number'},
|
11
|
+
absence: { if: Proc.new{|u| u.contact_type.blank? },
|
12
|
+
message: 'contact_type_blank' }
|
13
|
+
validates :contact_url,
|
14
|
+
absence: { if: Proc.new{|u| u.contact_type.blank? },
|
15
|
+
message: 'contact_type_blank' }
|
16
|
+
validates :area_served,
|
17
|
+
absence: { if: Proc.new{|u| !u.area_served.join.blank? && u.contact_type.blank? },
|
18
|
+
message: 'contact_type_blank' }
|
19
|
+
validates :available_language,
|
20
|
+
absence: { if: Proc.new{|u| !u.available_language.join.blank? && u.contact_type.blank? },
|
21
|
+
message: 'contact_type_blank' }
|
22
|
+
validates :contact_type,
|
23
|
+
absence: { if: Proc.new{|u| u.telephone.blank? && u.contact_url.blank? },
|
24
|
+
message: 'blank' }
|
25
|
+
end
|
@@ -0,0 +1,255 @@
|
|
1
|
+
class CountryCodes
|
2
|
+
def self.all_country_codes
|
3
|
+
codes = []
|
4
|
+
codes << ['Germany', 'DE']
|
5
|
+
codes << ['France', 'FR']
|
6
|
+
codes << ['Spain', 'ES']
|
7
|
+
codes << ['Italy', 'IT']
|
8
|
+
codes << ['United Kingdom of Great Britain and Northern Ireland', 'GB']
|
9
|
+
codes << ['Afghanistan', 'AF']
|
10
|
+
codes << ['Åland Islands', 'AX']
|
11
|
+
codes << ['Albania', 'AL']
|
12
|
+
codes << ['Algeria', 'DZ']
|
13
|
+
codes << ['American Samoa', 'AS']
|
14
|
+
codes << ['Andorra', 'AD']
|
15
|
+
codes << ['Angola', 'AO']
|
16
|
+
codes << ['Anguilla', 'AI']
|
17
|
+
codes << ['Antarctica', 'AQ']
|
18
|
+
codes << ['Antigua and Barbuda', 'AG']
|
19
|
+
codes << ['Argentina', 'AR']
|
20
|
+
codes << ['Armenia', 'AM']
|
21
|
+
codes << ['Aruba', 'AW']
|
22
|
+
codes << ['Australia', 'AU']
|
23
|
+
codes << ['Austria', 'AT']
|
24
|
+
codes << ['Azerbaijan', 'AZ']
|
25
|
+
codes << ['Bahamas', 'BS']
|
26
|
+
codes << ['Bahrain', 'BH']
|
27
|
+
codes << ['Bangladesh', 'BD']
|
28
|
+
codes << ['Barbados', 'BB']
|
29
|
+
codes << ['Belarus', 'BY']
|
30
|
+
codes << ['Belgium', 'BE']
|
31
|
+
codes << ['Belize', 'BZ']
|
32
|
+
codes << ['Benin', 'BJ']
|
33
|
+
codes << ['Bermuda', 'BM']
|
34
|
+
codes << ['Bhutan', 'BT']
|
35
|
+
codes << ['Bolivia, Plurinational State of', 'BO']
|
36
|
+
codes << ['Bonaire, Sint Eustatius and Saba', 'BQ']
|
37
|
+
codes << ['Bosnia and Herzegovina', 'BA']
|
38
|
+
codes << ['Botswana', 'BW']
|
39
|
+
codes << ['Bouvet Island', 'BV']
|
40
|
+
codes << ['Brazil', 'BR']
|
41
|
+
codes << ['British Indian Ocean Territory', 'IO']
|
42
|
+
codes << ['Brunei Darussalam', 'BN']
|
43
|
+
codes << ['Bulgaria', 'BG']
|
44
|
+
codes << ['Burkina Faso', 'BF']
|
45
|
+
codes << ['Burundi', 'BI']
|
46
|
+
codes << ['Cabo Verde', 'CV']
|
47
|
+
codes << ['Cambodia', 'KH']
|
48
|
+
codes << ['Cameroon', 'CM']
|
49
|
+
codes << ['Canada', 'CA']
|
50
|
+
codes << ['Cayman Islands', 'KY']
|
51
|
+
codes << ['Central African Republic', 'CF']
|
52
|
+
codes << ['Chad', 'TD']
|
53
|
+
codes << ['Chile', 'CL']
|
54
|
+
codes << ['China', 'CN']
|
55
|
+
codes << ['Christmas Island', 'CX']
|
56
|
+
codes << ['Cocos (Keeling) Islands', 'CC']
|
57
|
+
codes << ['Colombia', 'CO']
|
58
|
+
codes << ['Comoros', 'KM']
|
59
|
+
codes << ['Congo, the Democratic Republic of the', 'CD']
|
60
|
+
codes << ['Congo', 'CG']
|
61
|
+
codes << ['Cook Islands', 'CK']
|
62
|
+
codes << ['Costa Rica', 'CR']
|
63
|
+
codes << ['Côte d\'Ivoire', 'CI']
|
64
|
+
codes << ['Croatia', 'HR']
|
65
|
+
codes << ['Cuba', 'CU']
|
66
|
+
codes << ['Curaçao', 'CW']
|
67
|
+
codes << ['Cyprus', 'CY']
|
68
|
+
codes << ['Czech Republic', 'CZ']
|
69
|
+
codes << ['Denmark', 'DK']
|
70
|
+
codes << ['Djibouti', 'DJ']
|
71
|
+
codes << ['Dominica', 'DM']
|
72
|
+
codes << ['Dominican Republic', 'DO']
|
73
|
+
codes << ['Ecuador', 'EC']
|
74
|
+
codes << ['Egypt', 'EG']
|
75
|
+
codes << ['El Salvador', 'SV']
|
76
|
+
codes << ['Equatorial Guinea', 'GQ']
|
77
|
+
codes << ['Eritrea', 'ER']
|
78
|
+
codes << ['Estonia', 'EE']
|
79
|
+
codes << ['Ethiopia', 'ET']
|
80
|
+
codes << ['Falkland Islands (Malvinas)', 'FK']
|
81
|
+
codes << ['Faroe Islands', 'FO']
|
82
|
+
codes << ['Fiji', 'FJ']
|
83
|
+
codes << ['Finland', 'FI']
|
84
|
+
codes << ['French Guiana', 'GF']
|
85
|
+
codes << ['French Polynesia', 'PF']
|
86
|
+
codes << ['French Southern Territories', 'TF']
|
87
|
+
codes << ['Gabon', 'GA']
|
88
|
+
codes << ['Gambia', 'GM']
|
89
|
+
codes << ['Georgia', 'GE']
|
90
|
+
codes << ['Ghana', 'GH']
|
91
|
+
codes << ['Gibraltar', 'GI']
|
92
|
+
codes << ['Greece', 'GR']
|
93
|
+
codes << ['Greenland', 'GL']
|
94
|
+
codes << ['Grenada', 'GD']
|
95
|
+
codes << ['Guadeloupe', 'GP']
|
96
|
+
codes << ['Guam', 'GU']
|
97
|
+
codes << ['Guatemala', 'GT']
|
98
|
+
codes << ['Guernsey', 'GG']
|
99
|
+
codes << ['Guinea-Bissau', 'GW']
|
100
|
+
codes << ['Guinea', 'GN']
|
101
|
+
codes << ['Guyana', 'GY']
|
102
|
+
codes << ['Haiti', 'HT']
|
103
|
+
codes << ['Heard Island and McDonald Islands', 'HM']
|
104
|
+
codes << ['Holy See', 'VA']
|
105
|
+
codes << ['Honduras', 'HN']
|
106
|
+
codes << ['Hong Kong', 'HK']
|
107
|
+
codes << ['Hungary', 'HU']
|
108
|
+
codes << ['Iceland', 'IS']
|
109
|
+
codes << ['India', 'IN']
|
110
|
+
codes << ['Indonesia', 'ID']
|
111
|
+
codes << ['Iran, Islamic Republic of', 'IR']
|
112
|
+
codes << ['Iraq', 'IQ']
|
113
|
+
codes << ['Ireland', 'IE']
|
114
|
+
codes << ['Isle of Man', 'IM']
|
115
|
+
codes << ['Israel', 'IL']
|
116
|
+
codes << ['Jamaica', 'JM']
|
117
|
+
codes << ['Japan', 'JP']
|
118
|
+
codes << ['Jersey', 'JE']
|
119
|
+
codes << ['Jordan', 'JO']
|
120
|
+
codes << ['Kazakhstan', 'KZ']
|
121
|
+
codes << ['Kenya', 'KE']
|
122
|
+
codes << ['Kiribati', 'KI']
|
123
|
+
codes << ['Korea, Democratic People\'s Republic of', 'KP']
|
124
|
+
codes << ['Korea, Republic of', 'KR']
|
125
|
+
codes << ['Kuwait', 'KW']
|
126
|
+
codes << ['Kyrgyzstan', 'KG']
|
127
|
+
codes << ['Lao People\'s Democratic Republic', 'LA']
|
128
|
+
codes << ['Latvia', 'LV']
|
129
|
+
codes << ['Lebanon', 'LB']
|
130
|
+
codes << ['Lesotho', 'LS']
|
131
|
+
codes << ['Liberia', 'LR']
|
132
|
+
codes << ['Libya', 'LY']
|
133
|
+
codes << ['Liechtenstein', 'LI']
|
134
|
+
codes << ['Lithuania', 'LT']
|
135
|
+
codes << ['Luxembourg', 'LU']
|
136
|
+
codes << ['Macao', 'MO']
|
137
|
+
codes << ['Macedonia, the former Yugoslav Republic of', 'MK']
|
138
|
+
codes << ['Madagascar', 'MG']
|
139
|
+
codes << ['Malawi', 'MW']
|
140
|
+
codes << ['Malaysia', 'MY']
|
141
|
+
codes << ['Maldives', 'MV']
|
142
|
+
codes << ['Mali', 'ML']
|
143
|
+
codes << ['Malta', 'MT']
|
144
|
+
codes << ['Marshall Islands', 'MH']
|
145
|
+
codes << ['Martinique', 'MQ']
|
146
|
+
codes << ['Mauritania', 'MR']
|
147
|
+
codes << ['Mauritius', 'MU']
|
148
|
+
codes << ['Mayotte', 'YT']
|
149
|
+
codes << ['Mexico', 'MX']
|
150
|
+
codes << ['Micronesia, Federated States of', 'FM']
|
151
|
+
codes << ['Moldova, Republic of', 'MD']
|
152
|
+
codes << ['Monaco', 'MC']
|
153
|
+
codes << ['Mongolia', 'MN']
|
154
|
+
codes << ['Montenegro', 'ME']
|
155
|
+
codes << ['Montserrat', 'MS']
|
156
|
+
codes << ['Morocco', 'MA']
|
157
|
+
codes << ['Mozambique', 'MZ']
|
158
|
+
codes << ['Myanmar', 'MM']
|
159
|
+
codes << ['Namibia ', 'NA']
|
160
|
+
codes << ['Nauru', 'NR']
|
161
|
+
codes << ['Nepal', 'NP']
|
162
|
+
codes << ['Netherlands', 'NL']
|
163
|
+
codes << ['New Caledonia', 'NC']
|
164
|
+
codes << ['New Zealand', 'NZ']
|
165
|
+
codes << ['Nicaragua', 'NI']
|
166
|
+
codes << ['Niger', 'NE']
|
167
|
+
codes << ['Nigeria', 'NG']
|
168
|
+
codes << ['Niue', 'NU']
|
169
|
+
codes << ['Norfolk Island', 'NF']
|
170
|
+
codes << ['Northern Mariana Islands', 'MP']
|
171
|
+
codes << ['Norway', 'NO']
|
172
|
+
codes << ['Oman', 'OM']
|
173
|
+
codes << ['Pakistan', 'PK']
|
174
|
+
codes << ['Palau', 'PW']
|
175
|
+
codes << ['Palestine, State of', 'PS']
|
176
|
+
codes << ['Panama', 'PA']
|
177
|
+
codes << ['Papua New Guinea', 'PG']
|
178
|
+
codes << ['Paraguay', 'PY']
|
179
|
+
codes << ['Peru', 'PE']
|
180
|
+
codes << ['Philippines', 'PH']
|
181
|
+
codes << ['Pitcairn', 'PN']
|
182
|
+
codes << ['Poland', 'PL']
|
183
|
+
codes << ['Portugal', 'PT']
|
184
|
+
codes << ['Puerto Rico', 'PR']
|
185
|
+
codes << ['Qatar', 'QA']
|
186
|
+
codes << ['Réunion', 'RE']
|
187
|
+
codes << ['Romania', 'RO']
|
188
|
+
codes << ['Russian Federation', 'RU']
|
189
|
+
codes << ['Rwanda', 'RW']
|
190
|
+
codes << ['Saint Barthélemy', 'BL']
|
191
|
+
codes << ['Saint Helena, Ascension and Tristan da Cunha', 'SH']
|
192
|
+
codes << ['Saint Kitts and Nevis', 'KN']
|
193
|
+
codes << ['Saint Lucia', 'LC']
|
194
|
+
codes << ['Saint Martin (French part)', 'MF']
|
195
|
+
codes << ['Saint Pierre and Miquelon', 'PM']
|
196
|
+
codes << ['Saint Vincent and the Grenadines', 'VC']
|
197
|
+
codes << ['Samoa', 'WS']
|
198
|
+
codes << ['San Marino', 'SM']
|
199
|
+
codes << ['Sao Tome and Principe', 'ST']
|
200
|
+
codes << ['Saudi Arabia', 'SA']
|
201
|
+
codes << ['Senegal', 'SN']
|
202
|
+
codes << ['Serbia', 'RS']
|
203
|
+
codes << ['Seychelles', 'SC']
|
204
|
+
codes << ['Sierra Leone', 'SL']
|
205
|
+
codes << ['Singapore', 'SG']
|
206
|
+
codes << ['Sint Maarten (Dutch part)', 'SX']
|
207
|
+
codes << ['Slovakia', 'SK']
|
208
|
+
codes << ['Slovenia', 'SI']
|
209
|
+
codes << ['Solomon Islands', 'SB']
|
210
|
+
codes << ['Somalia', 'SO']
|
211
|
+
codes << ['South Africa', 'ZA']
|
212
|
+
codes << ['South Georgia and the South Sandwich Islands', 'GS']
|
213
|
+
codes << ['South Sudan', 'SS']
|
214
|
+
codes << ['Sri Lanka', 'LK']
|
215
|
+
codes << ['Sudan', 'SD']
|
216
|
+
codes << ['Suriname', 'SR']
|
217
|
+
codes << ['Svalbard and Jan Mayen', 'SJ']
|
218
|
+
codes << ['Swaziland', 'SZ']
|
219
|
+
codes << ['Sweden', 'SE']
|
220
|
+
codes << ['Switzerland', 'CH']
|
221
|
+
codes << ['Syrian Arab Republic', 'SY']
|
222
|
+
codes << ['Taiwan, Province of China', 'TW']
|
223
|
+
codes << ['Tajikistan', 'TJ']
|
224
|
+
codes << ['Tanzania, United Republic of', 'TZ']
|
225
|
+
codes << ['Thailand', 'TH']
|
226
|
+
codes << ['Timor-Leste', 'TL']
|
227
|
+
codes << ['Togo', 'TG']
|
228
|
+
codes << ['Tokelau', 'TK']
|
229
|
+
codes << ['Tonga', 'TO']
|
230
|
+
codes << ['Trinidad and Tobago', 'TT']
|
231
|
+
codes << ['Tunisia', 'TN']
|
232
|
+
codes << ['Turkey', 'TR']
|
233
|
+
codes << ['Turkmenistan', 'TM']
|
234
|
+
codes << ['Turks and Caicos Islands', 'TC']
|
235
|
+
codes << ['Tuvalu', 'TV']
|
236
|
+
codes << ['Uganda', 'UG']
|
237
|
+
codes << ['Ukraine', 'UA']
|
238
|
+
codes << ['United Arab Emirates', 'AE']
|
239
|
+
codes << ['United States Minor Outlying Islands', 'UM']
|
240
|
+
codes << ['United States of America', 'US']
|
241
|
+
codes << ['Uruguay', 'UY']
|
242
|
+
codes << ['Uzbekistan', 'UZ']
|
243
|
+
codes << ['Vanuatu', 'VU']
|
244
|
+
codes << ['Venezuela, Bolivarian Republic of', 'VE']
|
245
|
+
codes << ['Viet Nam', 'VN']
|
246
|
+
codes << ['Virgin Islands, British', 'VG']
|
247
|
+
codes << ['Virgin Islands, U.S.', 'VI']
|
248
|
+
codes << ['Wallis and Futuna', 'WF']
|
249
|
+
codes << ['Western Sahara', 'EH']
|
250
|
+
codes << ['Yemen', 'YE']
|
251
|
+
codes << ['Zambia', 'ZM']
|
252
|
+
codes << ['Zimbabwe', 'ZW']
|
253
|
+
codes
|
254
|
+
end
|
255
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
class SeoSnippet
|
2
|
+
include ActiveModel::Model
|
3
|
+
extend ActiveModel::Naming
|
4
|
+
|
5
|
+
DEFAULT_PARAMS = {
|
6
|
+
"corporate_contacts_attributes" => {"0" => {}},
|
7
|
+
"label" => "seo_snippet",
|
8
|
+
"context" => "http://schema.org",
|
9
|
+
"type" => "Organization"
|
10
|
+
}
|
11
|
+
|
12
|
+
attr_accessor :label, :context, :type, :url, :logo, :facebook_url, :twitter_url, :google_plus_url,
|
13
|
+
:instagram_url, :pinterest_url, :linkedin_url, :youtube_url, :corporate_contacts,
|
14
|
+
:corporate_contacts_attributes
|
15
|
+
|
16
|
+
validates :url, :context, :type, presence: true
|
17
|
+
validates :label, presence: true,
|
18
|
+
format: { with: /\A[^\s]+\z/, message: 'blanks'}
|
19
|
+
|
20
|
+
def initialize(params={})
|
21
|
+
params = DEFAULT_PARAMS.merge(params)
|
22
|
+
super # calls (amongst other methods): corporate_contacts_attributes=(attrs)
|
23
|
+
end
|
24
|
+
|
25
|
+
def corporate_contacts_attributes=(attrs)
|
26
|
+
self.corporate_contacts = attrs.values.map do |cc|
|
27
|
+
CorporateContact.new(cc)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def corporate_contacts_validator
|
32
|
+
error_hash = {}
|
33
|
+
@corporate_contacts.each do |contact|
|
34
|
+
unless contact.valid?
|
35
|
+
contact.errors.messages.each do |error_name, error_message|
|
36
|
+
error_hash[error_name] = error_message.join
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
return error_hash
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
class WriteSeoSnippet
|
2
|
+
# Writes a json script for structured data (https://developers.google.com/structured-data/)
|
3
|
+
# => The script can have three parts: logo, corporate contacts and social profiles
|
4
|
+
# => The finished script unites all this parts in one script, where @type, @context and url are mandatory
|
5
|
+
# => In the end (with all parts included) it looks like this:
|
6
|
+
|
7
|
+
# <script type="application/ld+json">
|
8
|
+
# {
|
9
|
+
# "@context": "http://schema.org",
|
10
|
+
# "@type": "Organization",
|
11
|
+
# "url": "http://www.example.com",
|
12
|
+
# "logo": "http://www.example.com/images/logo.png",
|
13
|
+
# "contactPoint" : [{
|
14
|
+
# "@type" : "ContactPoint",
|
15
|
+
# "telephone" : "+1-401-555-1212",
|
16
|
+
# "contactType" : "customer service"
|
17
|
+
# }],
|
18
|
+
# "sameAs" : [
|
19
|
+
# "http://www.facebook.com/your-profile",
|
20
|
+
# "http://www.twitter.com/yourProfile",
|
21
|
+
# "http://plus.google.com/your_profile"
|
22
|
+
# ]
|
23
|
+
# }
|
24
|
+
# </script>
|
25
|
+
|
26
|
+
# Important:
|
27
|
+
# => Redundant commas crashes json script
|
28
|
+
# => Corporate contacts must have url or telephone to be valid
|
29
|
+
|
30
|
+
class << self
|
31
|
+
def write_snippet(params)
|
32
|
+
handle_params(params)
|
33
|
+
end
|
34
|
+
|
35
|
+
def handle_params(params)
|
36
|
+
time = Time.new.strftime("%m-%d-%Y_%H%M%S")
|
37
|
+
params[:snippet] = {}
|
38
|
+
params[:snippet][:label] = "#{params[:seo_snippet][:label]}_#{time}"
|
39
|
+
params[:snippet][:identifier] = "#{params[:seo_snippet][:label]}_#{time}"
|
40
|
+
params[:snippet][:content] = seo_scripter(params).to_s
|
41
|
+
params
|
42
|
+
end
|
43
|
+
|
44
|
+
def seo_scripter(params)
|
45
|
+
mandatory_and_logo, contacts, profile = fill_content(params)
|
46
|
+
|
47
|
+
seo_script = ''
|
48
|
+
seo_script << '<script type="application/ld+json">'
|
49
|
+
seo_script << '{'
|
50
|
+
mandatory_and_logo.each do |k,v|
|
51
|
+
unless v.blank?
|
52
|
+
if k == 'context' || k == 'type'
|
53
|
+
seo_script << '"@'+k+'" : "'+v+'"'
|
54
|
+
else
|
55
|
+
seo_script << '"'+k+'" : "'+v+'"'
|
56
|
+
end
|
57
|
+
seo_script << ','
|
58
|
+
end
|
59
|
+
end
|
60
|
+
seo_script << '"contactPoint" : [{'
|
61
|
+
contacts.each do |contact_number, contact_content|
|
62
|
+
puts 'contact:'
|
63
|
+
puts contact_content
|
64
|
+
seo_script << '"@type" : "ContactPoint"'
|
65
|
+
contact_content.each do |k,v|
|
66
|
+
#v counter to check if all v blank, to delete seo_script << '"@type" : "ContactPoint",'
|
67
|
+
if v.class == Array
|
68
|
+
unless v.join.blank?
|
69
|
+
seo_script << ','
|
70
|
+
new_v = delete_select_attributes_empty_quotes(v)
|
71
|
+
(seo_script << '"'+k+'" : ['+new_v+']') unless new_v.blank?
|
72
|
+
end
|
73
|
+
else
|
74
|
+
unless v.blank?
|
75
|
+
seo_script << ','
|
76
|
+
v.gsub!(/_/, ' ')
|
77
|
+
seo_script << '"'+k+'" : "'+v+'"'
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
seo_script << '},{'
|
82
|
+
end
|
83
|
+
seo_script << '}]'
|
84
|
+
seo_script.gsub!(/,\{\}/, '')
|
85
|
+
seo_script << ',"sameAs" : ['
|
86
|
+
profile.each do |url|
|
87
|
+
unless url.blank?
|
88
|
+
seo_script << '"'+url+'"'
|
89
|
+
seo_script << ','
|
90
|
+
end
|
91
|
+
end
|
92
|
+
seo_script.chop!
|
93
|
+
seo_script << ']'
|
94
|
+
seo_script << '}'
|
95
|
+
seo_script << '</script>'
|
96
|
+
new_seo_script = delete_script_errors(seo_script)
|
97
|
+
new_seo_script
|
98
|
+
end
|
99
|
+
|
100
|
+
def fill_content(params)
|
101
|
+
mandatory_and_logo = {}
|
102
|
+
mandatory_and_logo['context'] = params[:seo_snippet][:context]
|
103
|
+
mandatory_and_logo['type'] = params[:seo_snippet][:type]
|
104
|
+
mandatory_and_logo['url'] = params[:seo_snippet][:url]
|
105
|
+
mandatory_and_logo['logo'] = params[:seo_snippet][:logo]
|
106
|
+
contacts = {}
|
107
|
+
params[:seo_snippet][:corporate_contacts_attributes].each do |contact_id, contact_values|
|
108
|
+
contacts[contact_id] = {}
|
109
|
+
contacts[contact_id]['contactType'] = contact_values[:contact_type]
|
110
|
+
contacts[contact_id]['telephone'] = contact_values[:telephone]
|
111
|
+
contacts[contact_id]['url'] = contact_values[:contact_url]
|
112
|
+
contacts[contact_id]['areaServed'] = contact_values[:area_served]
|
113
|
+
contacts[contact_id]['availableLanguage'] = contact_values[:available_language]
|
114
|
+
end
|
115
|
+
profile = []
|
116
|
+
profile << params[:seo_snippet][:facebook_url]
|
117
|
+
profile << params[:seo_snippet][:twitter_url]
|
118
|
+
profile << params[:seo_snippet][:google_plus_url]
|
119
|
+
profile << params[:seo_snippet][:instagram_url]
|
120
|
+
profile << params[:seo_snippet][:pinterest_url]
|
121
|
+
profile << params[:seo_snippet][:linkedin_url]
|
122
|
+
profile << params[:seo_snippet][:youtube_url]
|
123
|
+
return mandatory_and_logo, contacts, profile
|
124
|
+
end
|
125
|
+
|
126
|
+
def delete_select_attributes_empty_quotes(v)
|
127
|
+
v.join('","')
|
128
|
+
num = v.index("")
|
129
|
+
v.slice!(num) unless num.nil?
|
130
|
+
v.to_s
|
131
|
+
end
|
132
|
+
|
133
|
+
def delete_script_errors(seo_script)
|
134
|
+
seo_script.sub!(/,"sameAs" : \]/, '')
|
135
|
+
seo_script.sub!(/,"contactPoint" : \[\{"@type" : "ContactPoint"\}\]/, '')
|
136
|
+
seo_script.sub!(/,\{"@type" : "ContactPoint"\}/, '')
|
137
|
+
seo_script
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
= render 'comfy/admin/cms/partials/navigation_before'
|
2
|
+
|
3
|
+
%ul.navigation
|
4
|
+
%li= active_link_to t('comfy.admin.cms.base.sites'), comfy_admin_cms_sites_path, :active => ['comfy/admin/cms/sites']
|
5
|
+
|
6
|
+
- if @site && !@site.new_record?
|
7
|
+
%li= active_link_to t('comfy.admin.cms.base.layouts'), comfy_admin_cms_site_layouts_path(@site)
|
8
|
+
%li= active_link_to t('comfy.admin.cms.base.pages'), comfy_admin_cms_site_pages_path(@site)
|
9
|
+
%li= active_link_to t('comfy.admin.cms.base.snippets'), comfy_admin_cms_site_snippets_path(@site)
|
10
|
+
%li
|
11
|
+
- unless is_active_link?(comfy_admin_cms_site_files_path(@site))
|
12
|
+
%a.cms-files-open-modal{:href => '#', :title => 'Open library'}
|
13
|
+
%span.glyphicon.glyphicon-th-list
|
14
|
+
= active_link_to t('comfy.admin.cms.base.files'), comfy_admin_cms_site_files_path(@site)
|
15
|
+
|
16
|
+
= cms_hook :navigation
|
17
|
+
|
18
|
+
= render 'comfy/admin/cms/partials/navigation_inner'
|
19
|
+
|
20
|
+
= render 'comfy/admin/cms/partials/navigation_after'
|
@@ -30,3 +30,12 @@
|
|
30
30
|
- rescue
|
31
31
|
- Rails.env.production?? nil : raise
|
32
32
|
- block_index += 1
|
33
|
+
%div
|
34
|
+
- if name === 'seo'
|
35
|
+
= t('seo.note').html_safe
|
36
|
+
- if name === 'google_plus'
|
37
|
+
= t('google_plus.note').html_safe
|
38
|
+
- elsif name === 'twitter'
|
39
|
+
= t('twitter.note').html_safe
|
40
|
+
- elsif name === 'facebook'
|
41
|
+
= t('facebook.note').html_safe
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.form-group
|
2
|
+
.col-sm-10
|
3
|
+
= form.select('contact_type', options_for_select(['baggage_tracking', 'bill_payment', 'billing_support', 'credit_card_support', 'customer_support', 'emergency', 'package_tracking', 'reservations', 'roadside_assistance', 'technical_support', 'sales']), {prompt: 'Please select', class: 'form-control'})
|
4
|
+
.form-group
|
5
|
+
.col-sm-10
|
6
|
+
= form.telephone_field(:telephone, placeholder: '+49-401-555-1212', class: 'form-control')
|
7
|
+
.form-group
|
8
|
+
.col-sm-10
|
9
|
+
= form.url_field(:contact_url, placeholder: 'https://domain/contact', class: 'form-control')
|
10
|
+
.form-group
|
11
|
+
.col-sm-10
|
12
|
+
= form.select('area_served', options_for_select(CountryCodes.all_country_codes), {prompt: 'Please use command or ctrl/strl to add:'}, {multiple: true, class: 'form-control'})
|
13
|
+
.form-group
|
14
|
+
.col-sm-10
|
15
|
+
= form.select('available_language', options_for_select([['German','German'],['Dutch','Dutch'],['English','English'],['French','French'],['Spanish','Spanish']]), {prompt: 'Please use command or ctrl/strl to add:'}, {multiple: true, class: 'form-control'})
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.form-group
|
2
|
+
.control-label.col-sm-2
|
3
|
+
= form.label('Contact type')
|
4
|
+
.col-sm-10
|
5
|
+
= form.select('contact_type', options_for_select(['baggage_tracking', 'bill_payment', 'billing_support', 'credit_card_support', 'customer_support', 'emergency', 'package_tracking', 'reservations', 'roadside_assistance', 'technical_support', 'sales']), {prompt: 'Please select', class: 'form-control form-control'})
|
6
|
+
.form-group
|
7
|
+
.control-label.col-sm-2
|
8
|
+
= form.label('Telephone')
|
9
|
+
.col-sm-10
|
10
|
+
= form.telephone_field(:telephone, placeholder: '+49-401-555-1212', class: 'form-control')
|
11
|
+
.form-group
|
12
|
+
.control-label.col-sm-2
|
13
|
+
= form.label('Contact url')
|
14
|
+
.col-sm-10
|
15
|
+
= form.url_field(:contact_url, placeholder: 'https://domain/contact', class: 'form-control')
|
16
|
+
.form-group
|
17
|
+
.control-label.col-sm-2
|
18
|
+
= form.label('Area served')
|
19
|
+
.col-sm-10
|
20
|
+
= form.select('area_served', options_for_select(CountryCodes.all_country_codes), {prompt: 'Please use command or ctrl/strl to add:'}, {multiple: true, class: 'form-control'})
|
21
|
+
.form-group
|
22
|
+
.control-label.col-sm-2
|
23
|
+
= form.label('Available language')
|
24
|
+
.col-sm-10
|
25
|
+
= form.select('available_language', options_for_select([['German','German'],['English','English'],['French','French'],['Spanish','Spanish'],['Dutch','Dutch']]), {prompt: 'Please use command or ctrl/strl to add:'}, {multiple: true, class: 'form-control'})
|
@@ -0,0 +1,91 @@
|
|
1
|
+
%section
|
2
|
+
.form-horizontal
|
3
|
+
.form-group
|
4
|
+
.col-sm-10
|
5
|
+
= form.text_field(:label, class: 'form-control')
|
6
|
+
.form-group
|
7
|
+
.col-sm-10
|
8
|
+
= form.text_field(:context, class: 'form-control')
|
9
|
+
.form-group
|
10
|
+
.col-sm-10
|
11
|
+
= form.text_field(:type, class: 'form-control')
|
12
|
+
.form-group
|
13
|
+
.col-sm-10
|
14
|
+
= form.url_field(:url, placeholder:'http://www.example.com', class: 'form-control')
|
15
|
+
|
16
|
+
%section
|
17
|
+
#seo_tab_title_logo.seo_tab_title_clicked
|
18
|
+
Organization Logo
|
19
|
+
#seo_tab_title_contact
|
20
|
+
Corporate Contact
|
21
|
+
#seo_tab_title_profiles
|
22
|
+
Social Profiles
|
23
|
+
|
24
|
+
%section
|
25
|
+
.seo_tab_content
|
26
|
+
.seo_logo
|
27
|
+
%h5
|
28
|
+
Organization Logo
|
29
|
+
.form-horizontal
|
30
|
+
.form-group
|
31
|
+
.col-sm-10
|
32
|
+
= form.url_field(:logo, placeholder:'http://www.example.com/images/logo.png', class: 'form-control')
|
33
|
+
.seo_contact
|
34
|
+
.form-horizontal
|
35
|
+
= form.fields_for :corporate_contacts do |contact_form|
|
36
|
+
%h5
|
37
|
+
Corporate Contact
|
38
|
+
= render 'corporate_contact', form: contact_form
|
39
|
+
#add_corporate_contact Add another Corporate Contact
|
40
|
+
.seo_profiles
|
41
|
+
= render 'social_profiles'
|
42
|
+
|
43
|
+
= form.form_group :class => 'form-actions' do
|
44
|
+
/ add to yml file!!
|
45
|
+
= form.submit t('.create'), :class => 'btn btn-primary'
|
46
|
+
= link_to t('.cancel'), comfy_admin_cms_site_snippets_path, :class => 'btn btn-link'
|
47
|
+
|
48
|
+
= hidden_field_tag :number_of_contacts
|
49
|
+
|
50
|
+
:javascript
|
51
|
+
$(function() {
|
52
|
+
$(this).on('click', '#seo_tab_title_logo', function(event) {
|
53
|
+
event.preventDefault();
|
54
|
+
$(this).addClass('seo_tab_title_clicked')
|
55
|
+
$(this).siblings().removeClass('seo_tab_title_clicked')
|
56
|
+
$('.seo_logo').show();
|
57
|
+
$('.seo_contact').hide();
|
58
|
+
$('.seo_profiles').hide();
|
59
|
+
});
|
60
|
+
});
|
61
|
+
|
62
|
+
$(function() {
|
63
|
+
$(this).on('click', '#seo_tab_title_contact', function(event) {
|
64
|
+
event.preventDefault();
|
65
|
+
$(this).addClass('seo_tab_title_clicked')
|
66
|
+
$(this).siblings().removeClass('seo_tab_title_clicked')
|
67
|
+
$('.seo_logo').hide();
|
68
|
+
$('.seo_contact').show();
|
69
|
+
$('.seo_profiles').hide();
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
$(function() {
|
74
|
+
$(this).on('click', '#seo_tab_title_profiles', function(event) {
|
75
|
+
event.preventDefault();
|
76
|
+
$(this).addClass('seo_tab_title_clicked')
|
77
|
+
$(this).siblings().removeClass('seo_tab_title_clicked')
|
78
|
+
$('.seo_logo').hide();
|
79
|
+
$('.seo_contact').hide();
|
80
|
+
$('.seo_profiles').show();
|
81
|
+
});
|
82
|
+
});
|
83
|
+
|
84
|
+
$(function(){
|
85
|
+
$(this).on('click', '#add_corporate_contact', function(event) {
|
86
|
+
event.preventDefault();
|
87
|
+
var form = "#{ j(render('add_corporate_contact')).gsub(/[\n]/, ' ') }";
|
88
|
+
form = form.replace(/newcc/g, new Date().getTime());
|
89
|
+
$(this).before(form);
|
90
|
+
});
|
91
|
+
});
|
@@ -0,0 +1,38 @@
|
|
1
|
+
%h5
|
2
|
+
Social Profiles
|
3
|
+
.form-horizontal
|
4
|
+
.form-group
|
5
|
+
.control-label.col-sm-2
|
6
|
+
= label_tag('Facebook URL:')
|
7
|
+
.col-sm-10
|
8
|
+
= url_field(:seo_snippet, :facebook_url, placeholder: 'http://www.facebook.com/your-profile', class: 'form-control')
|
9
|
+
.form-group
|
10
|
+
.control-label.col-sm-2
|
11
|
+
= label_tag('Twitter URL:')
|
12
|
+
.col-sm-10
|
13
|
+
= url_field(:seo_snippet, :twitter_url, placeholder:'http://www.twitter.com/your-profile', class: 'form-control')
|
14
|
+
.form-group
|
15
|
+
.control-label.col-sm-2
|
16
|
+
= label_tag('Google+ URL:')
|
17
|
+
.col-sm-10
|
18
|
+
= url_field(:seo_snippet, :google_plus_url, placeholder:'http://www.plus.google.com/your-profile', class: 'form-control')
|
19
|
+
.form-group
|
20
|
+
.control-label.col-sm-2
|
21
|
+
= label_tag('Instagram URL:')
|
22
|
+
.col-sm-10
|
23
|
+
= url_field(:seo_snippet, :instagram_url, placeholder:'http://instagram.com/yourProfile', class: 'form-control')
|
24
|
+
.form-group
|
25
|
+
.control-label.col-sm-2
|
26
|
+
= label_tag('Pinterest URL:')
|
27
|
+
.col-sm-10
|
28
|
+
= url_field(:seo_snippet, :pinterest_url, placeholder:'Please write url here', class: 'form-control')
|
29
|
+
.form-group
|
30
|
+
.control-label.col-sm-2
|
31
|
+
= label_tag('LinkedIn URL:')
|
32
|
+
.col-sm-10
|
33
|
+
= url_field(:seo_snippet, :linkedin_url, placeholder:'http://www.linkedin.com/in/yourprofile', class: 'form-control')
|
34
|
+
.form-group
|
35
|
+
.control-label.col-sm-2
|
36
|
+
= label_tag('Youtube URL:')
|
37
|
+
.col-sm-10
|
38
|
+
= url_field(:seo_snippet, :youtube_url, placeholder:'Please write url here', class: 'form-control')
|
@@ -0,0 +1,33 @@
|
|
1
|
+
.page-header
|
2
|
+
= link_to t('.new_link'), new_comfy_admin_cms_site_snippet_path(@site), :class => 'btn btn-default pull-right'
|
3
|
+
= link_to 'Create SEO Snippet', new_comfy_admin_cms_site_seo_snippet_path(@site), :class => 'btn btn-default pull-right'
|
4
|
+
%h2= t('.title')
|
5
|
+
|
6
|
+
- content_for :right_column do
|
7
|
+
= render 'comfy/admin/cms/sites/mirrors'
|
8
|
+
|
9
|
+
= render 'comfy/admin/cms/partials/snippets_before'
|
10
|
+
|
11
|
+
= render :partial => 'comfy/admin/cms/categories/index', :object => 'Comfy::Cms::Snippet'
|
12
|
+
|
13
|
+
%table.table.table-hover.table-bordered
|
14
|
+
%tbody.sortable
|
15
|
+
- @snippets.each do |snippet|
|
16
|
+
%tr{:id => dom_id(snippet)}
|
17
|
+
%td
|
18
|
+
.icon
|
19
|
+
- if !params[:category].present? && @site.snippets.count > 1
|
20
|
+
.dragger
|
21
|
+
%span ⇅
|
22
|
+
%td.main
|
23
|
+
.item-title
|
24
|
+
= link_to snippet.label, edit_comfy_admin_cms_site_snippet_path(@site, snippet)
|
25
|
+
= render :partial => 'comfy/admin/cms/categories/categories', :object => snippet
|
26
|
+
.item-meta
|
27
|
+
= snippet.identifier
|
28
|
+
%td
|
29
|
+
.btn-group.btn-group-sm
|
30
|
+
= link_to t('.edit'), edit_comfy_admin_cms_site_snippet_path(@site, snippet), :class => 'btn btn-default'
|
31
|
+
= link_to t('.delete'), comfy_admin_cms_site_snippet_path(@site, snippet), :method => :delete, :data => {:confirm => t('.are_you_sure')}, :class => 'btn btn-danger'
|
32
|
+
|
33
|
+
= render 'comfy/admin/cms/partials/snippets_after'
|
data/config/locales/de.yml
CHANGED
@@ -1,30 +1,58 @@
|
|
1
1
|
de:
|
2
2
|
seo:
|
3
|
-
old_page_url: URLs die auf
|
3
|
+
old_page_url: URLs die auf diese Seite gehen
|
4
4
|
meta_description: Meta Beschreibung
|
5
5
|
page_title: Seiten Titel
|
6
6
|
canonical_href: kanonischer Link
|
7
7
|
google_plus:
|
8
|
-
name: Name (erbt von Seiten
|
9
|
-
description: Beschreibung
|
10
|
-
image: Bild
|
8
|
+
name: Name (erbt von Seiten Titel wenn leer)
|
9
|
+
description: Beschreibung
|
10
|
+
image: Bild
|
11
11
|
twitter:
|
12
|
-
site: Seite
|
13
|
-
title: Titel
|
14
|
-
description: Beschreibung
|
15
|
-
creator: Autor
|
16
|
-
image_src: Bildquelle
|
12
|
+
site: Seite
|
13
|
+
title: Titel
|
14
|
+
description: Beschreibung
|
15
|
+
creator: Autor
|
16
|
+
image_src: Bildquelle
|
17
17
|
facebook:
|
18
|
-
title: Titel
|
19
|
-
type: Art
|
20
|
-
image: Bild
|
21
|
-
description: Beschreibung
|
18
|
+
title: Titel
|
19
|
+
type: Art
|
20
|
+
image: Bild
|
21
|
+
description: Beschreibung
|
22
22
|
site_name: Seiten Name (erbt von Rootseite tab wenn leer)
|
23
|
-
admins: Admins
|
23
|
+
admins: Admins
|
24
24
|
devise:
|
25
25
|
signin: Login
|
26
26
|
admin:
|
27
27
|
roles:
|
28
28
|
sync_and_permit:
|
29
29
|
sync_and_permit: Rechte synchronisierung
|
30
|
-
|
30
|
+
seo_snippet:
|
31
|
+
label:
|
32
|
+
blanks: Label erlaubt keine Leerzeichen
|
33
|
+
context:
|
34
|
+
can't be blank: Context darf nicht leer sein
|
35
|
+
type:
|
36
|
+
can't be blank: Type darf nicht leer sein
|
37
|
+
url:
|
38
|
+
can't be blank: URL darf nicht leer sein
|
39
|
+
telephone:
|
40
|
+
contact_type_blank: Telephone benötigt Eingabe von Contact Type
|
41
|
+
international_number: Telephone lässt nur Zahlen mit internationalem Ländercode zu (wie +49)
|
42
|
+
available_language:
|
43
|
+
contact_type_blank: Available language benötigt Eingabe von Contact Type
|
44
|
+
contact_url:
|
45
|
+
contact_type_blank: Contact URL benötigt Eingabe von Contact Type
|
46
|
+
area_served:
|
47
|
+
contact_type_blank: Area served benötigt Eingabe von Contact Type
|
48
|
+
contact_type:
|
49
|
+
blank: Contact type benötigt Eingabe von Contact URL oder Telefon
|
50
|
+
comfy:
|
51
|
+
admin:
|
52
|
+
cms:
|
53
|
+
seo_snippets:
|
54
|
+
new:
|
55
|
+
title: SEO Schnipsel
|
56
|
+
seo_form:
|
57
|
+
create: Gestalte SEO Schnipsel
|
58
|
+
cancel: Abbruch
|
data/config/locales/en.yml
CHANGED
@@ -1,33 +1,63 @@
|
|
1
1
|
en:
|
2
|
-
comment_mailer:
|
3
|
-
admin_mention:
|
4
|
-
comment_link: Take me to the comment
|
5
|
-
subject: You were mentioned in a comment
|
6
2
|
seo:
|
7
|
-
old_page_url: URLs that redirect here
|
3
|
+
old_page_url: URLs that redirect here
|
8
4
|
meta_description: Meta Description
|
5
|
+
meta_index: Metarobots NOINDEX
|
9
6
|
page_title: Page Title
|
10
7
|
canonical_href: Canonical link
|
8
|
+
note: '<b>Comment:</b> URLs that redirect to this page takes slugs in a comma-separated list, cannonical link defaults to the page url, but can be overwritten by a full URL'
|
11
9
|
google_plus:
|
12
|
-
name: Name
|
13
|
-
description: Description
|
14
|
-
image: Image
|
10
|
+
name: Name
|
11
|
+
description: Description
|
12
|
+
image: Image
|
13
|
+
note: "<b>Comment:</b> By default, the field 'Description' is automatically filled with the information from the tab SEO. The field 'Image' inherits the value from the parent page of this page."
|
15
14
|
twitter:
|
16
|
-
site: Site
|
17
|
-
title: Title
|
18
|
-
description: Description
|
19
|
-
creator: Creator
|
20
|
-
image_src: Image Source
|
15
|
+
site: Site
|
16
|
+
title: Title
|
17
|
+
description: Description
|
18
|
+
creator: Creator
|
19
|
+
image_src: Image Source
|
20
|
+
note: "<b>Comment:</b> By default, the field 'Description' is automatically filled with the information from the tab SEO. The field 'Image' inherits the value from the parent page of this page."
|
21
21
|
facebook:
|
22
|
-
title: Title
|
23
|
-
type: Type
|
24
|
-
image: Image
|
25
|
-
description: Description
|
22
|
+
title: Title
|
23
|
+
type: Type
|
24
|
+
image: Image
|
25
|
+
description: Description
|
26
26
|
site_name: Site Name (inherits from root)
|
27
|
-
admins: Admins
|
27
|
+
admins: Admins
|
28
|
+
note: "<b>Comment:</b> By default, the field 'Description' is automatically filled with the information from the tab SEO. The field 'Image' inherits the value from the parent page of this page."
|
28
29
|
devise:
|
29
30
|
signin: Login
|
30
31
|
admin:
|
31
32
|
roles:
|
32
33
|
sync_and_permit:
|
33
34
|
sync_and_permit: Permission levels sync
|
35
|
+
seo_snippet:
|
36
|
+
label:
|
37
|
+
blanks: Label allows no blanks
|
38
|
+
context:
|
39
|
+
can't be blank: "Context can't be blank"
|
40
|
+
type:
|
41
|
+
can't be blank: "Type can't be blank"
|
42
|
+
url:
|
43
|
+
can't be blank: "URL can't be blank"
|
44
|
+
telephone:
|
45
|
+
contact_type_blank: Telephone needs input of contact type
|
46
|
+
international_number: Telephone only allows numbers with international country code prefix (like +49)
|
47
|
+
available_language:
|
48
|
+
contact_type_blank: Available language needs input of contact type
|
49
|
+
contact_url:
|
50
|
+
contact_type_blank: Contact URL needs input of contact type
|
51
|
+
area_served:
|
52
|
+
contact_type_blank: Area served needs input of contact type
|
53
|
+
contact_type:
|
54
|
+
blank: Contact type needs input of contact url or telephone
|
55
|
+
comfy:
|
56
|
+
admin:
|
57
|
+
cms:
|
58
|
+
seo_snippets:
|
59
|
+
new:
|
60
|
+
title: SEO snippet
|
61
|
+
seo_form:
|
62
|
+
create: Create SEO snippet
|
63
|
+
cancel: Cancel
|
@@ -2,6 +2,7 @@ require 'comfortable_mexican_sofa'
|
|
2
2
|
require 'rack-rewrite'
|
3
3
|
require 'comfortable_mexican_loveseat/engine'
|
4
4
|
require 'comfortable_mexican_loveseat/fixture'
|
5
|
+
require 'comfortable_mexican_loveseat/cms_admin'
|
5
6
|
require 'comfortable_mexican_loveseat/form_builder'
|
6
7
|
|
7
8
|
module ComfortableMexicanLoveseat
|
@@ -0,0 +1,41 @@
|
|
1
|
+
class ActionDispatch::Routing::Mapper
|
2
|
+
|
3
|
+
def comfy_route_cms_admin(options = {})
|
4
|
+
options[:path] ||= 'admin'
|
5
|
+
|
6
|
+
scope :module => :comfy, :as => :comfy do
|
7
|
+
scope :module => :admin do
|
8
|
+
namespace :cms, :as => :admin_cms, :path => options[:path], :except => :show do
|
9
|
+
get '/', :to => 'base#jump'
|
10
|
+
resources :sites do
|
11
|
+
resources :pages do
|
12
|
+
get :form_blocks, :on => :member
|
13
|
+
get :toggle_branch, :on => :member
|
14
|
+
put :reorder, :on => :collection
|
15
|
+
resources :revisions, :only => [:index, :show, :revert] do
|
16
|
+
patch :revert, :on => :member
|
17
|
+
end
|
18
|
+
end
|
19
|
+
resources :files do
|
20
|
+
put :reorder, :on => :collection
|
21
|
+
end
|
22
|
+
resources :layouts do
|
23
|
+
put :reorder, :on => :collection
|
24
|
+
resources :revisions, :only => [:index, :show, :revert] do
|
25
|
+
patch :revert, :on => :member
|
26
|
+
end
|
27
|
+
end
|
28
|
+
resources :snippets do
|
29
|
+
put :reorder, :on => :collection
|
30
|
+
resources :revisions, :only => [:index, :show, :revert] do
|
31
|
+
patch :revert, :on => :member
|
32
|
+
end
|
33
|
+
end
|
34
|
+
resources :seo_snippets, only: [:new, :create]
|
35
|
+
resources :categories
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -60,7 +60,8 @@ module ComfortableMexicanLoveseat
|
|
60
60
|
content = @template.hidden_field_tag("#{fieldname}[blocks_attributes][#{index}][content]", '', :id => nil)
|
61
61
|
content << @template.check_box_tag("#{fieldname}[blocks_attributes][#{index}][content]", '1', tag.content.present?, :id => nil)
|
62
62
|
content << @template.hidden_field_tag("#{fieldname}[blocks_attributes][#{index}][identifier]", tag.identifier, :id => nil)
|
63
|
-
|
63
|
+
label = I18n.t(tag.identifier.to_s).include?(tag.identifier.to_s) ? tag.blockable.class.human_attribute_name(tag.identifier.to_s) : I18n.t(tag.identifier.to_s)
|
64
|
+
form_group :label => {:text => label} do
|
64
65
|
content
|
65
66
|
end
|
66
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfortable_mexican_loveseat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Bahlke
|
@@ -9,104 +9,104 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '4.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '4.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: comfortable_mexican_sofa
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 1.12.8
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 1.12.8
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rack-rewrite
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ~>
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: 1.5.1
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 1.5.1
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rubyzip
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '1.1'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '1.1'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: sqlite3
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: bundler
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ~>
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '1.9'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ~>
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '1.9'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rake
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ~>
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '10.0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ~>
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '10.0'
|
112
112
|
description: Comfortable Mexican Loveseat expands the Comfortable Mexican Sofa with
|
@@ -120,9 +120,12 @@ files:
|
|
120
120
|
- MIT-LICENSE
|
121
121
|
- README.rdoc
|
122
122
|
- Rakefile
|
123
|
+
- app/assets/stylesheets/comfy/admin/cms/application.sass
|
124
|
+
- app/assets/stylesheets/comfy/admin/cms/seo_form.sass
|
123
125
|
- app/assets/stylesheets/devise.css.scss
|
124
126
|
- app/controllers/comfy/admin/cms/base_controller.rb
|
125
127
|
- app/controllers/comfy/admin/cms/layouts_controller.rb
|
128
|
+
- app/controllers/comfy/admin/cms/seo_snippets_controller.rb
|
126
129
|
- app/controllers/comfy/cms/content_controller.rb
|
127
130
|
- app/controllers/concerns/eventify.rb
|
128
131
|
- app/controllers/concerns/localizify.rb
|
@@ -133,9 +136,21 @@ files:
|
|
133
136
|
- app/helpers/comfy/cms_helper.rb
|
134
137
|
- app/mailers/comment_mailer.rb
|
135
138
|
- app/models/comfy/cms/snippet.rb
|
139
|
+
- app/services/corporate_contact.rb
|
140
|
+
- app/services/country_codes.rb
|
141
|
+
- app/services/seo_snippet.rb
|
142
|
+
- app/services/write_seo_snippet.rb
|
143
|
+
- app/views/comfy/admin/cms/_left.html.haml
|
136
144
|
- app/views/comfy/admin/cms/files/_form.html.haml
|
137
145
|
- app/views/comfy/admin/cms/files/index.html.haml
|
138
146
|
- app/views/comfy/admin/cms/pages/_form_blocks.html.haml
|
147
|
+
- app/views/comfy/admin/cms/seo_snippets/_add_corporate_contact.html.haml
|
148
|
+
- app/views/comfy/admin/cms/seo_snippets/_corporate_contact.html.haml
|
149
|
+
- app/views/comfy/admin/cms/seo_snippets/_corporate_contact_labeled.html.haml
|
150
|
+
- app/views/comfy/admin/cms/seo_snippets/_seo_form.html.haml
|
151
|
+
- app/views/comfy/admin/cms/seo_snippets/_social_profiles.html.haml
|
152
|
+
- app/views/comfy/admin/cms/seo_snippets/new.html.haml
|
153
|
+
- app/views/comfy/admin/cms/snippets/index.html.haml
|
139
154
|
- app/views/comfy/cms/content/render_sitemap.xml.builder
|
140
155
|
- app/views/comment_mailer/admin_mention.html.haml
|
141
156
|
- app/views/layouts/comfy/admin/cms/_flash.html.haml
|
@@ -143,6 +158,7 @@ files:
|
|
143
158
|
- config/locales/de.yml
|
144
159
|
- config/locales/en.yml
|
145
160
|
- lib/comfortable_mexican_loveseat.rb
|
161
|
+
- lib/comfortable_mexican_loveseat/cms_admin.rb
|
146
162
|
- lib/comfortable_mexican_loveseat/engine.rb
|
147
163
|
- lib/comfortable_mexican_loveseat/fixture.rb
|
148
164
|
- lib/comfortable_mexican_loveseat/form_builder.rb
|
@@ -972,17 +988,17 @@ require_paths:
|
|
972
988
|
- lib
|
973
989
|
required_ruby_version: !ruby/object:Gem::Requirement
|
974
990
|
requirements:
|
975
|
-
- -
|
991
|
+
- - '>='
|
976
992
|
- !ruby/object:Gem::Version
|
977
993
|
version: '0'
|
978
994
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
979
995
|
requirements:
|
980
|
-
- -
|
996
|
+
- - '>='
|
981
997
|
- !ruby/object:Gem::Version
|
982
998
|
version: '0'
|
983
999
|
requirements: []
|
984
1000
|
rubyforge_project:
|
985
|
-
rubygems_version: 2.4.
|
1001
|
+
rubygems_version: 2.4.5
|
986
1002
|
signing_key:
|
987
1003
|
specification_version: 4
|
988
1004
|
summary: An expansion of the Comfortable Mexican Sofa, to make your living room comfier.
|