gluttonberg-core 2.5.9 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,7 +62,7 @@
62
62
 
63
63
  .ui360 a:hover,
64
64
  .ui360 a:focus {
65
- background:#eee;
65
+ /*background-color:#eee;*/
66
66
  border-radius:3px;
67
67
  outline:none;
68
68
  }
@@ -1,31 +1,31 @@
1
1
  module Gluttonberg
2
2
  module Public
3
3
  class ArticlesController < Gluttonberg::Public::BaseController
4
-
4
+
5
5
  def index
6
6
  @blog = Gluttonberg::Blog.published.first(:conditions => {:slug => params[:blog_id]}, :include => [:articles])
7
7
  raise ActiveRecord::RecordNotFound.new if @blog.blank?
8
8
  @articles = @blog.articles.published
9
-
9
+
10
10
  respond_to do |format|
11
11
  format.html
12
12
  format.rss { render :layout => false }
13
13
  end
14
14
  end
15
-
15
+
16
16
  def show
17
-
17
+
18
18
  @blog = Gluttonberg::Blog.published.first(:conditions => {:slug => params[:blog_id]})
19
-
19
+
20
20
  if @blog.blank?
21
21
  @blog = Gluttonberg::Blog.published.first(:conditions => {:previous_slug => params[:blog_id]})
22
-
22
+
23
23
  unless @blog.blank?
24
24
  redirect_to blog_article_path(:blog_id => @blog.slug , :id => params[:id]) , :status => 301
25
25
  return
26
26
  end
27
27
  end
28
-
28
+
29
29
  raise ActiveRecord::RecordNotFound.new if @blog.blank?
30
30
  @article = Gluttonberg::Article.published.first(:conditions => {:slug => params[:id], :blog_id => @blog.id})
31
31
  if @article.blank?
@@ -35,18 +35,24 @@ module Gluttonberg
35
35
  return
36
36
  end
37
37
  end
38
-
38
+
39
39
  raise ActiveRecord::RecordNotFound.new if @article.blank?
40
40
  @article.load_localization(env['gluttonberg.locale'])
41
41
  @comments = @article.comments.where(:approved => true)
42
42
  @comment = Comment.new(:subscribe_to_comments => true)
43
+ respond_to do |format|
44
+ format.html
45
+ end
43
46
  end
44
-
47
+
45
48
  def tag
46
- @articles = Article.tagged_with(params[:tag]).includes(:blog).published
47
- @tags = Gluttonberg::Article.published.tag_counts_on(:tag)
49
+ @articles = Article.tagged_with(params[:tag]).includes(:blog).published
50
+ @tags = Gluttonberg::Article.published.tag_counts_on(:tag)
51
+ respond_to do |format|
52
+ format.html
53
+ end
48
54
  end
49
-
55
+
50
56
  def unsubscribe
51
57
  @subscription = CommentSubscription.find(:first , :conditions => {:reference_hash => params[:reference] })
52
58
  unless @subscription.blank?
@@ -54,8 +60,11 @@ module Gluttonberg
54
60
  flash[:notice] = "You are successfully unsubscribe from comments of \"#{@subscription.article.title}\""
55
61
  redirect_to blog_article_url(@subscription.article.blog.slug, @subscription.article.slug)
56
62
  end
63
+ respond_to do |format|
64
+ format.html
65
+ end
57
66
  end
58
-
67
+
59
68
  def preview
60
69
  @blog = Gluttonberg::Blog.first(:conditions => {:slug => params[:blog_id]})
61
70
  raise ActiveRecord::RecordNotFound.new if @blog.blank?
@@ -64,7 +73,7 @@ module Gluttonberg
64
73
  raise ActiveRecord::RecordNotFound.new if @article.blank?
65
74
  render :show
66
75
  end
67
-
76
+
68
77
  end
69
78
  end
70
79
  end
@@ -1,18 +1,20 @@
1
1
  module Gluttonberg
2
2
  module Public
3
3
  class FlagController < Gluttonberg::Public::BaseController
4
-
4
+
5
5
  def new
6
6
  model = nil
7
7
  if params[:flaggable_type].include?("Gluttonberg::")
8
8
  model = Gluttonberg.const_get(params[:flaggable_type][13..-1])
9
- else
9
+ else
10
10
  model = Kernel.const_get(params[:flaggable_type])
11
- end
11
+ end
12
12
  @flaggable = model.find(params[:flaggable_id])
13
-
13
+ respond_to do |format|
14
+ format.html
15
+ end
14
16
  end
15
-
17
+
16
18
  def create
17
19
  flag = current_user.flags.create params[:flag]
18
20
  flash[:notice] = if flag.new_record?
@@ -24,22 +26,21 @@ module Gluttonberg
24
26
 
25
27
  respond_to do |format|# note: you'll need to ensure that this route exists
26
28
  format.html {
27
- url = ""
29
+ url = ""
28
30
  begin
29
31
  if flag.flaggable.respond_to?(:commentable)
30
32
  url = polymorphic_path(flag.flaggable.commentable)
31
33
  else
32
34
  url = polymorphic_path(flag.flaggable)
33
- end
35
+ end
34
36
  flag.update_attributes(:url => url)
35
37
  redirect_to url
36
38
  rescue => e
37
39
  end
38
40
  }
39
- # format.js # render some js trickery
40
41
  end
41
42
  end
42
-
43
+
43
44
  end
44
45
  end
45
46
  end
@@ -1,14 +1,17 @@
1
1
  module Gluttonberg
2
2
  module Public
3
- class MemberPasswordResetsController < Gluttonberg::Public::BaseController
3
+ class MemberPasswordResetsController < Gluttonberg::Public::BaseController
4
4
  skip_before_filter :require_member
5
5
  before_filter :load_member_using_perishable_token, :only => [:edit, :update]
6
-
6
+
7
7
  layout 'public'
8
-
8
+
9
9
  def new
10
+ respond_to do |format|
11
+ format.html
12
+ end
10
13
  end
11
-
14
+
12
15
  def create
13
16
  @member = Member.find_by_email(params[:gluttonberg_member][:email])
14
17
  if @member
@@ -21,11 +24,13 @@ module Gluttonberg
21
24
  redirect_to root_path
22
25
  end
23
26
  end
24
-
27
+
25
28
  def edit
26
-
29
+ respond_to do |format|
30
+ format.html
31
+ end
27
32
  end
28
-
33
+
29
34
  def update
30
35
  @member.password = params[:gluttonberg_member][:password]
31
36
  @member.password_confirmation = params[:gluttonberg_member][:password_confirmation]
@@ -36,9 +41,9 @@ module Gluttonberg
36
41
  render :edit
37
42
  end
38
43
  end
39
-
44
+
40
45
  private
41
-
46
+
42
47
  def load_member_using_perishable_token
43
48
  @member = Member.find_using_perishable_token(params[:id])
44
49
  unless @member
@@ -49,7 +54,7 @@ module Gluttonberg
49
54
  redirect_to root_path
50
55
  end
51
56
  end
52
-
57
+
53
58
  end
54
59
  end
55
60
  end
@@ -1,15 +1,18 @@
1
1
  module Gluttonberg
2
2
  module Public
3
3
  class MemberSessionsController < Gluttonberg::Public::BaseController
4
-
4
+
5
5
  layout 'public'
6
6
  before_filter :is_members_enabled
7
7
  skip_before_filter :require_member, :only => [:new, :create]
8
-
8
+
9
9
  def new
10
10
  @member_session = MemberSession.new
11
+ respond_to do |format|
12
+ format.html
13
+ end
11
14
  end
12
-
15
+
13
16
  def create
14
17
  @member_session = MemberSession.new(params[:member_session])
15
18
  if @member_session.save
@@ -19,7 +22,7 @@ module Gluttonberg
19
22
  render :action => :new
20
23
  end
21
24
  end
22
-
25
+
23
26
  def destroy
24
27
  current_member_session.destroy
25
28
  flash[:notice] = "Logout successful!"
@@ -2,20 +2,23 @@ module Gluttonberg
2
2
  module Public
3
3
  class MembersController < Gluttonberg::Public::BaseController
4
4
  before_filter :is_members_enabled
5
-
5
+
6
6
  before_filter :require_member , :only => [ :edit, :update, :show ]
7
7
  layout 'public'
8
-
8
+
9
9
  def new
10
10
  @page_title = "Register"
11
11
  @member = Member.new
12
+ respond_to do |format|
13
+ format.html
14
+ end
12
15
  end
13
-
16
+
14
17
  def create
15
18
  @member = Member.new(params[:gluttonberg_member])
16
19
  if Member.does_email_verification_required
17
20
  @member.confirmation_key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..24]
18
- else
21
+ else
19
22
  @member.profile_confirmed = true
20
23
  end
21
24
  if @member && @member.save
@@ -31,8 +34,8 @@ module Gluttonberg
31
34
  render :new
32
35
  end
33
36
  end
34
-
35
-
37
+
38
+
36
39
  def confirm
37
40
  @member = Member.where(:confirmation_key => params[:key]).first
38
41
  if @member
@@ -47,7 +50,7 @@ module Gluttonberg
47
50
  redirect_to root_url
48
51
  end
49
52
  end
50
-
53
+
51
54
  def resend_confirmation
52
55
  if current_member.confirmation_key.blank?
53
56
  confirmation_key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..24]
@@ -58,7 +61,7 @@ module Gluttonberg
58
61
  flash[:notice] = "Please check your email for a confirmation."
59
62
  redirect_to member_profile_url
60
63
  end
61
-
64
+
62
65
  def update
63
66
  @member = current_member
64
67
  if @member.update_attributes(params[:gluttonberg_member])
@@ -70,19 +73,25 @@ module Gluttonberg
70
73
  end
71
74
  end
72
75
  end
73
-
76
+
74
77
  def show
75
78
  @member = current_member
79
+ respond_to do |format|
80
+ format.html
81
+ end
76
82
  end
77
-
83
+
78
84
  def edit
79
85
  @member = current_member
86
+ respond_to do |format|
87
+ format.html
88
+ end
80
89
  end
81
-
82
-
83
-
90
+
91
+
92
+
84
93
  protected
85
-
94
+
86
95
  end
87
96
  end
88
97
  end
@@ -2,23 +2,23 @@ module Gluttonberg
2
2
  module Public
3
3
  class PagesController < Gluttonberg::Public::BaseController
4
4
  before_filter :retrieve_page , :only => [ :show ]
5
-
5
+
6
6
  # If localized template file exist then render that file otherwise render non-localized template
7
7
  def show
8
8
  if Gluttonberg::Member.enable_members == true && !@page.is_public?
9
9
  return unless require_member
10
10
  unless current_member.does_member_have_access_to_the_page?(page)
11
11
  raise CanCan::AccessDenied
12
- end
12
+ end
13
13
  end
14
-
14
+
15
15
  template = page.view
16
16
  template_path = "pages/#{template}"
17
-
17
+
18
18
  if locale && File.exists?(File.join(Rails.root, "app/views/pages/#{template}.#{locale.slug}.html.haml" ) )
19
19
  template_path = "pages/#{template}.#{locale.slug}"
20
- end
21
-
20
+ end
21
+
22
22
  # do not render layout for ajax requests
23
23
  if request.xhr?
24
24
  render :template => template_path, :layout => false
@@ -26,7 +26,7 @@ module Gluttonberg
26
26
  render :template => template_path, :layout => page.layout
27
27
  end
28
28
  end
29
-
29
+
30
30
  def restrict_site_access
31
31
  setting = Gluttonberg::Setting.get_setting("restrict_site_access")
32
32
  if setting == params[:password]
@@ -34,11 +34,13 @@ module Gluttonberg
34
34
  redirect_to( params[:return_url] || "/")
35
35
  return
36
36
  else
37
- cookies[:restrict_site_access] = ""
37
+ cookies[:restrict_site_access] = ""
38
+ end
39
+ respond_to do |format|
40
+ format.html{ render :layout => false }
38
41
  end
39
- render :layout => false
40
42
  end
41
-
43
+
42
44
  def sitemap
43
45
  begin
44
46
  SitemapGenerator::Interpreter.respond_to?(:run)
@@ -46,26 +48,26 @@ module Gluttonberg
46
48
  render :layout => "bare" , :template => 'gluttonberg/public/exceptions/not_found.html.haml' , :status => 404
47
49
  end
48
50
  end
49
-
51
+
50
52
  def stylesheets
51
53
  @stylesheet = Stylesheet.find(:first , :conditions => { :slug => params[:id] })
52
54
  unless params[:version].blank?
53
- @version = params[:version]
55
+ @version = params[:version]
54
56
  @stylesheet.revert_to(@version)
55
57
  end
56
58
  if @stylesheet.blank?
57
59
  render :text => ""
58
- else
60
+ else
59
61
  render :text => @stylesheet.value
60
- end
62
+ end
61
63
  end
62
-
64
+
63
65
  def error_404
64
66
  render :layout => "bare" , :template => 'gluttonberg/public/exceptions/not_found.html.haml' , :status => 404
65
67
  end
66
-
67
-
68
- private
68
+
69
+
70
+ private
69
71
  def retrieve_page
70
72
  @page = env['gluttonberg.page']
71
73
  unless( current_user &&( authorize! :manage, Gluttonberg::Page) )
@@ -73,7 +75,7 @@ module Gluttonberg
73
75
  end
74
76
  raise ActiveRecord::RecordNotFound if @page.blank?
75
77
  end
76
-
78
+
77
79
  end
78
80
  end
79
81
  end
@@ -1,18 +1,18 @@
1
1
  module Gluttonberg
2
- module Public
2
+ module Public
3
3
  class PublicAssetsController < ActionController::Base
4
- def show
5
- @asset = Asset.first( :conditions => "id=#{params[:id]} AND asset_hash like '#{params[:hash]}%' ")
6
- if @asset.blank?
4
+ def show
5
+ @asset = Asset.where("id = ? AND asset_hash like ? ", params[:id].to_i, params[:hash]+'%').first
6
+ if @asset.blank?
7
7
  render :layout => "bare" , :template => 'gluttonberg/admin/exceptions/not_found.html.haml' , :status => 404
8
- return
8
+ return
9
9
  end
10
10
  if params[:thumb_name].blank?
11
11
  redirect_to @asset.url
12
12
  else
13
13
  redirect_to @asset.url_for(params[:thumb_name].to_sym)
14
- end
15
- end
14
+ end
15
+ end
16
16
  end
17
- end
17
+ end
18
18
  end
@@ -106,7 +106,7 @@ module Gluttonberg
106
106
  page.current_localization = page.localizations.where("locale_id = ? AND previous_path LIKE ? ", locale.id, path).first
107
107
  end
108
108
  page
109
- else # default locale
109
+ elsif(!path.blank?) # default locale
110
110
  path = path[1]
111
111
  locale = Gluttonberg::Locale.first_default
112
112
  page = joins(:localizations).where("locale_id = ? AND gb_page_localizations.previous_path LIKE ? ", locale.id, path).first
@@ -36,10 +36,10 @@
36
36
  %td
37
37
 
38
38
  - if asset.category == 'audio'
39
- .sm2-inline-list
40
- .ui360
41
- %a{:href => "#{asset_url(asset)}", :target => "_blank" , :class => ""}
42
- = asset.name
39
+ /.sm2-inline-block
40
+ .ui360
41
+ %a{:href => "#{asset_url(asset)}", :target => "_blank" , :class => ""}
42
+ Play
43
43
  - elsif asset.category == 'image'
44
44
  %a{:href => admin_asset_url(asset), :class => "thumbnail"}
45
45
  %img{:src => asset.thumb_small_url }
@@ -2,6 +2,9 @@ class <%= plural_class_name %>Controller < Gluttonberg::Public::BaseController
2
2
 
3
3
  def index
4
4
  @<%= plural_name %> = <%= class_name %>.published<% if draggable? %>.order('position asc') <%end%>
5
+ respond_to do |format|
6
+ format.html
7
+ end
5
8
  end
6
9
 
7
10
  def show
@@ -13,6 +16,9 @@ class <%= plural_class_name %>Controller < Gluttonberg::Public::BaseController
13
16
  end
14
17
  end
15
18
  raise ActiveRecord::RecordNotFound.new if @<%= singular_name %>.blank?
19
+ respond_to do |format|
20
+ format.html
21
+ end
16
22
  end
17
23
 
18
24
  end
@@ -7,7 +7,7 @@ module Gluttonberg
7
7
 
8
8
  def call(env)
9
9
  path = env['PATH_INFO']
10
- unless path =~ /^#{Gluttonberg::Engine.config.admin_path}/ || path.start_with?("/stylesheets") || path.start_with?("/javascripts") || path.start_with?("/images") || path.start_with?("/gluttonberg") || path.start_with?("/assets") || path.start_with?("/user_asset")
10
+ unless path =~ /^#{Gluttonberg::Engine.config.admin_path}/ || path.start_with?("/stylesheets") || path.start_with?("/javascripts") || path.start_with?("/images") || path.start_with?("/gluttonberg") || path.start_with?("/assets") || path.start_with?("/user_asset")
11
11
  case Gluttonberg::Engine.config.identify_locale
12
12
  when :subdomain
13
13
  # return the sub-domain
@@ -26,11 +26,12 @@ module Gluttonberg
26
26
  if result
27
27
  env['PATH_INFO'].gsub!("/#{locale}", '')
28
28
  env['gluttonberg.locale'] = result
29
+ env['GLUTTONBERG.LOCALE_INFO'] = locale
29
30
  end
30
31
  when :domain
31
32
  env['SERVER_NAME']
32
33
  end
33
- end
34
+ end
34
35
  @app.call(env)
35
36
  end
36
37
  end # Locales
@@ -11,13 +11,13 @@ module Gluttonberg
11
11
  page = Gluttonberg::Page.find_by_path(path, env['gluttonberg.locale'] , env['HTTP_HOST'])
12
12
  unless page.blank?
13
13
  env['gluttonberg.page'] = page
14
- env['gluttonberg.path_info'] = path
14
+ env['GLUTTONBERG.PATH_INFO'] = path
15
15
  if page.redirect_required?
16
16
  return [301, {"Location" => page.redirect_url}, ["This resource has permanently moved to #{page.redirect_url}"]]
17
17
  elsif page.rewrite_required?
18
18
  env['PATH_INFO'] = page.generate_rewrite_path(path)
19
19
  else
20
- env['PATH_INFO'] = '/_public/page'
20
+ env['PATH_INFO'] = "/_public/page"
21
21
  end
22
22
  else
23
23
  page = Gluttonberg::Page.find_by_previous_path(path, env['gluttonberg.locale'] , env['HTTP_HOST'])
@@ -1,3 +1,3 @@
1
1
  module Gluttonberg
2
- VERSION = "2.5.9"
2
+ VERSION = "2.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gluttonberg-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.9
4
+ version: 2.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-03-27 00:00:00.000000000 Z
15
+ date: 2013-04-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: authlogic
@@ -384,6 +384,11 @@ files:
384
384
  - app/assets/javascripts/gb_jquery-tagarea.js
385
385
  - app/assets/javascripts/gb_login.js
386
386
  - app/assets/javascripts/gb_soundmanager2-jsmin.js
387
+ - app/assets/javascripts/gb_swf/soundmanager2.swf
388
+ - app/assets/javascripts/gb_swf/soundmanager2_debug.swf
389
+ - app/assets/javascripts/gb_swf/soundmanager2_flash9.swf
390
+ - app/assets/javascripts/gb_swf/soundmanager2_flash9_debug.swf
391
+ - app/assets/javascripts/gb_swf/soundmanager2_flash_xdomain.zip
387
392
  - app/assets/javascripts/gb_tags.js
388
393
  - app/assets/javascripts/jcrop/css/gb_Jcrop.gif
389
394
  - app/assets/javascripts/jcrop/css/gb_jquery-Jcrop.css