infopark_rails_connector 6.8.0.beta.200.621.4c8e1b0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +59 -0
- data/app/assets/images/admin/minus.gif +0 -0
- data/app/assets/images/bg80.png +0 -0
- data/app/assets/images/edit.png +0 -0
- data/app/assets/images/icons/mm_generic.png +0 -0
- data/app/assets/images/icons/mm_menu.png +0 -0
- data/app/assets/images/ratings/star.gif +0 -0
- data/app/assets/images/time_machine/calendar-menuarrow.gif +0 -0
- data/app/assets/images/time_machine/calendar_bg.png +0 -0
- data/app/assets/images/time_machine/icon.png +0 -0
- data/app/assets/images/time_machine/slider_bg.png +0 -0
- data/app/assets/images/time_machine/slider_handle.png +0 -0
- data/app/assets/images/time_machine/timemachine_bg.png +0 -0
- data/app/assets/javascripts/comments.js +29 -0
- data/app/assets/javascripts/editmarker.js +240 -0
- data/app/assets/javascripts/infopark_rails_connector.js.erb +3 -0
- data/app/assets/javascripts/initializer.js +9 -0
- data/app/assets/javascripts/ratings.js +26 -0
- data/app/assets/javascripts/time_machine/calendar-setup.js +200 -0
- data/app/assets/javascripts/time_machine/calendar.js +1806 -0
- data/app/assets/javascripts/time_machine/lang/calendar-de.js +127 -0
- data/app/assets/javascripts/time_machine/lang/calendar-en.js +127 -0
- data/app/assets/javascripts/time_machine/lang/calendar-es.js +129 -0
- data/app/assets/javascripts/time_machine/lang/calendar-fr.js +125 -0
- data/app/assets/javascripts/time_machine/lang/calendar-it.js +124 -0
- data/app/assets/javascripts/time_machine/slider.js +278 -0
- data/app/assets/javascripts/time_machine.js +8 -0
- data/app/assets/stylesheets/editmarker.css +70 -0
- data/app/assets/stylesheets/infopark_rails_connector.css.erb +4 -0
- data/app/assets/stylesheets/ratings.css +97 -0
- data/app/assets/stylesheets/time_machine/time_machine.css +292 -0
- data/app/assets/stylesheets/time_machine.css +6 -0
- data/app/controllers/cms_controller.rb +6 -0
- data/app/controllers/comments_controller.rb +6 -0
- data/app/controllers/crm_form_controller.rb +2 -0
- data/app/controllers/pdf_controller.rb +6 -0
- data/app/controllers/rails_connector/default_cms_controller.rb +40 -0
- data/app/controllers/rails_connector/default_comments_controller.rb +71 -0
- data/app/controllers/rails_connector/default_crm_form_controller.rb +167 -0
- data/app/controllers/rails_connector/default_pdf_controller.rb +136 -0
- data/app/controllers/rails_connector/default_ratings_controller.rb +84 -0
- data/app/controllers/rails_connector/default_rss_controller.rb +29 -0
- data/app/controllers/rails_connector/default_search_controller.rb +60 -0
- data/app/controllers/rails_connector/default_user_controller.rb +267 -0
- data/app/controllers/rails_connector/pdf_external_controller.rb +54 -0
- data/app/controllers/rails_connector/time_machine_controller.rb +48 -0
- data/app/controllers/ratings_controller.rb +6 -0
- data/app/controllers/rss_controller.rb +6 -0
- data/app/controllers/search_controller.rb +2 -0
- data/app/controllers/seo_sitemap_controller.rb +12 -0
- data/app/controllers/user_controller.rb +2 -0
- data/app/helpers/cms_helper.rb +6 -0
- data/app/helpers/cms_routing_helper.rb +6 -0
- data/app/helpers/crm_form_helper.rb +3 -0
- data/app/helpers/rails_connector/cms_asset_helper.rb +51 -0
- data/app/helpers/rails_connector/default_cms_helper.rb +27 -0
- data/app/helpers/rails_connector/default_cms_routing_helper.rb +93 -0
- data/app/helpers/rails_connector/default_crm_form_helper.rb +58 -0
- data/app/helpers/rails_connector/default_ratings_helper.rb +38 -0
- data/app/helpers/rails_connector/default_user_helper.rb +90 -0
- data/app/helpers/rails_connector/display_helper.rb +117 -0
- data/app/helpers/rails_connector/error_messages_helper.rb +23 -0
- data/app/helpers/rails_connector/layout_helper.rb +30 -0
- data/app/helpers/rails_connector/link_helper.rb +88 -0
- data/app/helpers/rails_connector/mandatory_label_helper.rb +10 -0
- data/app/helpers/rails_connector/marker_helper.rb +363 -0
- data/app/helpers/rails_connector/menu_helper.rb +72 -0
- data/app/helpers/rails_connector/micronav_helper.rb +107 -0
- data/app/helpers/rails_connector/seo_helper.rb +44 -0
- data/app/helpers/rails_connector/table_of_contents_helper.rb +20 -0
- data/app/helpers/rails_connector/time_machine_helper.rb +24 -0
- data/app/helpers/rails_connector/tracking_helper.rb +32 -0
- data/app/helpers/ratings_helper.rb +4 -0
- data/app/helpers/user_helper.rb +3 -0
- data/app/mailers/confirmation_mailer.rb +13 -0
- data/app/models/crm_form.rb +2 -0
- data/app/models/named_link.rb +2 -0
- data/app/models/obj.rb +9 -0
- data/app/models/rails_connector/default_comment.rb +28 -0
- data/app/models/rails_connector/default_rating.rb +20 -0
- data/app/models/rails_connector/link_list.rb +30 -0
- data/app/views/cms/_comments.html.erb +44 -0
- data/app/views/cms/_index.html.erb +7 -0
- data/app/views/cms/_rating.html.erb +31 -0
- data/app/views/cms/index.html.erb +3 -0
- data/app/views/comments/_comment.html.erb +28 -0
- data/app/views/confirmation_mailer/register_confirmation.erb +5 -0
- data/app/views/confirmation_mailer/reset_password.erb +5 -0
- data/app/views/crm_form/_flash_messages.html.erb +11 -0
- data/app/views/crm_form/_form.html.erb +17 -0
- data/app/views/crm_form/confirmation.html.erb +3 -0
- data/app/views/crm_form/index.html.erb +5 -0
- data/app/views/crm_form/not_logged_in.html.erb +1 -0
- data/app/views/errors/403_forbidden.html.erb +3 -0
- data/app/views/errors/410_gone.html.erb +7 -0
- data/app/views/layouts/rails_connector/time_machine.html.erb +12 -0
- data/app/views/pdf/index.html.erb +7 -0
- data/app/views/pdf/index.xsl +1240 -0
- data/app/views/rails_connector/time_machine/index.html.erb +88 -0
- data/app/views/rss/_item.rss.builder +11 -0
- data/app/views/rss/index.rss.builder +11 -0
- data/app/views/search/_hit.html.erb +12 -0
- data/app/views/search/_hits.html.erb +11 -0
- data/app/views/search/_mini_panel.html.erb +4 -0
- data/app/views/search/_pagination.html.erb +5 -0
- data/app/views/search/_panel.html.erb +4 -0
- data/app/views/search/search.html.erb +12 -0
- data/app/views/seo_sitemap/show.xml.builder +16 -0
- data/app/views/user/_flash_messages.html.erb +11 -0
- data/app/views/user/edit.html.erb +6 -0
- data/app/views/user/edit_password.html.erb +11 -0
- data/app/views/user/forgot_password.html.erb +7 -0
- data/app/views/user/login.html.erb +15 -0
- data/app/views/user/new.html.erb +11 -0
- data/app/views/user/profile.html.erb +8 -0
- data/app/views/user/register_pending.html.erb +1 -0
- data/app/views/user/set_password.html.erb +14 -0
- data/config/cms_routes.rb +13 -0
- data/config/locales/de.rails_connector.controllers.yml +30 -0
- data/config/locales/de.rails_connector.errors.yml +11 -0
- data/config/locales/de.rails_connector.helpers.yml +9 -0
- data/config/locales/de.rails_connector.lib.yml +6 -0
- data/config/locales/de.rails_connector.models.yml +8 -0
- data/config/locales/de.rails_connector.views.yml +87 -0
- data/config/locales/en.rails_connector.controllers.yml +30 -0
- data/config/locales/en.rails_connector.errors.yml +10 -0
- data/config/locales/en.rails_connector.helpers.yml +9 -0
- data/config/locales/en.rails_connector.lib.yml +6 -0
- data/config/locales/en.rails_connector.models.yml +8 -0
- data/config/locales/en.rails_connector.views.yml +87 -0
- data/config/routes.rb +37 -0
- data/lib/generators/rails_connector/comments/comments_generator.rb +21 -0
- data/lib/generators/rails_connector/comments/templates/migration.rb +17 -0
- data/lib/generators/rails_connector/install/install_generator.rb +38 -0
- data/lib/generators/rails_connector/install/templates/initializers/rails_connector.rb +58 -0
- data/lib/generators/rails_connector/install/templates/local/configuration.rb +2 -0
- data/lib/generators/rails_connector/install/templates/obj_extensions.rb +25 -0
- data/lib/generators/rails_connector/ratings/ratings_generator.rb +21 -0
- data/lib/generators/rails_connector/ratings/templates/migration.rb +15 -0
- data/lib/infopark_rails_connector.rb +31 -0
- data/lib/obj_extensions.rb +6 -0
- data/lib/rails_connector/authenticable.rb +30 -0
- data/lib/rails_connector/cms_accessible.rb +114 -0
- data/lib/rails_connector/cms_dispatch_controller.rb +47 -0
- data/lib/rails_connector/cms_env.rb +55 -0
- data/lib/rails_connector/cms_test_request.rb +23 -0
- data/lib/rails_connector/commentable.rb +23 -0
- data/lib/rails_connector/configuration/google_analytics.rb +29 -0
- data/lib/rails_connector/configuration/pdf_generator.rb +15 -0
- data/lib/rails_connector/configuration/rss.rb +46 -0
- data/lib/rails_connector/configuration.rb +235 -0
- data/lib/rails_connector/core_extensions/time.rb +18 -0
- data/lib/rails_connector/core_extensions.rb +1 -0
- data/lib/rails_connector/crm.rb +282 -0
- data/lib/rails_connector/engine.rb +78 -0
- data/lib/rails_connector/fop.rb +18 -0
- data/lib/rails_connector/fop_on_rails/document/dom_tree.rb +42 -0
- data/lib/rails_connector/fop_on_rails/document/images.rb +34 -0
- data/lib/rails_connector/fop_on_rails/document/tables.rb +67 -0
- data/lib/rails_connector/fop_on_rails/document.rb +25 -0
- data/lib/rails_connector/fop_on_rails.rb +92 -0
- data/lib/rails_connector/googlebot_checker.rb +47 -0
- data/lib/rails_connector/html_string.rb +19 -0
- data/lib/rails_connector/infopark_base.rb +2 -0
- data/lib/rails_connector/link_resolvable.rb +9 -0
- data/lib/rails_connector/liquid_support/action_marker.rb +69 -0
- data/lib/rails_connector/liquid_support/field_value_drop.rb +22 -0
- data/lib/rails_connector/liquid_support/general_helper_tag.rb +44 -0
- data/lib/rails_connector/liquid_support/link_drop.rb +22 -0
- data/lib/rails_connector/liquid_support/liquid_template_handler.rb +162 -0
- data/lib/rails_connector/liquid_support/named_object_drop.rb +14 -0
- data/lib/rails_connector/liquid_support/obj_drop.rb +43 -0
- data/lib/rails_connector/liquid_support/obj_filters.rb +77 -0
- data/lib/rails_connector/liquid_support.rb +23 -0
- data/lib/rails_connector/markdown_string.rb +19 -0
- data/lib/rails_connector/rateable.rb +57 -0
- data/lib/rails_connector/seo.rb +52 -0
- data/lib/rails_connector/ses.rb +72 -0
- data/lib/rails_connector/string_tagging.rb +29 -0
- data/lib/rails_connector/syndicateable.rb +11 -0
- data/lib/search_request.rb +2 -0
- data/lib/tasks/check.rake +25 -0
- data/lib/tasks/cms_license_check.rake +17 -0
- metadata +489 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
class ConfirmationMailer < ActionMailer::Base
|
2
|
+
def reset_password(recipient, confirmation_url)
|
3
|
+
@confirmation_url = confirmation_url
|
4
|
+
mail(:to => recipient, :subject =>
|
5
|
+
I18n.t("rails_connector.views.user.forgot_password_subject"))
|
6
|
+
end
|
7
|
+
|
8
|
+
def register_confirmation(recipient, confirmation_url)
|
9
|
+
@confirmation_url = confirmation_url
|
10
|
+
mail(:to => recipient, :subject =>
|
11
|
+
I18n.t("rails_connector.views.user.register_password_confirmation_mail_subject"))
|
12
|
+
end
|
13
|
+
end
|
data/app/models/obj.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "active_record"
|
2
|
+
|
3
|
+
module RailsConnector
|
4
|
+
|
5
|
+
# Abstract base class for Comment.
|
6
|
+
#
|
7
|
+
# Objects do only have comments if the addon <tt>:comments</tt> is enabled
|
8
|
+
# and the module Commentable is thereby included.
|
9
|
+
#
|
10
|
+
# A comment must have a name, email, subject, and body.
|
11
|
+
class DefaultComment < ActiveRecord::Base
|
12
|
+
self.abstract_class = true
|
13
|
+
|
14
|
+
belongs_to :obj
|
15
|
+
|
16
|
+
validates_presence_of :name, :message => I18n.t(:"rails_connector.models.comment.name_missing")
|
17
|
+
validates_presence_of :body, :message => I18n.t(:"rails_connector.models.comment.body_missing")
|
18
|
+
validates_presence_of :subject, :message => I18n.t(:"rails_connector.models.comment.subject_missing")
|
19
|
+
|
20
|
+
EMAIL_FORMAT = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
|
21
|
+
|
22
|
+
validates_format_of(
|
23
|
+
:email,
|
24
|
+
:with => EMAIL_FORMAT,
|
25
|
+
:message => I18n.t(:"rails_connector.models.comment.email_format_invalid")
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "active_record"
|
2
|
+
|
3
|
+
module RailsConnector
|
4
|
+
#
|
5
|
+
# This model is responsible for rating CMS objects.
|
6
|
+
class DefaultRating < ActiveRecord::Base
|
7
|
+
self.abstract_class = true
|
8
|
+
|
9
|
+
MINIMUM = 1
|
10
|
+
MAXIMUM = 5
|
11
|
+
|
12
|
+
belongs_to :obj
|
13
|
+
|
14
|
+
validates_uniqueness_of :score, :scope => :obj_id
|
15
|
+
validates_numericality_of :score, :count
|
16
|
+
validates_presence_of :obj_id, :score, :count
|
17
|
+
validates_inclusion_of :score, :in => MINIMUM..MAXIMUM
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module RailsConnector
|
2
|
+
|
3
|
+
class LinkList < Array
|
4
|
+
|
5
|
+
def initialize(link_definitions) #:nodoc:
|
6
|
+
if link_definitions.blank?
|
7
|
+
super([])
|
8
|
+
else
|
9
|
+
super(build_links(link_definitions.map(&:symbolize_keys)))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def destination_objects
|
14
|
+
self.map {|link| link.destination_object}.compact
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def build_links(link_definitions)
|
20
|
+
object_ids = link_definitions.map { |link_data| link_data[:destination] }.compact.uniq
|
21
|
+
objects = object_ids.empty? ? [] : Obj.find(object_ids)
|
22
|
+
link_definitions.each_with_object([]) do |link_data, links|
|
23
|
+
link = Link.new(link_data, objects.detect { |o| o && o.id == link_data[:destination] })
|
24
|
+
links << link if link.active?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<% if RailsConnector::Configuration.enabled?(:comments) and @obj.allow_comments? -%>
|
2
|
+
<div id="comments_container">
|
3
|
+
<span id="comments_header">
|
4
|
+
<%=t :"rails_connector.views.cms.comments.title" %>
|
5
|
+
</span>
|
6
|
+
<% if @obj.allow_anonymous_comments? or (not @obj.allow_anonymous_comments? and logged_in?) -%>
|
7
|
+
<div id="comment_form_container">
|
8
|
+
<%= form_for(@comment, :as => :comment,
|
9
|
+
:url => {:controller => "comments", :action => "create", :obj_id => @obj},
|
10
|
+
:html => {:id => "comment_form"}) do |f| %>
|
11
|
+
<div class="fieldset">
|
12
|
+
<fieldset>
|
13
|
+
<%= content_tag :legend, t(:"rails_connector.views.cms.comments.add_comment") %>
|
14
|
+
<% unless logged_in? -%>
|
15
|
+
<%= f.label :name, t(:"rails_connector.views.cms.comments.name"), :id => 'comment_form_name_label' %>
|
16
|
+
<%= f.text_field :name %><br />
|
17
|
+
<%= f.label :email, t(:"rails_connector.views.cms.comments.email"), :id => 'comment_form_email_label' %>
|
18
|
+
<%= f.text_field :email %><br />
|
19
|
+
<% end -%>
|
20
|
+
<%= f.label :subject, t(:"rails_connector.views.cms.comments.subject"), :id => 'comment_form_subject_label' %>
|
21
|
+
<%= f.text_field :subject, :size => 40 %><br />
|
22
|
+
<%= f.label :body, t(:"rails_connector.views.cms.comments.body"), :id => 'comment_form_body_label' %>
|
23
|
+
<%= f.text_area :body, :rows => 5, :cols => 50 %><br />
|
24
|
+
<%= submit_tag(t(:"rails_connector.views.cms.comments.submit"), :class => 'submit', :name => 'submit') %>
|
25
|
+
</fieldset>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
<% else -%>
|
30
|
+
<div class="login_required">
|
31
|
+
<%=t :"rails_connector.views.cms.comments.login_required" %>
|
32
|
+
</div>
|
33
|
+
<% end -%>
|
34
|
+
<div id="comment_list_container">
|
35
|
+
<% if @obj.comments.empty? -%>
|
36
|
+
<span id="no_comments">
|
37
|
+
<%=t :"rails_connector.views.cms.comments.no_comments" %>
|
38
|
+
</span>
|
39
|
+
<% else -%>
|
40
|
+
<%= render(:partial => 'comments/comment', :collection => @obj.comments, :as => :comment) %>
|
41
|
+
<% end -%>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<% end -%>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% if RailsConnector::Configuration.enabled?(:ratings) and @obj.allow_rating? %>
|
2
|
+
<% if @obj.allow_anonymous_rating? || logged_in? %>
|
3
|
+
<div id="starRating" data-default_description="<%= t "rails_connector.views.cms.rating.rate_here" %>">
|
4
|
+
<h4><%= t(:"rails_connector.views.cms.rating.title") %></h4>
|
5
|
+
<ul class="star-rating">
|
6
|
+
<li class="current-rating" style="width:<%= @obj.average_rating_in_percent %>%; margin:0; padding:0;"></li>
|
7
|
+
<%= stars_for_rating(@obj) unless rated_by_current_user?(@obj) %>
|
8
|
+
</ul>
|
9
|
+
<div id="starRating_label">
|
10
|
+
<% if rated_by_current_user?(@obj) %>
|
11
|
+
<%= t(:"rails_connector.views.cms.rating.thanks") %>
|
12
|
+
<% else %>
|
13
|
+
<%= t(:"rails_connector.views.cms.rating.rate_here") %>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
<% if admin? %>
|
17
|
+
<div class="admin">
|
18
|
+
<%= link_to(ratings_url(:action => :reset, :id => @obj.id),
|
19
|
+
:confirm => t("rails_connector.views.cms.rating.are_you_sure")) do %>
|
20
|
+
<%= t("rails_connector.views.cms.rating.reset") %>
|
21
|
+
<%= image_tag("admin/minus.gif") %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
26
|
+
<% else %>
|
27
|
+
<div class="rating_login_required">
|
28
|
+
<%=t :"rails_connector.views.cms.rating.login_required" %>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div class="comment" id="comment_<%= comment.id %>">
|
2
|
+
<% if admin? %>
|
3
|
+
<div class="admin">
|
4
|
+
<%= link_to(comment_path(:action => :delete, :id => comment),
|
5
|
+
:confirm => t("rails_connector.views.cms.comments.are_you_sure")) do %>
|
6
|
+
<%= image_tag("admin/minus.gif") %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<div class="info">
|
12
|
+
<span class="name">
|
13
|
+
<%= comment.name %>
|
14
|
+
</span>
|
15
|
+
|
16
|
+
<%=t :"rails_connector.views.cms.comments.wrote_on" %>
|
17
|
+
|
18
|
+
<span class="created_at">
|
19
|
+
<%=l comment.created_at %>
|
20
|
+
</span>
|
21
|
+
</div>
|
22
|
+
<span class="subject">
|
23
|
+
<%= comment.subject %>
|
24
|
+
</span>
|
25
|
+
<div class="body">
|
26
|
+
<%= simple_format(strip_tags(comment.body)) %>
|
27
|
+
</div>
|
28
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_tag cms_path(@obj) do -%>
|
2
|
+
<% unless logged_in? -%>
|
3
|
+
<%= fields_for :user, @user do |registration| -%>
|
4
|
+
<%= profile_fields_for(registration, editable_attributes_on_register) %>
|
5
|
+
<% end -%>
|
6
|
+
<% else -%>
|
7
|
+
<p>
|
8
|
+
<%= logged_in_as(current_user.login) %>
|
9
|
+
— <%= link_to('Logout', user_path(:action => 'logout', :return_to => request.fullpath)) %>
|
10
|
+
</p>
|
11
|
+
<% end -%>
|
12
|
+
<%= fields_for :activity do |f| -%>
|
13
|
+
<%= title_field_for(f) %>
|
14
|
+
<%= custom_fields_for(f) %>
|
15
|
+
<% end -%>
|
16
|
+
<%= submit_tag t('rails_connector.views.crm_form.submit') %>
|
17
|
+
<% end -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div><%= t(:'rails_connector.views.crm_form.must_be_logged_in') %></div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<h1><%= t(:'rails_connector.lib.cms_accessible.not_released') %></h1>
|
2
|
+
|
3
|
+
<% if @valid_until and @valid_until < Obj.preview_time %>
|
4
|
+
<%= raw t(:"rails_connector.views.errors.gone.not_released_anymore", :valid_until => "<strong>#{l @valid_until}</strong>") %>
|
5
|
+
<% elsif @valid_from and Obj.preview_time < @valid_from %>
|
6
|
+
<%= raw t(:"rails_connector.views.errors.gone.not_yet_released", :valid_from => "<strong>#{l @valid_from}</strong>") %>
|
7
|
+
<% end %>
|