Skip to content

Commit

Permalink
Fix issue where paging/search threw an error for project specific blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
peakpg committed Jul 22, 2014
1 parent faeeeab commit 7ca0b45
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
browsercms (4.0.0.beta)
browsercms (4.0.0.beta.1)
actionpack-page_caching (~> 1.0)
ancestry (~> 2.0.0)
bootstrap-sass
Expand Down
10 changes: 5 additions & 5 deletions app/helpers/cms/application_helper.rb
Expand Up @@ -173,11 +173,11 @@ def render_pagination(collection, content_type, options={})
else
render :partial => "pagination", :locals => {
:collection => collection,
:first_page_path => url_for({:page => 1}.merge(options)),
:previous_page_path => url_for({:page => collection.previous_page ? collection.previous_page : 1}.merge(options)),
:current_page_path => url_for(options),
:next_page_path => url_for({:page => collection.next_page ? collection.next_page : collection.current_page}.merge(options)),
:last_page_path => url_for({:page => collection.total_pages}.merge(options))
:first_page_path => engine(content_type).url_for({:page => 1}.merge(options)),
:previous_page_path => engine(content_type).url_for({:page => collection.previous_page ? collection.previous_page : 1}.merge(options)),
:current_page_path => engine(content_type).url_for(options),
:next_page_path => engine(content_type).url_for({:page => collection.next_page ? collection.next_page : collection.current_page}.merge(options)),
:last_page_path => engine(content_type).url_for({:page => collection.total_pages}.merge(options))
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/cms/application/_pagination.html.erb
Expand Up @@ -10,7 +10,7 @@
<%= link_to "<< &nbsp;".html_safe, first_page_path, :id => "first_page_link" %>
<%= link_to "< &nbsp;".html_safe, previous_page_path, :id => "previous_page_link" %>
<% url = URI.parse(current_page_path) %>
<%= form_tag url_for({}), :method => :get, :class => "current_page", style: 'display:inline' do %>
<%= form_tag engine(content_type).url_for({}), :method => :get, :class => "current_page", style: 'display:inline' do %>
<% url.query.to_s.split('&').each do |p|
; k, v = p.split('=') %>
<%= hidden_field_tag(k, CGI::unescape(v.to_s), :id => "pagination_hidden_#{k}") unless k == "page" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/cms/content_block/index.html.erb
Expand Up @@ -2,7 +2,7 @@
<div class="padded row-fluid clearfix">
<h1 class="span3">Assets</h1>

<%= form_for @search_filter, url: url_for({}), html: {class: 'form-search'}, method: :get do |f| %>
<%= form_for @search_filter, url: engine(content_type).url_for({}), html: {class: 'form-search'}, method: :get do |f| %>
<%= f.text_field :term, class: "span6 search-query right", placeholder: "Search #{content_type.display_name_plural}" %>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/cms/version.rb
Expand Up @@ -2,7 +2,7 @@
# Allows the precise version of BrowserCMS to be determined programatically.
#
module Cms
VERSION = "4.0.0.beta"
VERSION = "4.0.0.beta.1"

# Return the current version of the CMS.
def self.version
Expand Down

0 comments on commit 7ca0b45

Please sign in to comment.