forked from sharetribe/sharetribe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_data.rb
512 lines (503 loc) · 24.4 KB
/
example_data.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
module CustomLandingPage
module ExampleData
# TODO Document the expected JSON structure here
DATA_STR = <<JSON
{
"settings": {
"marketplace_id": 9999,
"locale": "en",
"sitename": "example"
},
"page": {
"twitter_handle": {"type": "marketplace_data", "id": "twitter_handle"},
"twitter_image": {"type": "assets", "id": "default_hero_background"},
"facebook_image": {"type": "assets", "id": "default_hero_background"},
"title": {"type": "marketplace_data", "id": "page_title"},
"description": {"type": "marketplace_data", "id": "description"},
"publisher": {"type": "marketplace_data", "id": "name"},
"copyright": {"type": "marketplace_data", "id": "name"},
"facebook_site_name": {"type": "marketplace_data", "id": "name"},
"google_site_verification": {"value": "CHANGEME"}
},
"sections": [
{
"id": "hero",
"kind": "hero",
"variation": {"type": "marketplace_data", "id": "search_type"},
"title": {"type": "marketplace_data", "id": "slogan"},
"subtitle": {"type": "marketplace_data", "id": "description"},
"background_image": {"type": "assets", "id": "default_hero_background"},
"background_image_variation": "dark",
"search_button": {"type": "translation", "id": "search_button"},
"search_path": {"type": "path", "id": "search"},
"search_placeholder": {"type": "marketplace_data", "id": "search_placeholder"},
"search_location_with_keyword_placeholder": {"type": "marketplace_data", "id": "search_location_with_keyword_placeholder"},
"signup_path": {"type": "path", "id": "signup"},
"signup_button": {"type": "translation", "id": "signup_button"},
"search_button_color": {"type": "marketplace_data", "id": "primary_color"},
"search_button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"signup_button_color": {"type": "marketplace_data", "id": "primary_color"},
"signup_button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"}
},
{
"id": "video",
"kind": "video",
"variation": "youtube",
"youtube_video_id": "UffchBUUIoI",
"width": "1280",
"height": "720",
"text": "Video section can contain one Youtube video. Click to watch!"
},
{
"id": "single_info_without_background_and_cta",
"kind": "info",
"variation": "single_column",
"title": "Single column info section without background image and call to action button",
"paragraph": "This is a single column info section without background image and call to action button."
},
{
"id": "markdown_support",
"kind": "info",
"variation": "single_column",
"title": "Limited Markdown support",
"paragraph": "Text paragraphs can contain Markdown markup. Limited subset of Markdown syntax blocks are allowed. Allowed blocks are *italic*, **bold**, ***bold+italic***, ~~strike through~~, _underline_ and [links](https://www.sharetribe.com). \\nLine breaks and...\\n\\n...new paragraphs are also supported"
},
{
"id": "single_info_without_cta",
"kind": "info",
"variation": "single_column",
"title": "Single column info section without call to action button",
"paragraph": "This is a single column info section without background image and call to action button.",
"background_image": {"type": "assets", "id": "default_hero_background"}
},
{
"id": "single_info_with_background_and_cta",
"kind": "info",
"variation": "single_column",
"title": "Single column info section with background image and call to action button",
"paragraph": "This is a single column info section with background image and call to action button.",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "Go to sharetribe.com",
"button_path": {"value": "https://www.sharetribe.com"},
"background_image": {"type": "assets", "id": "default_hero_background"},
"background_image_variation": "dark"
},
{
"id": "single_info_with_cta",
"kind": "info",
"variation": "single_column",
"title": "Single column info section with call to action button",
"paragraph": "This is a single column info section with call to action button.",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "Contact us",
"button_path": {"type": "path", "id": "contact_us"}
},
{
"id": "single_info_with_background_color_and_cta",
"kind": "info",
"variation": "single_column",
"title": "Single column info section with background color and call to action button",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Donec ullamcorper nulla non metus auctor fringilla. Curabitur blandit tempus porttitor. Nulla vitae elit libero.",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "About",
"button_path": {"type": "path", "id" :"about"},
"background_color": [166, 76, 94]
},
{
"id": "two_column_info_with_icons_and_buttons",
"kind": "info",
"variation": "multi_column",
"title": "Two column info section with icons and buttons",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"icon_color": {"type": "marketplace_data", "id": "primary_color"},
"columns": [
{
"icon": "grape",
"title": "Column 1",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel.\\n\\nParagraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel.",
"button_title": "Go to sharetribe.com",
"button_path": {"value": "https://www.sharetribe.com"}
},
{
"icon": "watering-can",
"title": "Column 2",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel.",
"button_title": "Go to sharetribe.com",
"button_path": {"value": "https://www.sharetribe.com"}
}
]
},
{
"id": "two_column_info_without_icons_and_buttons",
"kind": "info",
"variation": "multi_column",
"title": "Two column info section without icons and buttons",
"columns": [
{
"title": "Column 1",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel.\\n\\nParagraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel."
},
{
"title": "Column 2",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel."
}
]
},
{
"id": "three_column_info_with_icons_and_buttons",
"kind": "info",
"variation": "multi_column",
"title": "Three column info with icons and buttons",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"icon_color": {"type": "marketplace_data", "id": "primary_color"},
"columns": [
{
"title": "Column 1",
"icon": "quill",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel.",
"button_title": "Go to sharetribe.com",
"button_path": {"value": "https://www.sharetribe.com"}
},
{
"title": "Column 2",
"icon": "piggy-bank",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel.",
"button_title": "Go to sharetribe.com",
"button_path": {"value": "https://www.sharetribe.com"}
},
{
"title": "Column 3",
"icon": "globe-1",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel.",
"button_title": "Go to sharetribe.com",
"button_path": {"value": "https://www.sharetribe.com"}
}
]
},
{
"id": "three_column_info_without_icons_and_buttons",
"kind": "info",
"variation": "multi_column",
"title": "Three column info without icons and buttons",
"columns": [
{
"title": "Column 1",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel."
},
{
"title": "Column 2",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel."
},
{
"title": "Column 3",
"paragraph": "Paragraph. Curabitur blandit tempus porttitor. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel."
}
]
},
{
"id": "categories",
"kind": "categories",
"title": "Categories section",
"paragraph": "PLEASE NOTE: This section is NOT ENABLED by default. To enable this section, replace category IDs with real IDs and add the section to the 'composition'. Categories section can contain 3 to 7 featured categories. Each category should have a background image.",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "All categories",
"button_path": {"type": "path", "id": "all_categories"},
"category_color_hover": {"type": "marketplace_data", "id": "primary_color"},
"categories": [
{
"category": { "type": "category", "id": 99999 },
"background_image": {"type": "assets", "id": "default_hero_background"}
},
{
"category": { "type": "category", "id": 99999 },
"background_image": {"type": "assets", "id": "default_hero_background"}
},
{
"category": { "type": "category", "id": 99999 },
"background_image": {"type": "assets", "id": "default_hero_background"}
}
]
},
{
"id": "listings",
"kind": "listings",
"title": "Featured listings section",
"paragraph": "PLEASE NOTE: This section is NOT ENABLED by default. To enable this section, replace listing IDs with real IDs and add the section to the 'composition'. This section contains 3 featured listings",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "Browse all listings",
"button_path": {"type": "path", "id": "search"},
"price_color": {"type": "marketplace_data", "id": "primary_color"},
"no_listing_image_background_color": {"type": "marketplace_data", "id": "primary_color"},
"no_listing_image_text": {"type": "translation", "id": "no_listing_image"},
"author_name_color_hover": {"type": "marketplace_data", "id": "primary_color"},
"listings": [
{
"listing": { "type": "listing", "id": 99999 }
},
{
"listing": { "type": "listing", "id": 99999 }
},
{
"listing": { "type": "listing", "id": 99999 }
}
]
},
{
"id": "footer",
"kind": "footer",
"theme": "dark",
"social_media_icon_color": {"type": "marketplace_data", "id": "primary_color"},
"social_media_icon_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"links": [
{"label": "About", "href": {"type": "path", "id": "about"}},
{"label": "Contact us", "href": {"type": "path", "id": "contact_us"}},
{"label": "How to use?", "href": {"type": "path", "id": "how_to_use"}},
{"label": "Terms", "href": {"type": "path", "id": "terms"}},
{"label": "Privary", "href": {"type": "path", "id": "privacy"}},
{"label": "Invite new members", "href": {"type": "path", "id": "new_invitation"}},
{"label": "Sharetribe", "href": {"value": "https://www.sharetribe.com"}}
],
"social": [
{"service": "facebook", "url": "https://www.facebook.com/Sharetribe/"},
{"service": "twitter", "url": "https://twitter.com/sharetribe"},
{"service": "instagram", "url": "https://www.instagram.com/"},
{"service": "youtube", "url": "https://www.youtube.com/channel/UCtefWVq2uu4pHXaIsHlBFnw"},
{"service": "googleplus", "url": "https://plus.google.com/114869130265262677354/"},
{"service": "linkedin", "url": "https://www.linkedin.com/company/2626583"},
{"service": "pinterest", "url": "https://www.pinterest.com/"}
],
"copyright": "Copyright Marketplace Ltd 2016"
}
],
"composition": [
{ "section": {"type": "sections", "id": "hero"}},
{ "section": {"type": "sections", "id": "markdown_support"}},
{ "section": {"type": "sections", "id": "single_info_without_background_and_cta"}},
{ "section": {"type": "sections", "id": "single_info_without_cta"}},
{ "section": {"type": "sections", "id": "single_info_with_cta"}},
{ "section": {"type": "sections", "id": "single_info_with_background_and_cta"}},
{ "section": {"type": "sections", "id": "single_info_with_background_color_and_cta"}},
{ "section": {"type": "sections", "id": "two_column_info_with_icons_and_buttons"}},
{ "section": {"type": "sections", "id": "two_column_info_without_icons_and_buttons"}},
{ "section": {"type": "sections", "id": "three_column_info_with_icons_and_buttons"}},
{ "section": {"type": "sections", "id": "three_column_info_without_icons_and_buttons"}},
{ "section": {"type": "sections", "id": "video"}},
{ "section": {"type": "sections", "id": "footer"}}
],
"assets": [
{ "id": "default_hero_background", "src": "default_hero_background.jpg", "content_type": "image/jpeg" }
]
}
JSON
TEMPLATE_STR = <<JSON
{
"settings": {
"marketplace_id": 1234,
"locale": "en",
"sitename": "example-com"
},
"page": {
"twitter_handle": {"value": "@CHANGEME"},
"twitter_image": {"type": "assets", "id": "hero_background_image"},
"facebook_image": {"type": "assets", "id": "hero_background_image"},
"title": {"type": "marketplace_data", "id": "page_title"},
"description": {"type": "marketplace_data", "id": "description"},
"publisher": {"type": "marketplace_data", "id": "name"},
"copyright": {"type": "marketplace_data", "id": "name"},
"facebook_site_name": {"type": "marketplace_data", "id": "name"},
"google_site_verification": {"value": "CHANGEME"}
},
"sections": [
{
"id": "hero",
"kind": "hero",
"variation": {"type": "marketplace_data", "id": "search_type"},
"title": {"type": "marketplace_data", "id": "slogan"},
"subtitle": {"type": "marketplace_data", "id": "description"},
"background_image": {"type": "assets", "id": "hero_background_image"},
"background_image_variation": "dark",
"search_button": {"type": "translation", "id": "search_button"},
"search_path": {"type": "path", "id": "search"},
"search_placeholder": {"type": "marketplace_data", "id": "search_placeholder"},
"search_location_with_keyword_placeholder": {"type": "marketplace_data", "id": "search_location_with_keyword_placeholder"},
"signup_path": {"type": "path", "id": "signup"},
"signup_button": {"type": "translation", "id": "signup_button"},
"search_button_color": {"type": "marketplace_data", "id": "primary_color"},
"search_button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"signup_button_color": {"type": "marketplace_data", "id": "primary_color"},
"signup_button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"}
},
{
"id": "info-1-column",
"kind": "info",
"variation": "single_column",
"title": "Section title goes here",
"background_image": {"type": "assets", "id": "info_background_image"},
"paragraph": "Section text goes here",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "Button title",
"button_path": {"type": "path", "id": "about"}
},
{
"id": "info-2-columns",
"kind": "info",
"variation": "multi_column",
"title": "Section title goes here",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"icon_color": {"type": "marketplace_data", "id": "primary_color"},
"columns": [
{
"icon": "piggy-bank",
"title": "Column title goes here",
"paragraph": "Column text goes here",
"button_title": "Button title",
"button_path": {"type": "path", "id": "about"}
},
{
"icon": "piggy-bank",
"title": "Column title goes here",
"paragraph": "Column text goes here",
"button_title": "Button title",
"button_path": {"type": "path", "id": "about"}
}
]
},
{
"id": "info-3-columns",
"kind": "info",
"variation": "multi_column",
"title": "Section title goes here",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"icon_color": {"type": "marketplace_data", "id": "primary_color"},
"columns": [
{
"icon": "piggy-bank",
"title": "Column title goes here",
"paragraph": "Column text goes here",
"button_title": "Button title",
"button_path": {"type": "path", "id": "about"}
},
{
"icon": "piggy-bank",
"title": "Column title goes here",
"paragraph": "Column text goes here",
"button_title": "Button title",
"button_path": {"type": "path", "id": "about"}
},
{
"icon": "piggy-bank",
"title": "Column title goes here",
"paragraph": "Column text goes here",
"button_title": "Button title",
"button_path": {"type": "path", "id": "about"}
}
]
},
{
"id": "categories",
"kind": "categories",
"title": "Section title goes here",
"paragraph": "Section paragraph goes here",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "Section link",
"button_path": {"value": "https://google.com"},
"category_color_hover": {"type": "marketplace_data", "id": "primary_color"},
"categories": [
{
"category": { "type": "category", "id": 1 },
"background_image": {"type": "assets", "id": "category1_background_image"}
},
{
"category": { "type": "category", "id": 2 },
"background_image": {"type": "assets", "id": "category2_background_image"}
},
{
"category": { "type": "category", "id": 3 },
"background_image": {"type": "assets", "id": "category3_background_image"}
}
]
},
{
"id": "listings",
"kind": "listings",
"title": "Section title goes here",
"paragraph": "Section paragraph goes here",
"button_color": {"type": "marketplace_data", "id": "primary_color"},
"button_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"button_title": "Section link",
"button_path": {"value": "https://google.com"},
"price_color": {"type": "marketplace_data", "id": "primary_color"},
"no_listing_image_background_color": {"type": "marketplace_data", "id": "primary_color"},
"no_listing_image_text": {"type": "translation", "id": "no_listing_image"},
"author_name_color_hover": {"type": "marketplace_data", "id": "primary_color"},
"listings": [
{
"listing": { "type": "listing", "id": 99999 }
},
{
"listing": { "type": "listing", "id": 99999 }
},
{
"listing": { "type": "listing", "id": 99999 }
}
]
},
{
"id": "video",
"kind": "video",
"variation": "youtube",
"youtube_video_id": "UffchBUUIoI",
"width": "1280",
"height": "720"
},
{
"id": "footer",
"kind": "footer",
"theme": "dark",
"social_media_icon_color": {"type": "marketplace_data", "id": "primary_color"},
"social_media_icon_color_hover": {"type": "marketplace_data", "id": "primary_color_darken"},
"links": [
{"label": "About", "href": {"type": "path", "id": "about"}},
{"label": "Example Link", "href": {"value": "https://www.sharetribe.com"}},
{"label": "Invite new members", "href": {"type": "path", "id": "new_invitation"}},
{"label": "Contact us", "href": {"type": "path", "id": "contact_us"}}
],
"social": [
{"service": "facebook", "url": "https://www.facebook.com/CHANGEME"},
{"service": "twitter", "url": "https://www.twitter.com/CHANGEME"},
{"service": "instagram", "url": "https://www.instagram.com/CHANGEME"}
],
"copyright": "This website is powered by Sharetribe marketplace platform."
}
],
"composition": [
{ "section": {"type": "sections", "id": "hero"}},
{ "section": {"type": "sections", "id": "info-1-column"}},
{ "section": {"type": "sections", "id": "info-2-columns"}},
{ "section": {"type": "sections", "id": "info-3-columns"}},
{ "section": {"type": "sections", "id": "categories"}},
{ "section": {"type": "sections", "id": "listings"}},
{ "section": {"type": "sections", "id": "footer"}}
],
"assets": [
{"id": "hero_background_image", "src": "example_bg_lighter.jpg", "content_type": "image/jpeg"},
{"id": "info_background_image", "src": "example_bg_lighter.jpg", "content_type": "image/jpeg"},
{"id": "category1_background_image", "src": "example_bg_lighter.jpg", "content_type": "image/jpeg"},
{"id": "category2_background_image", "src": "example_bg_lighter.jpg", "content_type": "image/jpeg"},
{"id": "category3_background_image", "src": "example_bg_lighter.jpg", "content_type": "image/jpeg"}
]
}
JSON
end
end