Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/resolve/refinerycms
Browse files Browse the repository at this point in the history
  • Loading branch information
hms committed Jun 10, 2010
2 parents b66bc2d + cd53c64 commit 74d8a6e
Show file tree
Hide file tree
Showing 18 changed files with 174 additions and 112 deletions.
5 changes: 5 additions & 0 deletions config/application.rb
Expand Up @@ -23,3 +23,8 @@
# You can set things in the following file and we'll try hard not to destroy them in updates, promise.
# Note: These are settings that aren't dependent on environment type. For those, use the files in config/environments/
require Rails.root.join('config', 'settings.rb').to_s

# Bundler has shown a weakness using Rails < 3 so we are going to
# require these dependencies here until we can find another solution or until we move to
# Rails 3.0 which should fix the issue (or until Bundler fixes the issue).
require_dependency 'will_paginate'
3 changes: 0 additions & 3 deletions config/environments/development.rb
@@ -1,5 +1,4 @@
# Settings specified here will take precedence over those in config/environment.rb

config.reload_plugins = true

# In the development environment your application's code is reloaded on
Expand Down Expand Up @@ -30,5 +29,3 @@
end
end
=end

require_dependency 'will_paginate'
5 changes: 0 additions & 5 deletions config/environments/production.rb
Expand Up @@ -25,8 +25,3 @@
# instead of the default file system for resources and images
# Make sure to your bucket info is correct in amazon_s3.yml
Refinery.s3_backend = false

# Bundler has shown a weakness in production mode using Rails 2.3.5 so we are going to
# require these dependencies here until we can find another solution or until we move to
# Rails 3.0 which should fix the issue (or until Bundler fixes the issue).
require_dependency 'will_paginate'
5 changes: 0 additions & 5 deletions config/environments/test.rb
Expand Up @@ -20,8 +20,3 @@
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

# Bundler has shown a weakness in test mode using Rails 2.3.5 so we are going to
# require these dependencies here until we can find another solution or until we move to
# Rails 3.0 which should fix the issue (or until Bundler fixes the issue).
require_dependency 'will_paginate'
2 changes: 1 addition & 1 deletion config/preinitializer.rb
Expand Up @@ -21,5 +21,5 @@
end

rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems. Did you run `bundle install`?"
raise RuntimeError, "Bundler couldn't find some gems. Did you run `bundle install`?\nMessage was: #{$!.message}"
end
Binary file modified doc/included-jquery-ui-packages.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 68 additions & 19 deletions public/javascripts/jquery-ui-custom-min.js 100644 → 100755

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions public/javascripts/refinery/admin.js
Expand Up @@ -210,7 +210,7 @@ init_tooltips = function(args){
tooltip.css('maxWidth', '300px');
tooltip.css('left', ((left = $(this).offset().left - (tooltip.outerWidth() / 2) + ($(this).outerWidth() / 2)) >= 0 ? left : 0));

if ((tooltip.offset().left + tooltip.outerWidth) > (window_width = $(window).width())) {
if ((offset = tooltip.offset() != null) && (offset.left + tooltip.outerWidth) > (window_width = $(window).width())) {
tooltip.css('left', window_width - tooltip.outerWidth);
}

Expand Down Expand Up @@ -253,7 +253,7 @@ var link_dialog = {
},

init_resources_submit: function(){
$('#dialog-form-actions #submit_button').click(function(e){
$('#existing_resource_area .form-actions-dialog #submit_button').click(function(e){
e.preventDefault();
if((resource_selected = $('#existing_resource_area_content ul li.linked a')).length > 0) {
resourceUrl = parseURL(resource_selected.attr('href'));
Expand Down Expand Up @@ -281,14 +281,14 @@ var link_dialog = {
}
});

$('#dialog-form-actions #cancel_button').click(function(e){
$('.form-actions-dialog #cancel_button').click(function(e){
e.preventDefault();
parent.tb_remove();
});
},

init_close: function(){
$('#dialog-form-actions #cancel_button').click(function(e){
$('.form-actions-dialog #cancel_button').click(function(e){
if (parent && typeof(parent.$) == "function") {
parent.$('.ui-dialog').dialog('close').remove();
} else {
Expand Down Expand Up @@ -648,22 +648,21 @@ var image_dialog = {

, init_actions: function(){
var _this = this;
$('#dialog-form-actions #submit_button').click($.proxy(_this.submit_image_choice, _this));
$('#dialog-form-actions #cancel_button').click($.proxy(_this.close_dialog, _this));
$('.form-actions-dialog #submit_button').click($.proxy(_this.submit_image_choice, _this));
$('.form-actions-dialog #cancel_button').click($.proxy(_this.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');
image_dialog.set_image($('#existing_image_area_content ul li.selected img'));
e.preventDefault();
});

if (parent
&& parent.document.location.href != document.location.href
if (parent && parent.document.location.href != document.location.href
&& parent.document.getElementById('wym_dialog_submit') != null) {
$('#existing_image_area .form-actions input#submit_button').click(function(e) {
$('#existing_image_area .form-actions input#submit_button').click($.proxy(function(e) {
e.preventDefault();
$(parent.document.getElementById('wym_dialog_submit')).click();
});
$(this.document.getElementById('wym_dialog_submit')).click();
}, parent));
$('#existing_image_area .form-actions a.close_dialog').click(function(e) {
image_dialog.close_dialog(e);
});
Expand Down
9 changes: 9 additions & 0 deletions public/stylesheets/refinery/refinery.css
Expand Up @@ -1223,3 +1223,12 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
border-bottom: 1px dotted #727272;
cursor: help;
}
.nothing_selected {
border-bottom: 1px dotted #727272;
width: auto;
margin-bottom: 12px;
display: inline-block;
}
.nothing_selected:hover {
border-bottom: 1px solid #727272;
}
2 changes: 1 addition & 1 deletion public/stylesheets/wymeditor/skins/refinery/wymiframe.css
Expand Up @@ -71,7 +71,7 @@
border-style: solid;
border-color: gray;
border-width: 0; }
a img { border-width: 1px; border-color: blue; }
a img { border: 1px dotted blue !important; }
acronym { border: 1px solid gray; }
span { background-color: #eef; }

Expand Down
3 changes: 2 additions & 1 deletion refinerycms.gemspec
Expand Up @@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = %q{refinerycms}
s.version = %q{0.9.7.dev}
s.description = %q{A beautiful open source Ruby on Rails content manager for small business. Easy to extend, easy to use, lightweight and all wrapped up in a super slick UI.}
s.date = %q{2010-06-09}
s.date = %q{2010-06-10}
s.summary = %q{A beautiful open source Ruby on Rails content manager for small business.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
Expand Down Expand Up @@ -742,6 +742,7 @@ Gem::Specification.new do |s|
'vendor/plugins/resources/app/views',
'vendor/plugins/resources/app/views/admin',
'vendor/plugins/resources/app/views/admin/resources',
'vendor/plugins/resources/app/views/admin/resources/_existing_resource.html.erb',
'vendor/plugins/resources/app/views/admin/resources/_form.html.erb',
'vendor/plugins/resources/app/views/admin/resources/_resource.html.erb',
'vendor/plugins/resources/app/views/admin/resources/edit.html.erb',
Expand Down
44 changes: 23 additions & 21 deletions vendor/plugins/images/app/views/admin/images/_existing_image.erb
Expand Up @@ -10,27 +10,29 @@
</ul>
</div>
<%= images_paginator @images, from_dialog? %>
<div id='existing_image_size_area' class='clearfix'>
<input type='hidden' name='selected_image_size' id='selected_image_size' />
<h2>Size</h2>
<ul>
<%
thumbnail_sizes = RefinerySetting.find_or_set(:image_thumbnails, {})
(sizes = RefinerySetting.find_or_set(:image_dialogue_sizes, [:small, :medium, :large])).each_with_index do |size, index|
if thumbnail_sizes.keys.include?(size) and (pixels = thumbnail_sizes[size]).present?
modifier = ((index + 1) * 10) + 10
-%>
<li<%= " class='selected'" if size == :medium %> style="padding-top: <%= (((sizes.length * 10) - modifier) / 2) + 10 %>px">
<%= link_to "&nbsp;", "##{size}",
:rel => size.to_s,
:title => "#{size} image",
:tooltip => "#{size} image",
:style => "width: #{modifier}px; height: #{modifier}px;" %>
</li>
<% end
end -%>
</ul>
</div>
<% unless @app_dialog %>
<div id='existing_image_size_area' class='clearfix'>
<input type='hidden' name='selected_image_size' id='selected_image_size' />
<h2>Size</h2>
<ul>
<%
thumbnail_sizes = RefinerySetting.find_or_set(:image_thumbnails, {})
(sizes = RefinerySetting.find_or_set(:image_dialogue_sizes, [:small, :medium, :large])).each_with_index do |size, index|
if thumbnail_sizes.keys.include?(size) and (pixels = thumbnail_sizes[size]).present?
modifier = ((index + 1) * 10) + 10
-%>
<li<%= " class='selected'" if size == :medium %> style="padding-top: <%= (((sizes.length * 10) - modifier) / 2) + 10 %>px">
<%= link_to "&nbsp;", "##{size}",
:rel => size.to_s,
:title => "#{size} image",
:tooltip => "#{size} image",
:style => "width: #{modifier}px; height: #{modifier}px;" %>
</li>
<% end
end -%>
</ul>
</div>
<% end %>
<%= render :partial => "/shared/admin/form_actions",
:locals => {
:f => nil,
Expand Down
Expand Up @@ -24,6 +24,14 @@
:title => (delete_title ||= "Remove this #{f.object.class.name.underscore.gsub("_", " ")} forever"),
:id => "#{delete_button_id ||= "delete_button"}",
:class => "button confirm-delete") %>
<%= will_paginate paginate[:collection],
:previous_label => '&laquo; Previous',
:next_label => 'Next &raquo;',
:renderer => Refinery::LinkRenderer,
:url => paginate[:url] if ((paginate ||= {}).length > 0 &&
paginate.keys.include?(:collection) &&
paginate.keys.include?(:url)) %>
</div>
<% end %>
</div>
Expand Up @@ -14,9 +14,9 @@
<% else -%>
<img id="current_picked_image_<%= randomiser %>" class="" src="" alt="" style='display: none' />
<% end -%>
<p id='no_picked_image_selected_<%= randomiser %>' <%= "style='display: none;'" if image.present? %>>
<span id='no_picked_image_selected_<%= randomiser %>' class='nothing_selected' <%= "style='display: none;'" if image.present? %>>
There is currently no <%= description %> selected, please click here to add one.
</p>
</span>
</a>
<br/>
<%= link_to "Remove current #{description}", "#", :id => "remove_picked_image_#{randomiser}", :style => "#{"display:none;" if image.nil?}" %>
Expand Down
@@ -1,13 +1,14 @@
<%= f.hidden_field field %>
<div>
<%= link_to "<span id='no_resource_selected' #{"style='display: none;'" if resource.present?}>
<%= link_to "<span id='no_resource_selected' class='nothing_selected' #{"style='display: none;'" if resource.present?}>
There is currently no #{description ||= resource} selected, click here to add one.
</span>", insert_admin_resources_url(:dialog => true,
:update_resource => 'current_resource',
:update_text => 'current_resource_text',
:callback => 'resource_changed',
:field => "#{f.object.class.name.underscore.downcase}_#{field}",
:current_link => "#{resource.public_filename if resource.present?}"),
:current_link => "#{resource.public_filename if resource.present?}",
:height => 480),
:name => "Add #{(description ||= 'resource').titleize}",
:id => "current_resource_link"
%>
Expand Down
@@ -0,0 +1,34 @@
<div id='existing_resource_area' class='dialog_area' <%= "style='display:none;'" if @resource.errors.any? %>>
<input type='hidden' name='linked_resource' id='linked_resource' />
<div id='existing_resource_area_content' class='clearfix'>
<div id='pages_list'>
<ul class='link_list'>
<% @resources.each do |resource| -%>
<% resource_linked = (resource.public_filename == params[:current_link]) if params[:current_link].present? %>
<li<%= " class='linked'" if resource_linked %>>
<%= link_to "#{resource.title} (#{resource.public_filename})",
resource.public_filename,
:title => 'Link to this Resource',
:rel => resource.title,
:class => 'page_link',
:id => "resource_#{resource.id}" %>
</li>
<% end %>
</ul>
</div>
</div>

<%= render :partial => "/shared/admin/form_actions",
:locals => {
:f => nil,
:cancel_url => '',
:submit_button_text => 'Insert',
:hide_cancel => false,
:hide_delete => true,
:cancel_title => '',
:paginate => {
:collection => @resources,
:url => {:controller => "admin/resources", :action => "insert", :dialog => from_dialog? }
}
} if @app_dialog or @resources.any? %>
</div>
Expand Up @@ -14,7 +14,12 @@
<label>The maximum file size is <%= (Resource.attachment_options[:max_size] / 1024 / 1024) %> megabytes.</label>
</div>

<%= render :partial => "/shared/admin/form_actions", :locals => {:f => f, :continue_editing => false} %>
<%= render :partial => "/shared/admin/form_actions",
:locals => {
:f => f,
:continue_editing => false,
:hide_cancel => (@app_dialog or action_name == "insert" or from_dialog?)
} %>
<% if @app_dialog -%>
<input type='hidden' name='app_dialog' value='<%= @app_dialog %>' />
Expand Down
42 changes: 2 additions & 40 deletions vendor/plugins/resources/app/views/admin/resources/insert.html.erb
Expand Up @@ -13,51 +13,13 @@
</div>

<div id='dialog_main'>
<% if @resources.any? %>
<div id='existing_resource_area' class='dialog_area' <%= "style='display:none;'" if @resource.errors.any? %>>
<input type='hidden' name='linked_resource' id='linked_resource' />
<div id='existing_resource_area_content' class='clearfix'>
<div id='pages_list'>
<ul class='link_list'>
<% @resources.each do |resource| -%>
<% resource_linked = (resource.public_filename == params[:current_link]) if params[:current_link].present? %>
<li<%= " class='linked'" if resource_linked %>>
<%= link_to "#{resource.title} (#{resource.public_filename})",
resource.public_filename,
:title => 'Link to this Resource',
:rel => resource.title,
:class => 'page_link',
:id => "resource_#{resource.id}" %>
</li>
<% end %>
</ul>
</div>
</div>
<%= will_paginate @resources,
:previous_label => '&laquo; Previous',
:next_label => 'Next &raquo;',
:renderer => Refinery::LinkRenderer,
:url => {:controller => "admin/resources", :action => "insert", :dialog => from_dialog?} unless @app_dialog %>
</div>
<% end %>
<%= render :partial => 'existing_resource' if @resources.any? %>

<div id='upload_resource_area' class='dialog_area' <%= "style='display:none;'" if @resources.any? and @resource.errors.empty? %>>
<%= render :partial => "form", :locals => {:insert => true} %>
</div>
</div>
</div>
<% if @app_dialog %>
<div id='dialog-form-actions' class='form-actions'>
<div class='form-actions-left'>
<%= submit_tag 'Insert', :id => "submit_button", :class => 'button' %>
<%= will_paginate @resources,
:previous_label => '&laquo; Previous',
:next_label => 'Next &raquo;',
:renderer => Refinery::LinkRenderer,
:url => {:controller => "admin/resources", :action => "insert", :dialog => from_dialog? } %>
</div>
</div>
<% end %>

<% content_for :head do %>
<script type='text/javascript'>
Expand Down

0 comments on commit 74d8a6e

Please sign in to comment.