Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 5 commits
  • 21 files changed
  • 0 commit comments
  • 2 contributors
View
2 app/assets/javascripts/gb_360player.js
@@ -1023,7 +1023,7 @@ function ThreeSixtyPlayer() {
for (i=0,j=oItems.length; i<j; i++) {
oLinks.push(oItems[i].getElementsByTagName('a')[0]);
// remove "fake" play button (unsupported case)
- oItems[i].style.backgroundImage = 'none';
+ //oItems[i].style.backgroundImage = 'none';
}
// grab all links, look for .mp3
View
6 app/assets/javascripts/gb_application.js
@@ -889,11 +889,9 @@ Array.prototype.remove= function(){
function setUpAudio(){
soundManager.setup({
useFlashBlock: true, // optional - if used, required flashblock.css
- url: '/swf/', // required: path to directory containing SM2 SWF files
- debugMode: false
+ url: '/assets/gb_swf/', // required: path to directory containing SM2 SWF files
+ debugMode: true
});
- // basicMP3Player = new BasicMP3Player();
- // console.log(basicMP3Player)
}
function setUp360(){
View
5,818 app/assets/javascripts/gb_soundmanager2-jsmin.js
5,715 additions, 103 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN app/assets/javascripts/gb_swf/soundmanager2.swf
Binary file not shown.
View
BIN app/assets/javascripts/gb_swf/soundmanager2_debug.swf
Binary file not shown.
View
BIN app/assets/javascripts/gb_swf/soundmanager2_flash9.swf
Binary file not shown.
View
BIN app/assets/javascripts/gb_swf/soundmanager2_flash9_debug.swf
Binary file not shown.
View
BIN app/assets/javascripts/gb_swf/soundmanager2_flash_xdomain.zip
Binary file not shown.
View
2 app/assets/stylesheets/gb_360player.css
@@ -62,7 +62,7 @@
.ui360 a:hover,
.ui360 a:focus {
- background:#eee;
+ /*background-color:#eee;*/
border-radius:3px;
outline:none;
}
View
37 app/controllers/gluttonberg/public/articles_controller.rb
@@ -1,31 +1,31 @@
module Gluttonberg
module Public
class ArticlesController < Gluttonberg::Public::BaseController
-
+
def index
@blog = Gluttonberg::Blog.published.first(:conditions => {:slug => params[:blog_id]}, :include => [:articles])
raise ActiveRecord::RecordNotFound.new if @blog.blank?
@articles = @blog.articles.published
-
+
respond_to do |format|
format.html
format.rss { render :layout => false }
end
end
-
+
def show
-
+
@blog = Gluttonberg::Blog.published.first(:conditions => {:slug => params[:blog_id]})
-
+
if @blog.blank?
@blog = Gluttonberg::Blog.published.first(:conditions => {:previous_slug => params[:blog_id]})
-
+
unless @blog.blank?
redirect_to blog_article_path(:blog_id => @blog.slug , :id => params[:id]) , :status => 301
return
end
end
-
+
raise ActiveRecord::RecordNotFound.new if @blog.blank?
@article = Gluttonberg::Article.published.first(:conditions => {:slug => params[:id], :blog_id => @blog.id})
if @article.blank?
@@ -35,18 +35,24 @@ def show
return
end
end
-
+
raise ActiveRecord::RecordNotFound.new if @article.blank?
@article.load_localization(env['gluttonberg.locale'])
@comments = @article.comments.where(:approved => true)
@comment = Comment.new(:subscribe_to_comments => true)
+ respond_to do |format|
+ format.html
+ end
end
-
+
def tag
- @articles = Article.tagged_with(params[:tag]).includes(:blog).published
- @tags = Gluttonberg::Article.published.tag_counts_on(:tag)
+ @articles = Article.tagged_with(params[:tag]).includes(:blog).published
+ @tags = Gluttonberg::Article.published.tag_counts_on(:tag)
+ respond_to do |format|
+ format.html
+ end
end
-
+
def unsubscribe
@subscription = CommentSubscription.find(:first , :conditions => {:reference_hash => params[:reference] })
unless @subscription.blank?
@@ -54,8 +60,11 @@ def unsubscribe
flash[:notice] = "You are successfully unsubscribe from comments of \"#{@subscription.article.title}\""
redirect_to blog_article_url(@subscription.article.blog.slug, @subscription.article.slug)
end
+ respond_to do |format|
+ format.html
+ end
end
-
+
def preview
@blog = Gluttonberg::Blog.first(:conditions => {:slug => params[:blog_id]})
raise ActiveRecord::RecordNotFound.new if @blog.blank?
@@ -64,7 +73,7 @@ def preview
raise ActiveRecord::RecordNotFound.new if @article.blank?
render :show
end
-
+
end
end
end
View
19 app/controllers/gluttonberg/public/flag_controller.rb
@@ -1,18 +1,20 @@
module Gluttonberg
module Public
class FlagController < Gluttonberg::Public::BaseController
-
+
def new
model = nil
if params[:flaggable_type].include?("Gluttonberg::")
model = Gluttonberg.const_get(params[:flaggable_type][13..-1])
- else
+ else
model = Kernel.const_get(params[:flaggable_type])
- end
+ end
@flaggable = model.find(params[:flaggable_id])
-
+ respond_to do |format|
+ format.html
+ end
end
-
+
def create
flag = current_user.flags.create params[:flag]
flash[:notice] = if flag.new_record?
@@ -24,22 +26,21 @@ def create
respond_to do |format|# note: you'll need to ensure that this route exists
format.html {
- url = ""
+ url = ""
begin
if flag.flaggable.respond_to?(:commentable)
url = polymorphic_path(flag.flaggable.commentable)
else
url = polymorphic_path(flag.flaggable)
- end
+ end
flag.update_attributes(:url => url)
redirect_to url
rescue => e
end
}
- # format.js # render some js trickery
end
end
-
+
end
end
end
View
25 app/controllers/gluttonberg/public/member_password_resets_controller.rb
@@ -1,14 +1,17 @@
module Gluttonberg
module Public
- class MemberPasswordResetsController < Gluttonberg::Public::BaseController
+ class MemberPasswordResetsController < Gluttonberg::Public::BaseController
skip_before_filter :require_member
before_filter :load_member_using_perishable_token, :only => [:edit, :update]
-
+
layout 'public'
-
+
def new
+ respond_to do |format|
+ format.html
+ end
end
-
+
def create
@member = Member.find_by_email(params[:gluttonberg_member][:email])
if @member
@@ -21,11 +24,13 @@ def create
redirect_to root_path
end
end
-
+
def edit
-
+ respond_to do |format|
+ format.html
+ end
end
-
+
def update
@member.password = params[:gluttonberg_member][:password]
@member.password_confirmation = params[:gluttonberg_member][:password_confirmation]
@@ -36,9 +41,9 @@ def update
render :edit
end
end
-
+
private
-
+
def load_member_using_perishable_token
@member = Member.find_using_perishable_token(params[:id])
unless @member
@@ -49,7 +54,7 @@ def load_member_using_perishable_token
redirect_to root_path
end
end
-
+
end
end
end
View
11 app/controllers/gluttonberg/public/member_sessions_controller.rb
@@ -1,15 +1,18 @@
module Gluttonberg
module Public
class MemberSessionsController < Gluttonberg::Public::BaseController
-
+
layout 'public'
before_filter :is_members_enabled
skip_before_filter :require_member, :only => [:new, :create]
-
+
def new
@member_session = MemberSession.new
+ respond_to do |format|
+ format.html
+ end
end
-
+
def create
@member_session = MemberSession.new(params[:member_session])
if @member_session.save
@@ -19,7 +22,7 @@ def create
render :action => :new
end
end
-
+
def destroy
current_member_session.destroy
flash[:notice] = "Logout successful!"
View
37 app/controllers/gluttonberg/public/members_controller.rb
@@ -2,20 +2,23 @@ module Gluttonberg
module Public
class MembersController < Gluttonberg::Public::BaseController
before_filter :is_members_enabled
-
+
before_filter :require_member , :only => [ :edit, :update, :show ]
layout 'public'
-
+
def new
@page_title = "Register"
@member = Member.new
+ respond_to do |format|
+ format.html
+ end
end
-
+
def create
@member = Member.new(params[:gluttonberg_member])
if Member.does_email_verification_required
@member.confirmation_key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..24]
- else
+ else
@member.profile_confirmed = true
end
if @member && @member.save
@@ -31,8 +34,8 @@ def create
render :new
end
end
-
-
+
+
def confirm
@member = Member.where(:confirmation_key => params[:key]).first
if @member
@@ -47,7 +50,7 @@ def confirm
redirect_to root_url
end
end
-
+
def resend_confirmation
if current_member.confirmation_key.blank?
confirmation_key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..24]
@@ -58,7 +61,7 @@ def resend_confirmation
flash[:notice] = "Please check your email for a confirmation."
redirect_to member_profile_url
end
-
+
def update
@member = current_member
if @member.update_attributes(params[:gluttonberg_member])
@@ -70,19 +73,25 @@ def update
end
end
end
-
+
def show
@member = current_member
+ respond_to do |format|
+ format.html
+ end
end
-
+
def edit
@member = current_member
+ respond_to do |format|
+ format.html
+ end
end
-
-
-
+
+
+
protected
-
+
end
end
end
View
40 app/controllers/gluttonberg/public/pages_controller.rb
@@ -2,23 +2,23 @@ module Gluttonberg
module Public
class PagesController < Gluttonberg::Public::BaseController
before_filter :retrieve_page , :only => [ :show ]
-
+
# If localized template file exist then render that file otherwise render non-localized template
def show
if Gluttonberg::Member.enable_members == true && !@page.is_public?
return unless require_member
unless current_member.does_member_have_access_to_the_page?(page)
raise CanCan::AccessDenied
- end
+ end
end
-
+
template = page.view
template_path = "pages/#{template}"
-
+
if locale && File.exists?(File.join(Rails.root, "app/views/pages/#{template}.#{locale.slug}.html.haml" ) )
template_path = "pages/#{template}.#{locale.slug}"
- end
-
+ end
+
# do not render layout for ajax requests
if request.xhr?
render :template => template_path, :layout => false
@@ -26,7 +26,7 @@ def show
render :template => template_path, :layout => page.layout
end
end
-
+
def restrict_site_access
setting = Gluttonberg::Setting.get_setting("restrict_site_access")
if setting == params[:password]
@@ -34,11 +34,13 @@ def restrict_site_access
redirect_to( params[:return_url] || "/")
return
else
- cookies[:restrict_site_access] = ""
+ cookies[:restrict_site_access] = ""
+ end
+ respond_to do |format|
+ format.html{ render :layout => false }
end
- render :layout => false
end
-
+
def sitemap
begin
SitemapGenerator::Interpreter.respond_to?(:run)
@@ -46,26 +48,26 @@ def sitemap
render :layout => "bare" , :template => 'gluttonberg/public/exceptions/not_found.html.haml' , :status => 404
end
end
-
+
def stylesheets
@stylesheet = Stylesheet.find(:first , :conditions => { :slug => params[:id] })
unless params[:version].blank?
- @version = params[:version]
+ @version = params[:version]
@stylesheet.revert_to(@version)
end
if @stylesheet.blank?
render :text => ""
- else
+ else
render :text => @stylesheet.value
- end
+ end
end
-
+
def error_404
render :layout => "bare" , :template => 'gluttonberg/public/exceptions/not_found.html.haml' , :status => 404
end
-
-
- private
+
+
+ private
def retrieve_page
@page = env['gluttonberg.page']
unless( current_user &&( authorize! :manage, Gluttonberg::Page) )
@@ -73,7 +75,7 @@ def retrieve_page
end
raise ActiveRecord::RecordNotFound if @page.blank?
end
-
+
end
end
end
View
16 app/controllers/gluttonberg/public/public_assets_controller.rb
@@ -1,18 +1,18 @@
module Gluttonberg
- module Public
+ module Public
class PublicAssetsController < ActionController::Base
- def show
- @asset = Asset.first( :conditions => "id=#{params[:id]} AND asset_hash like '#{params[:hash]}%' ")
- if @asset.blank?
+ def show
+ @asset = Asset.where("id = ? AND asset_hash like ? ", params[:id].to_i, params[:hash]+'%').first
+ if @asset.blank?
render :layout => "bare" , :template => 'gluttonberg/admin/exceptions/not_found.html.haml' , :status => 404
- return
+ return
end
if params[:thumb_name].blank?
redirect_to @asset.url
else
redirect_to @asset.url_for(params[:thumb_name].to_sym)
- end
- end
+ end
+ end
end
- end
+ end
end
View
2 app/models/gluttonberg/page.rb
@@ -106,7 +106,7 @@ def self.find_by_previous_path(path, locale = nil , domain_name=nil)
page.current_localization = page.localizations.where("locale_id = ? AND previous_path LIKE ? ", locale.id, path).first
end
page
- else # default locale
+ elsif(!path.blank?) # default locale
path = path[1]
locale = Gluttonberg::Locale.first_default
page = joins(:localizations).where("locale_id = ? AND gb_page_localizations.previous_path LIKE ? ", locale.id, path).first
View
8 app/views/gluttonberg/admin/asset_library/shared/_asset_panels.html.haml
@@ -36,10 +36,10 @@
%td
- if asset.category == 'audio'
- .sm2-inline-list
- .ui360
- %a{:href => "#{asset_url(asset)}", :target => "_blank" , :class => ""}
- = asset.name
+ /.sm2-inline-block
+ .ui360
+ %a{:href => "#{asset_url(asset)}", :target => "_blank" , :class => ""}
+ Play
- elsif asset.category == 'image'
%a{:href => admin_asset_url(asset), :class => "thumbnail"}
%img{:src => asset.thumb_small_url }
View
6 lib/generators/gluttonberg/resource/templates/public_controller.rb
@@ -2,6 +2,9 @@ class <%= plural_class_name %>Controller < Gluttonberg::Public::BaseController
def index
@<%= plural_name %> = <%= class_name %>.published<% if draggable? %>.order('position asc') <%end%>
+ respond_to do |format|
+ format.html
+ end
end
def show
@@ -13,6 +16,9 @@ def show
end
end
raise ActiveRecord::RecordNotFound.new if @<%= singular_name %>.blank?
+ respond_to do |format|
+ format.html
+ end
end
end
View
5 lib/gluttonberg/middleware/locales.rb
@@ -7,7 +7,7 @@ def initialize(app)
def call(env)
path = env['PATH_INFO']
- 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")
+ 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")
case Gluttonberg::Engine.config.identify_locale
when :subdomain
# return the sub-domain
@@ -26,11 +26,12 @@ def call(env)
if result
env['PATH_INFO'].gsub!("/#{locale}", '')
env['gluttonberg.locale'] = result
+ env['GLUTTONBERG.LOCALE_INFO'] = locale
end
when :domain
env['SERVER_NAME']
end
- end
+ end
@app.call(env)
end
end # Locales
View
4 lib/gluttonberg/middleware/rewriter.rb
@@ -11,13 +11,13 @@ def call(env)
page = Gluttonberg::Page.find_by_path(path, env['gluttonberg.locale'] , env['HTTP_HOST'])
unless page.blank?
env['gluttonberg.page'] = page
- env['gluttonberg.path_info'] = path
+ env['GLUTTONBERG.PATH_INFO'] = path
if page.redirect_required?
return [301, {"Location" => page.redirect_url}, ["This resource has permanently moved to #{page.redirect_url}"]]
elsif page.rewrite_required?
env['PATH_INFO'] = page.generate_rewrite_path(path)
else
- env['PATH_INFO'] = '/_public/page'
+ env['PATH_INFO'] = "/_public/page"
end
else
page = Gluttonberg::Page.find_by_previous_path(path, env['gluttonberg.locale'] , env['HTTP_HOST'])

No commit comments for this range

Something went wrong with that request. Please try again.