Class: Contentful::Bootstrap::Templates::Catalogue

Inherits:
Base
  • Object
show all
Defined in:
lib/contentful/bootstrap/templates/catalogue.rb

Instance Attribute Summary

Attributes inherited from Base

#environment, #skip_content_types

Instance Method Summary collapse

Methods inherited from Base

#after_run, #initialize, #run

Constructor Details

This class inherits a constructor from Contentful::Bootstrap::Templates::Base

Instance Method Details

#assetsObject



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
# File 'lib/contentful/bootstrap/templates/catalogue.rb', line 99

def assets
  [
    {
      'id' => 'playsam_image',
      'title' => 'Playsam',
      'file' => create_file('playsam_image.jpg', 'https://images.contentful.com/liicpxzmg1q0/4zj1ZOfHgQ8oqgaSKm4Qo2/3be82d54d45b5297e951aee9baf920da/playsam.jpg?h=250&')
    },
    {
      'id' => 'normann_image',
      'title' => 'Normann',
      'file' => create_file('normann_image.jpg', 'https://images.contentful.com/liicpxzmg1q0/3wtvPBbBjiMKqKKga8I2Cu/75c7c92f38f7953a741591d215ad61d4/zJYzDlGk.jpeg?h=250&')
    },
    {
      'id' => 'toy_image',
      'title' => 'Toys',
      'file' => create_file('toy_image.jpg', 'https://images.contentful.com/liicpxzmg1q0/6t4HKjytPi0mYgs240wkG/866ef53a11af9c6bf5f3808a8ce1aab2/toys_512pxGREY.png?h=250&')
    },
    {
      'id' => 'kitchen_image',
      'title' => 'Kitchen and Home',
      'file' => create_file('kitchen_image.jpg', 'https://images.contentful.com/liicpxzmg1q0/6m5AJ9vMPKc8OUoQeoCS4o/ffc20f5a8f2a71cca4801bc9c51b966a/1418244847_Streamline-18-256.png?h=250&')
    },
    {
      'id' => 'toy_car',
      'title' => 'Playsam Toy Car',
      'file' => create_file('toy_car.jpg', 'https://images.contentful.com/liicpxzmg1q0/wtrHxeu3zEoEce2MokCSi/acef70d12fe019228c4238aa791bdd48/quwowooybuqbl6ntboz3.jpg?h=250&')
    },
    {
      'id' => 'whiskers',
      'title' => 'Normann Whisk Beaters',
      'file' => create_file('whiskers.jpg', 'https://images.contentful.com/liicpxzmg1q0/10TkaLheGeQG6qQGqWYqUI/d510dde5e575d40288cf75b42383aa53/ryugj83mqwa1asojwtwb.jpg?h=250&')
    }
  ]
end

#content_typesObject



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
# File 'lib/contentful/bootstrap/templates/catalogue.rb', line 8

def content_types
  [
    {
      'id' => 'brand',
      'name' => 'Brand',
      'displayField' => 'name',
      'fields' => [
        {
          'id' => 'name',
          'name' => 'Company Name',
          'type' => 'Symbol'
        },
        {
          'id' => 'website',
          'name' => 'Website',
          'type' => 'Symbol'
        },
        {
          'id' => 'logo',
          'name' => 'Logo',
          'type' => 'Link',
          'linkType' => 'Asset'
        }
      ]
    },
    {
      'id' => 'category',
      'name' => 'Category',
      'displayField' => 'title',
      'fields' => [
        {
          'id' => 'title',
          'name' => 'Title',
          'type' => 'Symbol'
        },
        {
          'id' => 'description',
          'name' => 'Description',
          'type' => 'Text'
        },
        {
          'id' => 'icon',
          'name' => 'Icon',
          'type' => 'Link',
          'linkType' => 'Asset'
        }
      ]
    },
    {
      'id' => 'product',
      'name' => 'Product',
      'displayField' => 'name',
      'fields' => [
        {
          'id' => 'name',
          'name' => 'name',
          'type' => 'Symbol'
        },
        {
          'id' => 'description',
          'name' => 'Description',
          'type' => 'Text'
        },
        {
          'id' => 'image',
          'name' => 'Image',
          'type' => 'Link',
          'linkType' => 'Asset'
        },
        {
          'id' => 'brand',
          'name' => 'Brand',
          'type' => 'Link',
          'linkType' => 'Entry'
        },
        {
          'id' => 'category',
          'name' => 'Category',
          'type' => 'Link',
          'linkType' => 'Entry'
        },
        {
          'id' => 'url',
          'name' => 'Available at',
          'type' => 'Symbol'
        }
      ]
    }
  ]
end

#entriesObject



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
# File 'lib/contentful/bootstrap/templates/catalogue.rb', line 134

def entries
  {
    'brand' => [
      {
        'id' => 'playsam',
        'name' => 'Playsam, Inc',
        'website' => 'http://www.playsam.com',
        'logo' => Links::Asset.new('playsam_image')
      },
      {
        'id' => 'normann',
        'name' => 'Normann Copenhagen, Inc',
        'website' => 'http://www.normann-copenhagen.com/',
        'logo' => Links::Asset.new('normann_image')
      }
    ],
    'category' => [
      {
        'id' => 'toys',
        'title' => 'Toys',
        'description' => 'Toys for children',
        'icon' => Links::Asset.new('toy_image')
      },
      {
        'id' => 'kitchen',
        'title' => 'House and Kitchen',
        'description' => 'House and Kitchen accessories',
        'icon' => Links::Asset.new('kitchen_image')
      }
    ],
    'product' => [
      {
        'id' => 'playsam_car',
        'name' => 'Playsam Streamliner Classic Car, Espresso',
        'description' => 'A classic Playsam design, the Streamliner Classic Car has been selected as Swedish Design Classic by the Swedish National Museum for its inventive style and sleek surface. It\'s no wonder that this wooden car has also been a long-standing favorite for children both big and small!',
        'image' => Links::Asset.new('toy_car'),
        'brand' => Links::Entry.new('playsam'),
        'category' => Links::Entry.new('toys'),
        'url' => 'http://www.amazon.com/dp/B001R6JUZ2/'
      },
      {
        'id' => 'whisk_beater',
        'name' => 'Whisk Beater',
        'description' => 'A creative little whisk that comes in 8 different colors. Handy and easy to clean after use. A great gift idea.',
        'image' => Links::Asset.new('whiskers'),
        'brand' => Links::Entry.new('normann'),
        'category' => Links::Entry.new('kitchen'),
        'url' => 'http://www.amazon.com/dp/B0081F2CCK/'
      }
    ]
  }
end