quadro 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.md +194 -0
- data/Rakefile +39 -0
- data/app/assets/images/quadro/close.png +0 -0
- data/app/assets/images/quadro/favicon.ico +0 -0
- data/app/assets/images/quadro/loading.gif +0 -0
- data/app/assets/images/quadro/missing/cover/large.png +0 -0
- data/app/assets/images/quadro/missing/cover/medium.png +0 -0
- data/app/assets/images/quadro/missing/cover/small.png +0 -0
- data/app/assets/images/quadro/missing/cover/thumb.png +0 -0
- data/app/assets/images/quadro/missing/image/large.png +0 -0
- data/app/assets/images/quadro/missing/image/medium.png +0 -0
- data/app/assets/images/quadro/missing/image/small.png +0 -0
- data/app/assets/images/quadro/missing/image/thumb.png +0 -0
- data/app/assets/images/quadro/missing/slide/large.png +0 -0
- data/app/assets/images/quadro/missing/slide/medium.png +0 -0
- data/app/assets/images/quadro/missing/slide/small.png +0 -0
- data/app/assets/images/quadro/missing/slide/thumb.png +0 -0
- data/app/assets/images/quadro/next.png +0 -0
- data/app/assets/images/quadro/prev.png +0 -0
- data/app/assets/images/quadro/quadro-logo-mini.png +0 -0
- data/app/assets/images/quadro/quadro-logo.png +0 -0
- data/app/assets/javascripts/quadro/application.js.coffee +27 -0
- data/app/assets/javascripts/quadro/message.js.coffee +6 -0
- data/app/assets/javascripts/quadro/plugins/gmaps.min.js +1 -0
- data/app/assets/javascripts/quadro/plugins/humane.min.js +11 -0
- data/app/assets/javascripts/quadro/plugins/jasny-bootstrap.min.js +6 -0
- data/app/assets/javascripts/quadro/plugins/jquery.fs.dropper.min.js +9 -0
- data/app/assets/javascripts/quadro/plugins/jquery.show_char_limit.min.js +1 -0
- data/app/assets/javascripts/quadro/plugins/jquery.smartmenus.bootstrap.min.js +3 -0
- data/app/assets/javascripts/quadro/plugins/jquery.smartmenus.min.js +3 -0
- data/app/assets/javascripts/quadro/plugins/lightbox.min.js +13 -0
- data/app/assets/javascripts/quadro/plugins/pace.min.js +2 -0
- data/app/assets/javascripts/quadro/quadro.js.coffee +43 -0
- data/app/assets/javascripts/quadro/site.js.coffee +0 -0
- data/app/assets/javascripts/quadro/uploader.js.coffee +17 -0
- data/app/assets/javascripts/quadro/widget.js.coffee +80 -0
- data/app/assets/stylesheets/bootstrap/_mixins.scss +40 -0
- data/app/assets/stylesheets/quadro/application.css.sass +19 -0
- data/app/assets/stylesheets/quadro/plugins/humane-libnotify.min.css +1 -0
- data/app/assets/stylesheets/quadro/plugins/jasny-bootstrap.min.css +7 -0
- data/app/assets/stylesheets/quadro/plugins/jquery.fs.dropper.min.css +9 -0
- data/app/assets/stylesheets/quadro/plugins/jquery.smartmenus.bootstrap.min.css +1 -0
- data/app/assets/stylesheets/quadro/plugins/lightbox.min.css +1 -0
- data/app/assets/stylesheets/quadro/plugins/pace.min.css +1 -0
- data/app/assets/stylesheets/quadro/quadro.css.sass +99 -0
- data/app/assets/stylesheets/quadro/site.css.sass +0 -0
- data/app/controllers/quadro/application_controller.rb +122 -0
- data/app/controllers/quadro/assets_controller.rb +21 -0
- data/app/controllers/quadro/feeds_controller.rb +6 -0
- data/app/controllers/quadro/pages_controller.rb +42 -0
- data/app/controllers/quadro/robots_controller.rb +6 -0
- data/app/controllers/quadro/users_controller.rb +15 -0
- data/app/controllers/quadro/widgets_controller.rb +14 -0
- data/app/helpers/quadro/application_helper.rb +4 -0
- data/app/helpers/quadro/asset_helper.rb +7 -0
- data/app/helpers/quadro/navigation_helper.rb +43 -0
- data/app/helpers/quadro/widget_helper.rb +54 -0
- data/app/models/quadro/asset.rb +11 -0
- data/app/models/quadro/asset/cover.rb +18 -0
- data/app/models/quadro/asset/image.rb +18 -0
- data/app/models/quadro/asset/slide.rb +18 -0
- data/app/models/quadro/interaction.rb +13 -0
- data/app/models/quadro/page.rb +88 -0
- data/app/models/quadro/user.rb +19 -0
- data/app/models/quadro/widget.rb +21 -0
- data/app/models/quadro/widget/form.rb +13 -0
- data/app/models/quadro/widget/gallery.rb +17 -0
- data/app/models/quadro/widget/html.rb +14 -0
- data/app/models/quadro/widget/map.rb +13 -0
- data/app/models/quadro/widget/slider.rb +17 -0
- data/app/views/layouts/quadro/application.html.haml +33 -0
- data/app/views/layouts/quadro/devise.html.haml +11 -0
- data/app/views/quadro/assets/create.js.erb +11 -0
- data/app/views/quadro/assets/destroy.js.erb +11 -0
- data/app/views/quadro/assets/edit.js.erb +9 -0
- data/app/views/quadro/assets/image/_form.html.haml +25 -0
- data/app/views/quadro/assets/image/_image.html.haml +10 -0
- data/app/views/quadro/assets/slide/_form.html.haml +26 -0
- data/app/views/quadro/assets/slide/_slide.html.haml +9 -0
- data/app/views/quadro/assets/update.js.erb +18 -0
- data/app/views/quadro/feeds/atom.xml.builder +27 -0
- data/app/views/quadro/feeds/rss.xml.builder +25 -0
- data/app/views/quadro/interactions/_interaction.html.haml +22 -0
- data/app/views/quadro/pages/_edit.html.haml +35 -0
- data/app/views/quadro/pages/_new.html.haml +11 -0
- data/app/views/quadro/pages/_page.html.haml +1 -0
- data/app/views/quadro/pages/create.js.erb +7 -0
- data/app/views/quadro/pages/destroy.js.erb +5 -0
- data/app/views/quadro/pages/edit.js.erb +4 -0
- data/app/views/quadro/pages/form.js.erb +6 -0
- data/app/views/quadro/pages/index.html.haml +1 -0
- data/app/views/quadro/pages/new.js.erb +2 -0
- data/app/views/quadro/pages/show.html.haml +1 -0
- data/app/views/quadro/pages/update.js.erb +7 -0
- data/app/views/quadro/robots/index.text.erb +4 -0
- data/app/views/quadro/shared/_modal.html.haml +3 -0
- data/app/views/quadro/shared/_navigation.html.haml +17 -0
- data/app/views/quadro/shared/_toolbar.html.haml +55 -0
- data/app/views/quadro/shared/templates/_blank.html.haml +11 -0
- data/app/views/quadro/shared/templates/_demo.html.haml +22 -0
- data/app/views/quadro/shared/templates/_jumbotron.html.haml +10 -0
- data/app/views/quadro/shared/templates/_sidebar.html.haml +15 -0
- data/app/views/quadro/shared/templates/page/_list.html.haml +9 -0
- data/app/views/quadro/shared/templates/page/_thumbnail.html.haml +9 -0
- data/app/views/quadro/users/_edit.html.haml +15 -0
- data/app/views/quadro/users/edit.js.erb +2 -0
- data/app/views/quadro/users/update.js.erb +7 -0
- data/app/views/quadro/widgets/edit.js.erb +0 -0
- data/app/views/quadro/widgets/form/_empty.html.haml +4 -0
- data/app/views/quadro/widgets/form/_fields.html.haml +1 -0
- data/app/views/quadro/widgets/form/_form.html.haml +0 -0
- data/app/views/quadro/widgets/form/_signed_off.html.haml +6 -0
- data/app/views/quadro/widgets/form/_signed_on.html.haml +14 -0
- data/app/views/quadro/widgets/form/_toolbar.html.haml +7 -0
- data/app/views/quadro/widgets/form/_widget.html.haml +1 -0
- data/app/views/quadro/widgets/gallery/_empty.html.haml +20 -0
- data/app/views/quadro/widgets/gallery/_form.html.haml +0 -0
- data/app/views/quadro/widgets/gallery/_signed_off.html.haml +6 -0
- data/app/views/quadro/widgets/gallery/_signed_on.html.haml +10 -0
- data/app/views/quadro/widgets/gallery/_toolbar.html.haml +7 -0
- data/app/views/quadro/widgets/gallery/_uploader.html.haml +5 -0
- data/app/views/quadro/widgets/gallery/_widget.html.haml +6 -0
- data/app/views/quadro/widgets/html/_empty.html.haml +2 -0
- data/app/views/quadro/widgets/html/_form.html.haml +0 -0
- data/app/views/quadro/widgets/html/_signed_off.html.haml +6 -0
- data/app/views/quadro/widgets/html/_signed_on.html.haml +9 -0
- data/app/views/quadro/widgets/html/_toolbar.html.haml +7 -0
- data/app/views/quadro/widgets/html/_widget.html.haml +1 -0
- data/app/views/quadro/widgets/map/_empty.html.haml +18 -0
- data/app/views/quadro/widgets/map/_form.html.haml +0 -0
- data/app/views/quadro/widgets/map/_signed_off.html.haml +4 -0
- data/app/views/quadro/widgets/map/_signed_on.html.haml +6 -0
- data/app/views/quadro/widgets/map/_toolbar.html.haml +7 -0
- data/app/views/quadro/widgets/map/_widget.html.haml +45 -0
- data/app/views/quadro/widgets/slider/_empty.html.haml +7 -0
- data/app/views/quadro/widgets/slider/_form.html.haml +0 -0
- data/app/views/quadro/widgets/slider/_signed_off.html.haml +6 -0
- data/app/views/quadro/widgets/slider/_signed_on.html.haml +10 -0
- data/app/views/quadro/widgets/slider/_toolbar.html.haml +7 -0
- data/app/views/quadro/widgets/slider/_uploader.html.haml +5 -0
- data/app/views/quadro/widgets/slider/_widget.html.haml +4 -0
- data/app/views/quadro/widgets/update.js.erb +0 -0
- data/app/views/users/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/users/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/users/passwords/edit.html.haml +15 -0
- data/app/views/users/passwords/new.html.haml +13 -0
- data/app/views/users/sessions/new.html.haml +15 -0
- data/app/views/users/shared/_links.html.haml +19 -0
- data/app/views/users/unlocks/new.html.haml +13 -0
- data/config/initializers/crummy.rb +5 -0
- data/config/initializers/devise.rb +261 -0
- data/config/initializers/gravatar_image_tag.rb +7 -0
- data/config/initializers/kaminari_config.rb +10 -0
- data/config/initializers/simple_form.rb +142 -0
- data/config/initializers/simple_form_bootstrap.rb +79 -0
- data/config/initializers/sitemap.rb +9 -0
- data/config/locales/devise.en.yml +60 -0
- data/config/locales/kaminari.en.yml +17 -0
- data/config/locales/quadro.en.yml +5 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/routes.rb +25 -0
- data/db/migrate/20141122163450_create_quadro_widgets.rb +19 -0
- data/db/migrate/20141129022344_create_quadro_pages.rb +20 -0
- data/db/migrate/20141206085127_create_quadro_assets.rb +16 -0
- data/db/migrate/20141207202401_devise_create_quadro_users.rb +28 -0
- data/db/migrate/20160606213156_create_quadro_interactions.rb +11 -0
- data/lib/generators/quadro/install/USAGE +8 -0
- data/lib/generators/quadro/install/install_generator.rb +35 -0
- data/lib/generators/quadro/install/templates/app/assets/images/quadro/favicon.ico +0 -0
- data/lib/generators/quadro/install/templates/app/assets/images/quadro/quadro-logo-mini.png +0 -0
- data/lib/generators/quadro/install/templates/app/assets/images/quadro/quadro-logo.png +0 -0
- data/lib/generators/quadro/install/templates/app/assets/javascripts/quadro/site.js.coffee +0 -0
- data/lib/generators/quadro/install/templates/app/assets/stylesheets/quadro/site.css.sass +0 -0
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/_navigation.html.haml +17 -0
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_blank.html.haml +11 -0
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_demo.html.haml +22 -0
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_jumbotron.html.haml +10 -0
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_sidebar.html.haml +15 -0
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/page/_list.html.haml +9 -0
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/page/_thumbnail.html.haml +9 -0
- data/lib/generators/quadro/install/templates/config/initializers/quadro.rb +12 -0
- data/lib/generators/quadro/install/templates/db/GeoLite2-Country.mmdb +0 -0
- data/lib/generators/quadro/install/templates/public/404.html +37 -0
- data/lib/generators/quadro/install/templates/public/422.html +37 -0
- data/lib/generators/quadro/install/templates/public/500.html +37 -0
- data/lib/generators/quadro/install/templates/public/maintenance.html +37 -0
- data/lib/quadro.rb +16 -0
- data/lib/quadro/engine.rb +44 -0
- data/lib/quadro/loader.rb +30 -0
- data/lib/quadro/signature.rb +3 -0
- data/lib/quadro/version.rb +3 -0
- data/lib/tasks/quadro_tasks.rake +15 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/images/quadro/favicon.ico +0 -0
- data/test/dummy/app/assets/images/quadro/quadro-logo-mini.png +0 -0
- data/test/dummy/app/assets/images/quadro/quadro-logo.png +0 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/quadro/site.js.coffee +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/assets/stylesheets/quadro/site.css.sass +0 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/quadro/shared/_navigation.html.haml +17 -0
- data/test/dummy/app/views/quadro/shared/templates/_blank.html.haml +11 -0
- data/test/dummy/app/views/quadro/shared/templates/_demo.html.haml +22 -0
- data/test/dummy/app/views/quadro/shared/templates/_jumbotron.html.haml +10 -0
- data/test/dummy/app/views/quadro/shared/templates/_sidebar.html.haml +15 -0
- data/test/dummy/app/views/quadro/shared/templates/page/_list.html.haml +9 -0
- data/test/dummy/app/views/quadro/shared/templates/page/_thumbnail.html.haml +9 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/quadro.rb +12 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/db/GeoLite2-Country.mmdb +0 -0
- data/test/dummy/db/migrate/20160615055717_create_quadro_widgets.quadro.rb +20 -0
- data/test/dummy/db/migrate/20160615055718_create_quadro_pages.quadro.rb +21 -0
- data/test/dummy/db/migrate/20160615055719_create_quadro_assets.quadro.rb +17 -0
- data/test/dummy/db/migrate/20160615055720_devise_create_quadro_users.quadro.rb +29 -0
- data/test/dummy/db/migrate/20160615055721_create_quadro_interactions.quadro.rb +12 -0
- data/test/dummy/db/schema.rb +105 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/test.log +3 -0
- data/test/dummy/public/404.html +37 -0
- data/test/dummy/public/422.html +37 -0
- data/test/dummy/public/500.html +37 -0
- data/test/dummy/public/maintenance.html +37 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/quadro_test.rb +7 -0
- data/test/test_helper.rb +18 -0
- metadata +806 -0
data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_sidebar.html.haml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
= render 'quadro/shared/navigation'
|
2
|
+
|
3
|
+
.container
|
4
|
+
= render_crumbs
|
5
|
+
|
6
|
+
.row
|
7
|
+
.col-md-3
|
8
|
+
= navigation_for page, class: "nav nav-pills nav-stacked"
|
9
|
+
.col-md-9
|
10
|
+
.page-header
|
11
|
+
%h1= page.title
|
12
|
+
|
13
|
+
%p.lead= page.summary
|
14
|
+
|
15
|
+
= widget_for :content
|
data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/page/_list.html.haml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
.media
|
2
|
+
.media-left
|
3
|
+
= link_to page_path(page), class: "media-object img-thumbnail" do
|
4
|
+
= image_tag page.cover.url(:thumb), alt: page.title
|
5
|
+
.media-body
|
6
|
+
%h4.media-heading
|
7
|
+
= link_to page.title, page_path(page)
|
8
|
+
%small.text-muted= l(page.created_at, format: :short)
|
9
|
+
%p= page.summary
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Quadro.setup do |config|
|
2
|
+
config.host = "www.example.com"
|
3
|
+
config.email = "quadro@example.com"
|
4
|
+
config.site = "Quadro"
|
5
|
+
config.layout = "list"
|
6
|
+
config.template = "blank"
|
7
|
+
config.frequency = "monthly"
|
8
|
+
config.priority = "0.5"
|
9
|
+
config.google_maps_api_key = ""
|
10
|
+
config.facebook_id = ""
|
11
|
+
config.twitter_username = ""
|
12
|
+
end
|
Binary file
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn’t exist!</title>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<style>
|
7
|
+
body { display: table; height: 100vh; margin: 0px; padding: 0px; }
|
8
|
+
section { display: table-cell; vertical-align: middle; text-align: left; }
|
9
|
+
article { color: #333; }
|
10
|
+
h1 { font-family: sans; }
|
11
|
+
p { font-family: sans-serif; }
|
12
|
+
a { color: #666; text-decoration: none; }
|
13
|
+
a:hover { color: #333; text-decoration: none; }
|
14
|
+
@media only screen and (min-width : 320px) {
|
15
|
+
body { font-size: 16px; }
|
16
|
+
article { margin: 0px 1em; }
|
17
|
+
h1 { font-size: 32px; }
|
18
|
+
}
|
19
|
+
@media only screen and (min-width : 768px) {
|
20
|
+
body { font-size: 20px; }
|
21
|
+
article { margin: 0px 4em; }
|
22
|
+
h1 { font-size: 40px; }
|
23
|
+
}
|
24
|
+
</style>
|
25
|
+
</head>
|
26
|
+
<body>
|
27
|
+
<section>
|
28
|
+
<article>
|
29
|
+
<h1>The page you were looking for doesn’t exist!</h1>
|
30
|
+
<div>
|
31
|
+
<p>You may have mistyped the address or the page may have moved. You can always go to <a href="/">home page</a> instead.</p>
|
32
|
+
<p>— Quadro Team</p>
|
33
|
+
</div>
|
34
|
+
</article>
|
35
|
+
</section>
|
36
|
+
</body>
|
37
|
+
</html>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected!</title>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<style>
|
7
|
+
body { display: table; height: 100vh; margin: 0px; padding: 0px; }
|
8
|
+
section { display: table-cell; vertical-align: middle; text-align: left; }
|
9
|
+
article { color: #333; }
|
10
|
+
h1 { font-family: sans; }
|
11
|
+
p { font-family: sans-serif; }
|
12
|
+
a { color: #666; text-decoration: none; }
|
13
|
+
a:hover { color: #333; text-decoration: none; }
|
14
|
+
@media only screen and (min-width : 320px) {
|
15
|
+
body { font-size: 16px; }
|
16
|
+
article { margin: 0px 1em; }
|
17
|
+
h1 { font-size: 32px; }
|
18
|
+
}
|
19
|
+
@media only screen and (min-width : 768px) {
|
20
|
+
body { font-size: 20px; }
|
21
|
+
article { margin: 0px 4em; }
|
22
|
+
h1 { font-size: 40px; }
|
23
|
+
}
|
24
|
+
</style>
|
25
|
+
</head>
|
26
|
+
<body>
|
27
|
+
<section>
|
28
|
+
<article>
|
29
|
+
<h1>The change you wanted was rejected!</h1>
|
30
|
+
<div>
|
31
|
+
<p>Maybe you tried to change something you didn’t have access to. You can always go to <a href="/">home page</a> instead.</p>
|
32
|
+
<p>— Quadro Team</p>
|
33
|
+
</div>
|
34
|
+
</article>
|
35
|
+
</section>
|
36
|
+
</body>
|
37
|
+
</html>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>We’re sorry, but something went wrong!</title>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<style>
|
7
|
+
body { display: table; height: 100vh; margin: 0px; padding: 0px; }
|
8
|
+
section { display: table-cell; vertical-align: middle; text-align: left; }
|
9
|
+
article { color: #333; }
|
10
|
+
h1 { font-family: sans; }
|
11
|
+
p { font-family: sans-serif; }
|
12
|
+
a { color: #666; text-decoration: none; }
|
13
|
+
a:hover { color: #333; text-decoration: none; }
|
14
|
+
@media only screen and (min-width : 320px) {
|
15
|
+
body { font-size: 16px; }
|
16
|
+
article { margin: 0px 1em; }
|
17
|
+
h1 { font-size: 32px; }
|
18
|
+
}
|
19
|
+
@media only screen and (min-width : 768px) {
|
20
|
+
body { font-size: 20px; }
|
21
|
+
article { margin: 0px 4em; }
|
22
|
+
h1 { font-size: 40px; }
|
23
|
+
}
|
24
|
+
</style>
|
25
|
+
</head>
|
26
|
+
<body>
|
27
|
+
<section>
|
28
|
+
<article>
|
29
|
+
<h1>We’re sorry, but something went wrong!</h1>
|
30
|
+
<div>
|
31
|
+
<p>We’re working on it and we’ll get it fixed as son as we can. You can always go to <a href="/">home page</a> instead.</p>
|
32
|
+
<p>— Quadro Team</p>
|
33
|
+
</div>
|
34
|
+
</article>
|
35
|
+
</section>
|
36
|
+
</body>
|
37
|
+
</html>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<title>Website under maintenance!</title>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<style>
|
7
|
+
body { display: table; height: 100vh; margin: 0px; padding: 0px; }
|
8
|
+
section { display: table-cell; vertical-align: middle; text-align: left; }
|
9
|
+
article { color: #333; }
|
10
|
+
h1 { font-family: sans; }
|
11
|
+
p { font-family: sans-serif; }
|
12
|
+
a { color: #666; text-decoration: none; }
|
13
|
+
a:hover { color: #333; text-decoration: none; }
|
14
|
+
@media only screen and (min-width : 320px) {
|
15
|
+
body { font-size: 16px; }
|
16
|
+
article { margin: 0px 1em; }
|
17
|
+
h1 { font-size: 32px; }
|
18
|
+
}
|
19
|
+
@media only screen and (min-width : 768px) {
|
20
|
+
body { font-size: 20px; }
|
21
|
+
article { margin: 0px 4em; }
|
22
|
+
h1 { font-size: 40px; }
|
23
|
+
}
|
24
|
+
</style>
|
25
|
+
</head>
|
26
|
+
<body>
|
27
|
+
<section>
|
28
|
+
<article>
|
29
|
+
<h1>Website under maintenance!</h1>
|
30
|
+
<div>
|
31
|
+
<p>Sorry for the inconvenience but we’re performing some maintenance at the moment. You can always <a href="mailto:quadro@example.com">contact us</a>, otherwise we’ll be back online shortly.</p>
|
32
|
+
<p>— Quadro Team</p>
|
33
|
+
</div>
|
34
|
+
</article>
|
35
|
+
</section>
|
36
|
+
</body>
|
37
|
+
</html>
|
data/lib/quadro.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "quadro/engine"
|
2
|
+
require "quadro/loader"
|
3
|
+
require "quadro/version"
|
4
|
+
require "quadro/signature"
|
5
|
+
|
6
|
+
module Quadro
|
7
|
+
mattr_accessor :available_widgets
|
8
|
+
mattr_accessor :available_assets
|
9
|
+
mattr_accessor :config
|
10
|
+
|
11
|
+
Quadro.config = Configatron::RootStore.new
|
12
|
+
|
13
|
+
def self.setup(&block)
|
14
|
+
yield self.config
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Quadro
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace Quadro
|
4
|
+
|
5
|
+
config.before_configuration do
|
6
|
+
Quadro.setup do |config|
|
7
|
+
config.host = "www.example.com"
|
8
|
+
config.email = "quadro@example.com"
|
9
|
+
config.site = "Quadro"
|
10
|
+
config.layout = "list"
|
11
|
+
config.template = "blank"
|
12
|
+
config.frequency = "monthly"
|
13
|
+
config.priority = "0.5"
|
14
|
+
config.google_maps_api_key = ""
|
15
|
+
config.facebook_id = ""
|
16
|
+
config.twitter_username = ""
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
config.to_prepare do
|
21
|
+
Devise::SessionsController.layout "quadro/devise"
|
22
|
+
Devise::RegistrationsController.layout "quadro/devise"
|
23
|
+
Devise::ConfirmationsController.layout "quadro/devise"
|
24
|
+
Devise::UnlocksController.layout "quadro/devise"
|
25
|
+
Devise::PasswordsController.layout "quadro/devise"
|
26
|
+
end
|
27
|
+
|
28
|
+
config.after_initialize do
|
29
|
+
Quadro.available_widgets = [
|
30
|
+
Quadro::Widget::Html.to_s,
|
31
|
+
Quadro::Widget::Slider.to_s,
|
32
|
+
Quadro::Widget::Gallery.to_s,
|
33
|
+
Quadro::Widget::Map.to_s,
|
34
|
+
Quadro::Widget::Form.to_s
|
35
|
+
]
|
36
|
+
|
37
|
+
Quadro.available_assets = [
|
38
|
+
Quadro::Asset::Cover.to_s,
|
39
|
+
Quadro::Asset::Slide.to_s,
|
40
|
+
Quadro::Asset::Image.to_s
|
41
|
+
]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "ancestry"
|
2
|
+
require "paranoia"
|
3
|
+
require "haml-rails"
|
4
|
+
require "simple_form"
|
5
|
+
require "crummy"
|
6
|
+
require "kaminari"
|
7
|
+
require "kaminari-bootstrap"
|
8
|
+
require "stringex"
|
9
|
+
require "devise"
|
10
|
+
require "paperclip"
|
11
|
+
require "configatron/core"
|
12
|
+
require "dynamic_sitemaps"
|
13
|
+
require "jquery-rails"
|
14
|
+
require "remotipart"
|
15
|
+
require "coffee-rails"
|
16
|
+
require "sass-rails"
|
17
|
+
require "compass-rails"
|
18
|
+
require "bootstrap-sass"
|
19
|
+
require "font-awesome-sass"
|
20
|
+
require "animate"
|
21
|
+
require "codemirror-rails"
|
22
|
+
require "summernote/rails"
|
23
|
+
require "jquery-slick-rails"
|
24
|
+
require "gravatar_image_tag"
|
25
|
+
require "turnout"
|
26
|
+
require "useragent"
|
27
|
+
require "maxminddb"
|
28
|
+
require "rails-i18n"
|
29
|
+
require "devise-i18n"
|
30
|
+
require "kaminari-i18n"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
namespace :quadro do
|
2
|
+
desc 'Create admin user for quadro'
|
3
|
+
task :create_admin_user => :environment do |task|
|
4
|
+
unless Quadro::User.any?
|
5
|
+
Quadro::User.create(name: 'Quadro', email: 'quadro@example.com', password: 'quadro123', password_confirmation: 'quadro123')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'Create root page for quadro'
|
10
|
+
task :create_root_page => :environment do |task|
|
11
|
+
unless Quadro::Page.any?
|
12
|
+
Quadro::Page.create(title: 'Home', summary: 'Welcome to Quadro CMS', template: 'demo', author_id: Quadro::User.first.try(:id))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,261 @@
|
|
1
|
+
== Welcome to Rails
|
2
|
+
|
3
|
+
Rails is a web-application framework that includes everything needed to create
|
4
|
+
database-backed web applications according to the Model-View-Control pattern.
|
5
|
+
|
6
|
+
This pattern splits the view (also called the presentation) into "dumb"
|
7
|
+
templates that are primarily responsible for inserting pre-built data in between
|
8
|
+
HTML tags. The model contains the "smart" domain objects (such as Account,
|
9
|
+
Product, Person, Post) that holds all the business logic and knows how to
|
10
|
+
persist themselves to a database. The controller handles the incoming requests
|
11
|
+
(such as Save New Account, Update Product, Show Post) by manipulating the model
|
12
|
+
and directing data to the view.
|
13
|
+
|
14
|
+
In Rails, the model is handled by what's called an object-relational mapping
|
15
|
+
layer entitled Active Record. This layer allows you to present the data from
|
16
|
+
database rows as objects and embellish these data objects with business logic
|
17
|
+
methods. You can read more about Active Record in
|
18
|
+
link:files/vendor/rails/activerecord/README.html.
|
19
|
+
|
20
|
+
The controller and view are handled by the Action Pack, which handles both
|
21
|
+
layers by its two parts: Action View and Action Controller. These two layers
|
22
|
+
are bundled in a single package due to their heavy interdependence. This is
|
23
|
+
unlike the relationship between the Active Record and Action Pack that is much
|
24
|
+
more separate. Each of these packages can be used independently outside of
|
25
|
+
Rails. You can read more about Action Pack in
|
26
|
+
link:files/vendor/rails/actionpack/README.html.
|
27
|
+
|
28
|
+
|
29
|
+
== Getting Started
|
30
|
+
|
31
|
+
1. At the command prompt, create a new Rails application:
|
32
|
+
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
|
33
|
+
|
34
|
+
2. Change directory to <tt>myapp</tt> and start the web server:
|
35
|
+
<tt>cd myapp; rails server</tt> (run with --help for options)
|
36
|
+
|
37
|
+
3. Go to http://localhost:3000/ and you'll see:
|
38
|
+
"Welcome aboard: You're riding Ruby on Rails!"
|
39
|
+
|
40
|
+
4. Follow the guidelines to start developing your application. You can find
|
41
|
+
the following resources handy:
|
42
|
+
|
43
|
+
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
|
44
|
+
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
|
45
|
+
|
46
|
+
|
47
|
+
== Debugging Rails
|
48
|
+
|
49
|
+
Sometimes your application goes wrong. Fortunately there are a lot of tools that
|
50
|
+
will help you debug it and get it back on the rails.
|
51
|
+
|
52
|
+
First area to check is the application log files. Have "tail -f" commands
|
53
|
+
running on the server.log and development.log. Rails will automatically display
|
54
|
+
debugging and runtime information to these files. Debugging info will also be
|
55
|
+
shown in the browser on requests from 127.0.0.1.
|
56
|
+
|
57
|
+
You can also log your own messages directly into the log file from your code
|
58
|
+
using the Ruby logger class from inside your controllers. Example:
|
59
|
+
|
60
|
+
class WeblogController < ActionController::Base
|
61
|
+
def destroy
|
62
|
+
@weblog = Weblog.find(params[:id])
|
63
|
+
@weblog.destroy
|
64
|
+
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
The result will be a message in your log file along the lines of:
|
69
|
+
|
70
|
+
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
|
71
|
+
|
72
|
+
More information on how to use the logger is at http://www.ruby-doc.org/core/
|
73
|
+
|
74
|
+
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
|
75
|
+
several books available online as well:
|
76
|
+
|
77
|
+
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
|
78
|
+
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
|
79
|
+
|
80
|
+
These two books will bring you up to speed on the Ruby language and also on
|
81
|
+
programming in general.
|
82
|
+
|
83
|
+
|
84
|
+
== Debugger
|
85
|
+
|
86
|
+
Debugger support is available through the debugger command when you start your
|
87
|
+
Mongrel or WEBrick server with --debugger. This means that you can break out of
|
88
|
+
execution at any point in the code, investigate and change the model, and then,
|
89
|
+
resume execution! You need to install ruby-debug to run the server in debugging
|
90
|
+
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
|
91
|
+
|
92
|
+
class WeblogController < ActionController::Base
|
93
|
+
def index
|
94
|
+
@posts = Post.all
|
95
|
+
debugger
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
So the controller will accept the action, run the first line, then present you
|
100
|
+
with a IRB prompt in the server window. Here you can do things like:
|
101
|
+
|
102
|
+
>> @posts.inspect
|
103
|
+
=> "[#<Post:0x14a6be8
|
104
|
+
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
|
105
|
+
#<Post:0x14a6620
|
106
|
+
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
|
107
|
+
>> @posts.first.title = "hello from a debugger"
|
108
|
+
=> "hello from a debugger"
|
109
|
+
|
110
|
+
...and even better, you can examine how your runtime objects actually work:
|
111
|
+
|
112
|
+
>> f = @posts.first
|
113
|
+
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
114
|
+
>> f.
|
115
|
+
Display all 152 possibilities? (y or n)
|
116
|
+
|
117
|
+
Finally, when you're ready to resume execution, you can enter "cont".
|
118
|
+
|
119
|
+
|
120
|
+
== Console
|
121
|
+
|
122
|
+
The console is a Ruby shell, which allows you to interact with your
|
123
|
+
application's domain model. Here you'll have all parts of the application
|
124
|
+
configured, just like it is when the application is running. You can inspect
|
125
|
+
domain models, change values, and save to the database. Starting the script
|
126
|
+
without arguments will launch it in the development environment.
|
127
|
+
|
128
|
+
To start the console, run <tt>rails console</tt> from the application
|
129
|
+
directory.
|
130
|
+
|
131
|
+
Options:
|
132
|
+
|
133
|
+
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
|
134
|
+
made to the database.
|
135
|
+
* Passing an environment name as an argument will load the corresponding
|
136
|
+
environment. Example: <tt>rails console production</tt>.
|
137
|
+
|
138
|
+
To reload your controllers and models after launching the console run
|
139
|
+
<tt>reload!</tt>
|
140
|
+
|
141
|
+
More information about irb can be found at:
|
142
|
+
link:http://www.rubycentral.org/pickaxe/irb.html
|
143
|
+
|
144
|
+
|
145
|
+
== dbconsole
|
146
|
+
|
147
|
+
You can go to the command line of your database directly through <tt>rails
|
148
|
+
dbconsole</tt>. You would be connected to the database with the credentials
|
149
|
+
defined in database.yml. Starting the script without arguments will connect you
|
150
|
+
to the development database. Passing an argument will connect you to a different
|
151
|
+
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
|
152
|
+
PostgreSQL and SQLite 3.
|
153
|
+
|
154
|
+
== Description of Contents
|
155
|
+
|
156
|
+
The default directory structure of a generated Ruby on Rails application:
|
157
|
+
|
158
|
+
|-- app
|
159
|
+
| |-- assets
|
160
|
+
| | |-- images
|
161
|
+
| | |-- javascripts
|
162
|
+
| | `-- stylesheets
|
163
|
+
| |-- controllers
|
164
|
+
| |-- helpers
|
165
|
+
| |-- mailers
|
166
|
+
| |-- models
|
167
|
+
| `-- views
|
168
|
+
| `-- layouts
|
169
|
+
|-- config
|
170
|
+
| |-- environments
|
171
|
+
| |-- initializers
|
172
|
+
| `-- locales
|
173
|
+
|-- db
|
174
|
+
|-- doc
|
175
|
+
|-- lib
|
176
|
+
| |-- assets
|
177
|
+
| `-- tasks
|
178
|
+
|-- log
|
179
|
+
|-- public
|
180
|
+
|-- script
|
181
|
+
|-- test
|
182
|
+
| |-- fixtures
|
183
|
+
| |-- functional
|
184
|
+
| |-- integration
|
185
|
+
| |-- performance
|
186
|
+
| `-- unit
|
187
|
+
|-- tmp
|
188
|
+
| `-- cache
|
189
|
+
| `-- assets
|
190
|
+
`-- vendor
|
191
|
+
|-- assets
|
192
|
+
| |-- javascripts
|
193
|
+
| `-- stylesheets
|
194
|
+
`-- plugins
|
195
|
+
|
196
|
+
app
|
197
|
+
Holds all the code that's specific to this particular application.
|
198
|
+
|
199
|
+
app/assets
|
200
|
+
Contains subdirectories for images, stylesheets, and JavaScript files.
|
201
|
+
|
202
|
+
app/controllers
|
203
|
+
Holds controllers that should be named like weblogs_controller.rb for
|
204
|
+
automated URL mapping. All controllers should descend from
|
205
|
+
ApplicationController which itself descends from ActionController::Base.
|
206
|
+
|
207
|
+
app/models
|
208
|
+
Holds models that should be named like post.rb. Models descend from
|
209
|
+
ActiveRecord::Base by default.
|
210
|
+
|
211
|
+
app/views
|
212
|
+
Holds the template files for the view that should be named like
|
213
|
+
weblogs/index.html.erb for the WeblogsController#index action. All views use
|
214
|
+
eRuby syntax by default.
|
215
|
+
|
216
|
+
app/views/layouts
|
217
|
+
Holds the template files for layouts to be used with views. This models the
|
218
|
+
common header/footer method of wrapping views. In your views, define a layout
|
219
|
+
using the <tt>layout :default</tt> and create a file named default.html.erb.
|
220
|
+
Inside default.html.erb, call <% yield %> to render the view using this
|
221
|
+
layout.
|
222
|
+
|
223
|
+
app/helpers
|
224
|
+
Holds view helpers that should be named like weblogs_helper.rb. These are
|
225
|
+
generated for you automatically when using generators for controllers.
|
226
|
+
Helpers can be used to wrap functionality for your views into methods.
|
227
|
+
|
228
|
+
config
|
229
|
+
Configuration files for the Rails environment, the routing map, the database,
|
230
|
+
and other dependencies.
|
231
|
+
|
232
|
+
db
|
233
|
+
Contains the database schema in schema.rb. db/migrate contains all the
|
234
|
+
sequence of Migrations for your schema.
|
235
|
+
|
236
|
+
doc
|
237
|
+
This directory is where your application documentation will be stored when
|
238
|
+
generated using <tt>rake doc:app</tt>
|
239
|
+
|
240
|
+
lib
|
241
|
+
Application specific libraries. Basically, any kind of custom code that
|
242
|
+
doesn't belong under controllers, models, or helpers. This directory is in
|
243
|
+
the load path.
|
244
|
+
|
245
|
+
public
|
246
|
+
The directory available for the web server. Also contains the dispatchers and the
|
247
|
+
default HTML files. This should be set as the DOCUMENT_ROOT of your web
|
248
|
+
server.
|
249
|
+
|
250
|
+
script
|
251
|
+
Helper scripts for automation and generation.
|
252
|
+
|
253
|
+
test
|
254
|
+
Unit and functional tests along with fixtures. When using the rails generate
|
255
|
+
command, template test files will be generated for you and placed in this
|
256
|
+
directory.
|
257
|
+
|
258
|
+
vendor
|
259
|
+
External libraries that the application depends on. Also includes the plugins
|
260
|
+
subdirectory. If the app has frozen rails, those gems also go here, under
|
261
|
+
vendor/rails/. This directory is in the load path.
|