Permalink
Browse files

fix a few issues identified in the resources dialog

  • Loading branch information...
1 parent f07fe02 commit 915c60d5b07b90624f28ae349d98fd9fddf8fa24 @parndt parndt committed Feb 5, 2010
@@ -789,13 +789,13 @@ body.dialog form {
/*bottom: 0px;*/
/*right: 0px;*/
text-align: right;
- float: right;
+ float: right;
/*position: absolute;*/
margin: 0px;
width: 763px;
}
-#upload_image_area {
+#upload_image_area, #upload_resource_area {
padding: 12px;
}
@@ -24,7 +24,7 @@
<% content_for :head do %>
<script type='text/javascript'>
resource_changed = function() {
- $('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=" + $('#current_resource').attr('href') + "&");
+ $('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=" + $('#current_resource').attr('href') + "&"));
$('#remove_resource').show();
$('#current_resource_container').show();
$('#no_resource_selected').hide();
@@ -36,7 +36,7 @@
$('#current_resource_container').hide();
$('#current_resource_text').innerHTML = '';
$('#no_resource_selected').show();
- $('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=&");
+ $('#current_resource_link').attr('href', $('#current_resource_link').attr('href').replace(/current_link=([^&])*&/, "current_link=&"));
$(this).hide();
e.preventDefault();
});
@@ -6,7 +6,7 @@
<label for='resource_type_existing' class='stripped'>Existing File</label>
</span>
<% end %>
- <span id='upload_resource_radio' class='radio<%= " selected_radio" if @resource.errors.size > 0 %>'>
+ <span id='upload_resource_radio' class='radio<%= " selected_radio" if @resource.errors.size > 0 or @resources.empty? %>'>
<input type='radio' name='resource_type' value='upload_resource' id='resource_type_upload' <%= "checked='true'" if @resources.empty? or !@resource.errors.empty? %> />
<label for='resource_type_upload' class='stripped'>New File</label>
</span>
@@ -29,14 +29,14 @@
</ul>
</div>
</div>
- <%= will_paginate @resources,
- :previous_label => '&laquo; Previous',
- :next_label => 'Next &raquo;',
- :renderer => Refinery::LinkRenderer,
+ <%= will_paginate @resources,
+ :previous_label => '&laquo; Previous',
+ :next_label => 'Next &raquo;',
+ :renderer => Refinery::LinkRenderer,
:url => {:controller => "admin/resources", :action => "insert", :dialog => from_dialog?} unless @thickbox %>
</div>
<% end %>
- <div id='upload_resource_area' class='dialog_area' <%= "style='display:none;'" if @resources.empty? %>>
+ <div id='upload_resource_area' class='dialog_area' <%= "style='display:none;'" unless @resources.empty? %>>
<%= render :partial => "form", :locals => {:insert => true} %>
</div>
</div>
@@ -47,10 +47,10 @@
or
<%= link_to "Cancel", "", :id => "cancel_button", :class => "close_dialog" %>
- <%= will_paginate @resources,
- :previous_label => '&laquo; Previous',
- :next_label => 'Next &raquo;',
- :renderer => Refinery::LinkRenderer,
+ <%= will_paginate @resources,
+ :previous_label => '&laquo; Previous',
+ :next_label => 'Next &raquo;',
+ :renderer => Refinery::LinkRenderer,
:url => {:controller => "admin/resources", :action => "insert", :dialog => from_dialog? } %>
</div>
<% end %>

0 comments on commit 915c60d

Please sign in to comment.