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
@@ -0,0 +1,17 @@
|
|
1
|
+
module Quadro
|
2
|
+
class Widget::Slider < Widget
|
3
|
+
# attributes
|
4
|
+
attr_accessible :content
|
5
|
+
store :settings, accessors: [:width, :height]
|
6
|
+
|
7
|
+
# associations
|
8
|
+
has_many :slides, as: :assetable, class_name: Quadro::Asset::Slide
|
9
|
+
|
10
|
+
# methods
|
11
|
+
class << self
|
12
|
+
def short_name
|
13
|
+
'slider'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
!!!
|
2
|
+
%html(lang="#{I18n.locale}" prefix="og: http://ogp.me/ns#")
|
3
|
+
%head
|
4
|
+
%meta(charset='utf-8')
|
5
|
+
%meta(content='width=device-width, initial-scale=1.0' name='viewport')
|
6
|
+
%title= page.title
|
7
|
+
%meta(content="#{page.summary}" name="description")
|
8
|
+
%meta(content="#{page.author}" name="author")
|
9
|
+
%meta(content="#{Quadro::SIGNATURE}" name="generator")
|
10
|
+
%meta(content="#{page.title}" property="og:title")
|
11
|
+
%meta(content="#{page.summary}" property="og:description")
|
12
|
+
%meta(content="#{page.is_root? ? 'website' : 'article'}" property="og:type")
|
13
|
+
%meta(content="#{page.is_root? ? root_url : page_url(page)}" property="og:url")
|
14
|
+
%meta(content="#{absolute_url(page.cover.url(:large))}" property="og:image")
|
15
|
+
- unless Quadro.config.facebook_id.blank?
|
16
|
+
%meta(content="#{Quadro.config.facebook_id}" property="fb:app_id")
|
17
|
+
%meta(name="twitter:card" content="summary")
|
18
|
+
- unless Quadro.config.twitter_username.blank?
|
19
|
+
%meta(name="twitter:site" content="@#{Quadro.config.twitter_username}")
|
20
|
+
%link(href="#{page.is_root? ? root_url : page_url(page)}" rel="canonical")
|
21
|
+
= auto_discovery_link_tag :rss, rss_path, title: root.title
|
22
|
+
= auto_discovery_link_tag :atom, atom_path, title: root.title
|
23
|
+
= stylesheet_link_tag 'quadro/application'
|
24
|
+
= favicon_link_tag 'quadro/favicon.ico'
|
25
|
+
= csrf_meta_tags
|
26
|
+
%body(class="#{(user_signed_in? ? 'quadro-signed-in' : '')}")
|
27
|
+
= yield
|
28
|
+
- if user_signed_in?
|
29
|
+
= render 'quadro/shared/toolbar'
|
30
|
+
= render 'quadro/shared/modal'
|
31
|
+
= javascript_include_tag 'quadro/application'
|
32
|
+
= javascript_include_tag "//maps.google.com/maps/api/js?key=#{Quadro.config.google_maps_api_key}"
|
33
|
+
= yield :javascript
|
@@ -0,0 +1,11 @@
|
|
1
|
+
!!!
|
2
|
+
%html(lang="#{I18n.locale}")
|
3
|
+
%head
|
4
|
+
%meta(charset='utf-8')
|
5
|
+
%meta(content='width=device-width, initial-scale=1.0' name='viewport')
|
6
|
+
%meta(name='robots' content='none')
|
7
|
+
= stylesheet_link_tag 'quadro/application'
|
8
|
+
= favicon_link_tag 'quadro/favicon.ico'
|
9
|
+
= csrf_meta_tags
|
10
|
+
%body
|
11
|
+
= yield
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if asset.persisted? %>
|
2
|
+
<% case asset.type.constantize.short_name %>
|
3
|
+
<% when 'image' %>
|
4
|
+
$('.asset-list').filter('[data-assetable-type="<%= asset.assetable.class.to_s %>"],[data-assetable-id="<%= asset.assetable.id %>"]').append('<%= escape_javascript(render("quadro/assets/image/image", asset: asset, page: page))%>');
|
5
|
+
<% when 'slide' %>
|
6
|
+
$('.asset-list').filter('[data-assetable-type="<%= asset.assetable.class.to_s %>"],[data-assetable-id="<%= asset.assetable.id %>"]').append('<%= escape_javascript(render("quadro/assets/slide/slide", asset: asset, widget: widget, page: page))%>');
|
7
|
+
<% end %>
|
8
|
+
new Message('Asset created');
|
9
|
+
<% else %>
|
10
|
+
new Message('Asset not created');
|
11
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if asset.destroyed? %>
|
2
|
+
<% case asset.type.constantize.short_name %>
|
3
|
+
<% when 'image' %>
|
4
|
+
$('#image-<%= asset.id %>').remove();
|
5
|
+
<% when 'slide' %>
|
6
|
+
$('#slide-<%= asset.id %>').remove();
|
7
|
+
<% end %>
|
8
|
+
new Message('Asset deleted');
|
9
|
+
<% else %>
|
10
|
+
new Message('Asset not deleted');
|
11
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% if asset.present? %>
|
2
|
+
<% case asset.type.constantize.short_name %>
|
3
|
+
<% when 'image' %>
|
4
|
+
$("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/image/form', asset: asset, page: page)) %>");
|
5
|
+
<% when 'slide' %>
|
6
|
+
$("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/slide/form', asset: asset, widget: widget, page: page)) %>");
|
7
|
+
<% end %>
|
8
|
+
$("#quadro-modal").modal("show");
|
9
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.modal-header
|
2
|
+
%button.close(data-dismiss="modal" type="button")
|
3
|
+
%span(aria-hidden="true") ×
|
4
|
+
%span.sr-only Close
|
5
|
+
%h4.modal-title Edit image
|
6
|
+
.modal-body
|
7
|
+
= simple_form_for asset, as: :asset, url: (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(page_id: page.id, id: asset.id)), method: :put, multipart: true, remote: true do |form|
|
8
|
+
.row
|
9
|
+
.col-md-4
|
10
|
+
.fileinput.fileinput-new(data-provides="fileinput")
|
11
|
+
.fileinput-new.thumbnail
|
12
|
+
= image_tag form.object.attachment.url(:small)
|
13
|
+
.fileinput-preview.fileinput-exists.thumbnail
|
14
|
+
.text-center
|
15
|
+
%span.btn.btn-default.btn-file
|
16
|
+
%span.fileinput-new Select image
|
17
|
+
%span.fileinput-exists Change
|
18
|
+
= form.input_field :attachment
|
19
|
+
%a.btn.btn-default.fileinput-exists(data-dismiss="fileinput" href="#") Remove
|
20
|
+
.col-md-8
|
21
|
+
= form.input :alt, input_html: { class: 'form-control' }
|
22
|
+
= form.input :width, input_html: { class: 'form-control' }
|
23
|
+
= form.input :height, input_html: { class: 'form-control' }
|
24
|
+
.text-right
|
25
|
+
= form.submit class: 'btn btn-primary'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
.col-xs-6.col-sm-6.col-md-3.col-lg-2(id="image-#{asset.id}")
|
2
|
+
.thumbnail
|
3
|
+
= image_tag asset.url(:small), alt: asset.alt
|
4
|
+
.caption.clearfix
|
5
|
+
.pull-right
|
6
|
+
|
7
|
+
= link_to (widget.present? ? edit_page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : edit_page_asset_path(id: asset.id, page_id: page.id)), remote: true, class: "btn btn-link btn-xs" do
|
8
|
+
%i.fa.fa-cog.text-muted
|
9
|
+
= link_to (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(id: asset.id, page_id: page.id)), method: "delete", confirm: "Are you sure of delete this image?", remote: true, class: "btn btn-link btn-xs" do
|
10
|
+
%i.fa.fa-trash-o.text-danger
|
@@ -0,0 +1,26 @@
|
|
1
|
+
.modal-header
|
2
|
+
%button.close(data-dismiss="modal" type="button")
|
3
|
+
%span(aria-hidden="true") ×
|
4
|
+
%span.sr-only Close
|
5
|
+
%h4.modal-title Edit slide
|
6
|
+
.modal-body
|
7
|
+
= simple_form_for asset, as: :asset, url: (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(page_id: page.id, id: asset.id)), method: :put, multipart: true, remote: true do |form|
|
8
|
+
.row
|
9
|
+
.col-md-4
|
10
|
+
.fileinput.fileinput-new(data-provides="fileinput")
|
11
|
+
.fileinput-new.thumbnail
|
12
|
+
= image_tag form.object.attachment.url(:small)
|
13
|
+
.fileinput-preview.fileinput-exists.thumbnail
|
14
|
+
.text-center
|
15
|
+
%span.btn.btn-default.btn-file
|
16
|
+
%span.fileinput-new Select slide
|
17
|
+
%span.fileinput-exists Change
|
18
|
+
= form.input_field :attachment
|
19
|
+
%a.btn.btn-default.fileinput-exists(data-dismiss="fileinput" href="#") Remove
|
20
|
+
.col-md-8
|
21
|
+
= form.input :alt, input_html: { class: 'form-control' }
|
22
|
+
= form.input :width, input_html: { class: 'form-control' }
|
23
|
+
= form.input :height, input_html: { class: 'form-control' }
|
24
|
+
= form.input :href, input_html: { class: 'form-control' }
|
25
|
+
.text-right
|
26
|
+
= form.submit class: 'btn btn-primary'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.col-xs-6.col-sm-4.col-md-3.col-lg-2(id="slide-#{asset.id}")
|
2
|
+
.thumbnail
|
3
|
+
= image_tag asset.url(:small), alt: asset.alt
|
4
|
+
.caption.clearfix
|
5
|
+
.pull-right
|
6
|
+
= link_to edit_page_widget_asset_path(id: asset.id, widget_id: widget.id, page_id: page.id), remote: true, class: "btn btn-link btn-xs" do
|
7
|
+
%i.fa.fa-cog.text-muted
|
8
|
+
= link_to page_widget_asset_path(id: asset.id, widget_id: widget.id, page_id: page.id), method: "delete", confirm: "Are you sure of delete this slide?", remote: true, class: "btn btn-link btn-xs" do
|
9
|
+
%i.fa.fa-trash-o.text-danger
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if asset.errors.size > 0 %>
|
2
|
+
<% case asset.type.constantize.short_name %>
|
3
|
+
<% when 'image' %>
|
4
|
+
$("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/image/form', asset: asset, page: page)) %>");
|
5
|
+
<% when 'slide' %>
|
6
|
+
$("#quadro-modal .modal-content").html("<%= escape_javascript(render('quadro/assets/slide/form', asset: asset, widget: widget, page: page)) %>");
|
7
|
+
<% end %>
|
8
|
+
new Message('Asset not updated');
|
9
|
+
<% else %>
|
10
|
+
<% case asset.type.constantize.short_name %>
|
11
|
+
<% when 'image' %>
|
12
|
+
$('#image-<%= asset.id %>').replaceWith('<%= escape_javascript(render("quadro/assets/image/image", asset: asset, page: page))%>');
|
13
|
+
<% when 'slide' %>
|
14
|
+
$('#slide-<%= asset.id %>').replaceWith('<%= escape_javascript(render("quadro/assets/slide/slide", asset: asset, widget: widget, page: page))%>');
|
15
|
+
<% end %>
|
16
|
+
$("#quadro-modal").modal('hide');
|
17
|
+
new Message('Asset updated');
|
18
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
xml.instruct! :xml, version: "1.0", encoding: "utf-8"
|
2
|
+
xml.feed xmlns: "http://www.w3.org/2005/Atom" do
|
3
|
+
xml.id Quadro.railtie_routes_url_helpers.page_url(root)
|
4
|
+
xml.title root.title
|
5
|
+
xml.updated l(root.updated_at, format: :atom, locale: :en)
|
6
|
+
xml.subtitle root.summary
|
7
|
+
xml.link href: Quadro.railtie_routes_url_helpers.atom_url, rel: "self"
|
8
|
+
xml.link href: Quadro.railtie_routes_url_helpers.root_url
|
9
|
+
xml.icon absolute_url(root.cover.url(:thumb))
|
10
|
+
xml.logo absolute_url(root.cover.url(:small))
|
11
|
+
xml.generator Quadro::SIGNATURE
|
12
|
+
|
13
|
+
root.descendants.ordered.each do |page|
|
14
|
+
xml.entry do
|
15
|
+
xml.id Quadro.railtie_routes_url_helpers.page_url(page)
|
16
|
+
xml.title page.title
|
17
|
+
xml.updated l(page.updated_at, format: :atom, locale: :en)
|
18
|
+
xml.published l(page.created_at, format: :atom, locale: :en)
|
19
|
+
xml.summary page.summary
|
20
|
+
xml.author do
|
21
|
+
xml.name page.author_name
|
22
|
+
xml.email page.author_email
|
23
|
+
end
|
24
|
+
xml.link href: Quadro.railtie_routes_url_helpers.page_url(page)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
xml.instruct! :xml, version: "1.0", encoding: "utf-8"
|
2
|
+
xml.rss version: "2.0" do
|
3
|
+
xml.channel do
|
4
|
+
xml.title root.title
|
5
|
+
xml.description root.summary
|
6
|
+
xml.link Quadro.railtie_routes_url_helpers.root_url
|
7
|
+
xml.image do
|
8
|
+
xml.url absolute_url(root.cover.url(:small))
|
9
|
+
xml.title root.title
|
10
|
+
xml.link Quadro.railtie_routes_url_helpers.root_url
|
11
|
+
end
|
12
|
+
xml.generator Quadro::SIGNATURE
|
13
|
+
|
14
|
+
root.descendants.ordered.each do |page|
|
15
|
+
xml.item do
|
16
|
+
xml.title page.title
|
17
|
+
xml.description page.summary
|
18
|
+
xml.link Quadro.railtie_routes_url_helpers.page_url(page)
|
19
|
+
xml.pubDate l(page.created_at, format: :rss, locale: :en)
|
20
|
+
xml.author page.author_email
|
21
|
+
xml.guid Quadro.railtie_routes_url_helpers.page_url(page), isPermaLink: true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
- user_agent = UserAgent.parse(interaction.user_agent)
|
2
|
+
- location = geoip.lookup(interaction.ip_address)
|
3
|
+
|
4
|
+
%li
|
5
|
+
%ul.list-inline
|
6
|
+
%li.text-capitalize
|
7
|
+
%strong Date
|
8
|
+
%li= l(interaction.created_at, format: :long)
|
9
|
+
%li.text-capitalize
|
10
|
+
%strong Browser
|
11
|
+
%li
|
12
|
+
= user_agent.browser
|
13
|
+
%small= user_agent.version
|
14
|
+
%li.text-capitalize
|
15
|
+
%strong Location
|
16
|
+
%li
|
17
|
+
= interaction.ip_address
|
18
|
+
%small= location.found? ? location.country.iso_code : '??'
|
19
|
+
- interaction.content.keys.each do |key|
|
20
|
+
%li.text-capitalize
|
21
|
+
%strong= key
|
22
|
+
%li= interaction.content[key]
|
@@ -0,0 +1,35 @@
|
|
1
|
+
.modal-header
|
2
|
+
%button.close(data-dismiss="modal" type="button")
|
3
|
+
%span(aria-hidden="true") ×
|
4
|
+
%span.sr-only Close
|
5
|
+
%h4.modal-title Edit page
|
6
|
+
.modal-body
|
7
|
+
= simple_form_for page, multipart: true, remote: true do |form|
|
8
|
+
- form.object.build_cover if form.object.cover.nil?
|
9
|
+
= hidden_field_tag :is_root, true if page.is_root?
|
10
|
+
.row
|
11
|
+
.col-md-4
|
12
|
+
.fileinput.fileinput-new(data-provides="fileinput")
|
13
|
+
.fileinput-new.thumbnail
|
14
|
+
= image_tag form.object.cover.url(:large)
|
15
|
+
.fileinput-preview.fileinput-exists.thumbnail
|
16
|
+
.text-center
|
17
|
+
%span.btn.btn-default.btn-file
|
18
|
+
%span.fileinput-new Select cover
|
19
|
+
%span.fileinput-exists Change
|
20
|
+
= form.simple_fields_for :cover do |cover|
|
21
|
+
= cover.input_field :attachment
|
22
|
+
%a.btn.btn-default.fileinput-exists(data-dismiss="fileinput" href="#") Remove
|
23
|
+
.col-md-8
|
24
|
+
= form.input :title, input_html: { class: 'form-control' }
|
25
|
+
= form.input :summary, as: :text, input_html: { class: 'form-control', rows: 2 }
|
26
|
+
= form.input :author_id, collection: users, input_html: { class: 'form-control' }
|
27
|
+
.row
|
28
|
+
.col-md-4
|
29
|
+
= form.input :template, collection: page.templates, input_html: { class: 'form-control' }
|
30
|
+
.col-md-4
|
31
|
+
= form.input :frequency, collection: Quadro::Page::SITEMAP_FREQUENCY, input_html: { class: 'form-control' }
|
32
|
+
.col-md-4
|
33
|
+
= form.input :priority, collection: Quadro::Page::SITEMAP_PRIORITY, input_html: { class: 'form-control' }
|
34
|
+
.text-right
|
35
|
+
= form.submit class: 'btn btn-primary'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.modal-header
|
2
|
+
%button.close(data-dismiss="modal" type="button")
|
3
|
+
%span(aria-hidden="true") ×
|
4
|
+
%span.sr-only Close
|
5
|
+
%h4.modal-title New page
|
6
|
+
.modal-body
|
7
|
+
= simple_form_for page, url: pages_path(parent_id: params[:parent_id]), remote: true do |form|
|
8
|
+
= form.input :title, input_html: { class: 'form-control' }
|
9
|
+
= form.input :template, collection: page.templates, input_html: { class: 'form-control' }
|
10
|
+
%p.text-right
|
11
|
+
= form.submit class: 'btn btn-primary'
|
@@ -0,0 +1 @@
|
|
1
|
+
= render "quadro/shared/templates/page/#{Quadro.config.layout}", page: page
|
@@ -0,0 +1 @@
|
|
1
|
+
= render "quadro/shared/templates/#{page.template}", page: page
|
@@ -0,0 +1 @@
|
|
1
|
+
= render "quadro/shared/templates/#{page.template}", page: page
|
@@ -0,0 +1,17 @@
|
|
1
|
+
%nav.navbar.navbar-default.navbar-fixed-top(role='navigation')
|
2
|
+
.container
|
3
|
+
.navbar-header
|
4
|
+
%button.navbar-toggle.collapsed(data-target='#navigation' data-toggle='collapse' type='button')
|
5
|
+
%span.sr-only Toggle navigation
|
6
|
+
%span.icon-bar
|
7
|
+
%span.icon-bar
|
8
|
+
%span.icon-bar
|
9
|
+
= link_to root_path, class: 'navbar-brand' do
|
10
|
+
= Quadro.config.site
|
11
|
+
#navigation.collapse.navbar-collapse
|
12
|
+
- unless user_signed_in?
|
13
|
+
%ul.nav.navbar-nav.navbar-right
|
14
|
+
%li
|
15
|
+
= link_to new_user_session_path, rel: "nofollow" do
|
16
|
+
Sign In
|
17
|
+
= navigation_for root, class: "nav navbar-nav navbar-right"
|