Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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.
base fork: resolve/refinerycms
...
head fork: resolve/refinerycms
Checking mergeability… Don't worry, you can still create the pull request.
  • 6 commits
  • 12 files changed
  • 0 commit comments
  • 4 contributors
Commits on Dec 07, 2010
@parndt parndt Make update task delete a particular migration that causes issue. Clo…
…ses GH-314
07db817
Commits on Dec 11, 2010
@wjbuys wjbuys Fixed problems with db:migrate for a new app on Postgres by moving Ro…
…lesUsers migration before Roles migration.

It looks like the ActiveRecord postgres adapter automagically sets up relations between your tables. However, it looks like the "many" side of the association (the table with the foreign key) has to be created first, or postgres gives an error like this in the log:

PGError: ERROR:  relation "roles_users" does not exist
LINE 14: AND dep.refobjid      = '"roles_users"'::regclas...
cfece66
Commits on Dec 12, 2010
@parndt parndt Use the newer, faster image dialogue introduced in master branch. 8af2e5f
Phil Spitler Sort file names so attribute types don't get changed before _form gen…
…eration.
1808e55
Commits on Dec 15, 2010
@ugisozols ugisozols Add :approximate_ascii RefinerySetting and add that setting in page m…
…odel for has_friendly_id.
1c995ac
@parndt parndt Document new version 0.9.8.7 - Closes GH-320 ade7bec
View
8 changelog.md
@@ -1,3 +1,11 @@
+## 0.9.8.7 [15 December 2010]
+* Fixed a problem with migration number clashes. [Philip Arndt](https://github.com/parndt)
+* Fixed problems with ``db:migrate`` for a new app on Postgres. [Jacob Buys](https://github.com/wjbuys)
+* Back-ported the changes made to the images dialogue which speed it up significantly. [Philip Arndt](https://github.com/parndt)
+* Sort file names in the ``refinery_engine`` generator so attribute types don't get changed before ``_form.html.erb`` generation. [Phil Spitler](https://github.com/philspitler)
+* Added ``approximate_ascii`` setting, defaulted to true, for pages so that characters won't appear strangely in the address bar of some web browsers. [Uģis Ozols](https://github.com/ugisozols)
+* [See full list](https://github.com/resolve/refinerycms/compare/0.9.8.6...0.9.8.7)
+
## 0.9.8.6 [3 December 2010]
* Backported lots of functionality from 0.9.9 and later like:
* Fixed reordering for trees and non-trees [Philip Arndt](https://github.com/parndt)
View
9 db/migrate/20100913234704_create_refinery_schema.rb
@@ -97,15 +97,16 @@ def self.up
t.string "file_ext"
end
- create_table ::Role.table_name, :force => true do |t|
- t.string "title"
- end
-
+ # Postgres apparently requires the roles_users table to exist before creating the roles table.
create_table ::RolesUsers.table_name, :id => false, :force => true do |t|
t.integer "user_id"
t.integer "role_id"
end
+ create_table ::Role.table_name, :force => true do |t|
+ t.string "title"
+ end
+
create_table ::Slug.table_name, :force => true do |t|
t.string "name"
t.integer "sluggable_id"
View
4 refinerycms.gemspec
@@ -2,9 +2,9 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms}
- s.version = %q{0.9.8.6}
+ s.version = %q{0.9.8.7}
s.description = %q{A Ruby on Rails CMS that supports Rails 3. It's easy to extend and sticks to 'the Rails way' where possible.}
- s.date = %q{2010-12-03}
+ s.date = %q{2010-12-15}
s.summary = %q{A Ruby on Rails CMS that supports Rails 3}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
View
2  vendor/refinerycms/core/lib/generators/refinery_engine/refinery_engine_generator.rb
@@ -9,7 +9,7 @@ class RefineryEngineGenerator < Rails::Generators::NamedBase
def generate
unless attributes.empty?
- Dir.glob(File.expand_path('../templates/**/**', __FILE__), File::FNM_DOTMATCH).each do |path|
+ Dir.glob(File.expand_path('../templates/**/**', __FILE__), File::FNM_DOTMATCH).sort.each do |path|
# ignore directories which are created automatically by template()
unless File.directory?(path)
template path, plugin_path_for(path)
View
5 vendor/refinerycms/core/lib/tasks/refinery.rake
@@ -87,6 +87,11 @@ namespace :refinery do
verbose = ENV["verbose"] || false
require 'fileutils'
+ # Clean up mistakes
+ if (bad_migration = Rails.root.join('db', 'migrate', '20100913234704_add_cached_slug_to_pages.rb')).file?
+ FileUtils::rm bad_migration
+ end
+
# copy in any new migrations.
FileUtils::cp Dir[Refinery.root.join("db", "migrate", "*.rb").cleanpath.to_s],
Rails.root.join("db", "migrate").cleanpath.to_s,
View
47 vendor/refinerycms/core/public/javascripts/refinery/admin.js
@@ -620,13 +620,15 @@ var page_options = {
}
var image_dialog = {
- callback: null
+ initialised: false
+ , callback: null
, init: function(callback){
this.callback = callback;
this.init_tabs();
this.init_select();
this.init_actions();
+ this.initialised = true;
return this;
}
@@ -665,41 +667,15 @@ var image_dialog = {
$(img).parent().addClass('selected');
var imageId = $(img).attr('data-id');
- var imageThumbnailSize = $('#existing_image_size_area li.selected a').attr('data-size');
+ var geometry = $('#existing_image_size_area li.selected a').attr('data-geometry');
+ var size = $('#existing_image_size_area li.selected a').attr('data-size');
var resize = $("#wants_to_resize_image").is(':checked');
- var url = '/refinery/images/'+imageId+'/url';
- if (resize) {
- url += '?size='+imageThumbnailSize;
- }
-
- var data;
- $.ajax({
- async: false,
- url: url,
- success: function (result, status, xhr) {
- if (result.error) {
- if (console && console.log) {
- console.log("Something went wrong with the image insertion!");
- console.log(result);
- }
- } else {
- data = result;
- }
- },
- error: function(xhr, txt, status) {
- if (console && console.log) {
- console.log("Something went wrong with the image insertion!");
- console.log(xhr);
- console.log(txt);
- console.log(status);
- }
- }
- });
+ image_url = resize ? $(img).attr('data-' + size) : $(img).attr('data-original');
if (parent) {
if ((wym_src = parent.document.getElementById('wym_src')) != null) {
- wym_src.value = data.url
+ wym_src.value = image_url;
}
if ((wym_title = parent.document.getElementById('wym_title')) != null) {
wym_title.value = $(img).attr('title');
@@ -707,8 +683,9 @@ var image_dialog = {
if ((wym_alt = parent.document.getElementById('wym_alt')) != null) {
wym_alt.value = $(img).attr('alt');
}
- if ((wym_size = parent.document.getElementById('wym_size')) != null) {
- wym_size.value = imageThumbnailSize.replace(/[<>=]/g, '');
+ if ((wym_size = parent.document.getElementById('wym_size')) != null
+ && typeof(geometry) != 'undefined') {
+ wym_size.value = geometry.replace(/[<>=]/g, '');
}
}
}
@@ -727,7 +704,7 @@ var image_dialog = {
, init_actions: function(){
var _this = this;
$('#existing_image_area .form-actions-dialog #submit_button').click($.proxy(_this.submit_image_choice, _this));
- $('.form-actions-dialog #cancel_button').click($.proxy(close_dialog, _this));
+ $('.form-actions-dialog #cancel_button').not('body.wym_iframe_body .form-actions-dialog #cancel_button').click($.proxy(close_dialog, _this));
$('#existing_image_size_area ul li a').click(function(e) {
$('#existing_image_size_area ul li').removeClass('selected');
$(this).parent().addClass('selected');
@@ -753,7 +730,7 @@ var image_dialog = {
$('#existing_image_area .form-actions a.close_dialog').click(close_dialog);
}
}
-}
+};
var list_reorder = {
initialised: false
View
18 vendor/refinerycms/images/app/models/image.rb
@@ -1,7 +1,7 @@
class Image < ActiveRecord::Base
# What is the max image size a user can upload
- MAX_SIZE_IN_MB = 20
+ MAX_SIZE_IN_MB = 5
image_accessor :image
@@ -40,14 +40,20 @@ def per_page(dialog = false, has_size_options = false)
PAGES_PER_ADMIN_INDEX
end
end
+
+ def user_image_sizes
+ RefinerySetting.find_or_set(:user_image_sizes, {
+ :small => '110x110>',
+ :medium => '225x255>',
+ :large => '450x450>'
+ })
+ end
end
# Get a thumbnail job object given a geometry.
def thumbnail(geometry = nil)
- if geometry.is_a?(Symbol)
- if (sizes = RefinerySetting.find_or_set(:image_thumbnails, {})) and sizes.keys.include?(geometry)
- geometry = sizes[geometry].presence
- end
+ if geometry.is_a?(Symbol) and self.class.user_image_sizes.keys.include?(geometry)
+ geometry = self.class.user_image_sizes[geometry].presence
end
if geometry.present? && !geometry.is_a?(Symbol)
@@ -60,7 +66,7 @@ def thumbnail(geometry = nil)
# Returns a titleized version of the filename
# my_file.jpg returns My File
def title
- CGI::unescape(self.image_name).gsub(/\.\w+$/, '').titleize
+ CGI::unescape(self.image_name.to_s).gsub(/\.\w+$/, '').titleize
end
end
View
45 vendor/refinerycms/images/app/views/admin/images/_existing_image.html.erb
@@ -1,40 +1,57 @@
<div id='existing_image_area' class='dialog_area' <%= "style='display:none;'" if @image.errors.any? %>>
+ <%= render :partial => '/shared/admin/search',
+ :locals => {:url => insert_admin_images_url(params.dup.delete(:image))} %>
<input type='hidden' name='selected_image' id='selected_image' />
<div id='existing_image_area_content' class='clearfix'>
+<% if @images.any? %>
<ul>
- <% @images.each do |image| %>
+<%
+ @images.each do |image|
+ thumbnail_urls = {
+ :"data-original" => image.url,
+ :"data-grid" => image.thumbnail('135x135#c').url
+ }
+ ::Image.user_image_sizes.sort_by{|key,geometry| geometry}.each do |size, pixels|
+ thumbnail_urls[:"data-#{size.to_s.parameterize}"] = image.thumbnail(pixels).url
+ end
+-%>
<li<%= " class='selected'" if @image_id == image.id %>>
<%= image_fu(image, '106x106#c', {
:alt => image.title,
:title => image.title,
:id => "image_#{image.id}",
:'data-id' => image.id
- }) -%>
+ }.merge(thumbnail_urls)) -%>
</li>
<% end -%>
</ul>
+<% elsif searching? %>
+ <%= t('shared.admin.search.no_results') %>
+<% end %>
</div>
+
<%= images_paginator @images, from_dialog? %>
- <% unless @app_dialog %>
+
+ <% unless @app_dialog or @images.empty? %>
<div id='existing_image_size_area' class='clearfix'>
<input type='hidden' name='selected_image_size' id='selected_image_size' />
<p>
<input type="checkbox" id="wants_to_resize_image" name="wants_to_resize_image" value="1" checked="checked" />
- <label for='wants_to_resize_image' class='stripped'><strong><%= t('.resize_image').html_safe %></strong></label>
+ <label for='wants_to_resize_image' class='stripped' style='font-weight: bold;'>
+ <%= t('.resize_image') %>
+ </label>
</p>
<ul>
<%
- (sizes = RefinerySetting.find_or_set(:user_image_sizes, {
- :small => '110x110>',
- :medium => '225x255>',
- :large => '450x450>'
- })
- ).sort_by{|k,v| v}.each_with_index do |(size, pixels), index|
+ ::Image.user_image_sizes.sort_by { |key, geometry| geometry }.each_with_index do |(size, pixels), index|
safe_pixels = pixels.to_s.gsub(/[<>=]/, '')
+ # (parndt): ' selected' if size.to_s == 'medium' is not very generic, but I
+ # can't think of a decent way of making it so for even sets (e.g. 2,4,6,8,etc image sizes).
-%>
- <li id="image_dialog_size_<%= index %>" class="image_dialog_size <%= 'selected' if size.to_s == 'medium' %>">
+ <li id="image_dialog_size_<%= index %>" class="image_dialog_size<%= ' selected' if size.to_s == 'medium' %>">
<%= link_to size.to_s, "##{size}",
- :'data-size' => pixels,
+ :'data-geometry' => pixels,
+ :'data-size' => size.to_s.parameterize,
:title => "#{size} image (#{safe_pixels})",
:tooltip => "#{size} image (#{safe_pixels})" %>
</li>
@@ -42,13 +59,15 @@
</ul>
</div>
<% end %>
+
<%= render :partial => "/shared/admin/form_actions",
:locals => {
:f => nil,
:cancel_url => '',
:submit_button_text => t('.button_text'),
+ :hide_submit => @images.empty?,
:hide_cancel => false,
:hide_delete => true,
:cancel_title => nil
- } if @app_dialog or @images.any? %>
+ } if @app_dialog or @images.any? or searching? %>
</div>
View
3  vendor/refinerycms/pages/app/models/page.rb
@@ -5,7 +5,8 @@ class Page < ActiveRecord::Base
# Docs for friendly_id http://github.com/norman/friendly_id
has_friendly_id :title, :use_slug => true,
- :reserved_words => %w(index new session login logout users refinery admin images wymiframe)
+ :reserved_words => %w(index new session login logout users refinery admin images wymiframe),
+ :approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => "pages")
has_many :parts,
:class_name => "PagePart",
View
2  vendor/refinerycms/refinery.rb
@@ -28,7 +28,7 @@ class Version
@major = 0
@minor = 9
@tiny = 8
- @build = 6
+ @build = 7
class << self
attr_reader :major, :minor, :tiny, :build
View
1  vendor/refinerycms/settings/config/locales/en.yml
@@ -33,6 +33,7 @@ en:
use_google_ajax_libraries: If you want to use Google's AJAX CDN then set this to true.
use_marketable_urls: Changes urls from /pages/about to /about and automatically manages conflicts with other plugins.
use_resource_caching: Recommended to enable this in production mode as it bundles javascript assets and stylesheet assets into single file packages to reduce the number of web requests on your site and speed it up.
+ approximate_ascii: Set this to true if you use Latin characters with accents and other diacritics in page titles. It'll convert characters like ā, č, ž into a, c, z and this way those characters won't appear strangely in the address bar of some web browsers.
activerecord:
models:
refinery_setting: setting
View
3  vendor/refinerycms/settings/config/locales/lv.yml
@@ -31,7 +31,8 @@ lv:
theme: Ievadiet tēmas nosaukumu, kuru vēlaties izmantot. Lai šis uzstādījums nekavējoties sāktu darboties, pārliecinieties, vai tēma eksistē un tās nosaukums ir norādīts pareizi.
use_google_ajax_libraries: Ja vēlaties izmantot Googles AJAX CDN, tad šim parametram nomainiet vērtību uz true.
use_marketable_urls: Šī opcija maina saites no /pages/about uz /about un automātiski novērš konfliktus ar citiem spraudņiem.
- use_resource_caching: Šo opciju ieteicams iespējot produkcijas režīmā, jo tā nodrošina javascript un stylesheet failu apkopošanu vienā failu paketē, tādā veidā samazinot pieprasījumu skaitu uz Jūsu lapu un paātrinot tās darbību.
+ use_resource_caching: Šo opciju ieteicams iespējot produkcijas režīmā, jo tā nodrošina javascript un stylesheet failu apkopošanu vienā failu paketē, tādā veidā samazinot pieprasījumu skaitu uz jūsu lapu un paātrinot tās darbību.
+ approximate_ascii: "Ja izmantojat Latīņu burtus ar mīkstinājuma zīmēm, akcentiem utml., tad iespējojot šo uzstādījumu (vērtība: true) burti ā, č, ž u.c. tiks pārkonvertēti attiecīgi uz a, c un z, tāda veidā šie burti neizskatīsies savādi dažu parlūku adreses laukā."
activerecord:
models:
refinery_setting: uzstādījums

No commit comments for this range

Something went wrong with that request. Please try again.