Skip to content
Browse files

re-enable 'Save and Promote Now' button

  • Loading branch information...
1 parent 53897ef commit 89054d0f4626b69da6ae79f24e25a4ac75506737 @avonderluft committed
View
21 app/views/admin/_edit_buttons.html.haml
@@ -1,10 +1,21 @@
- if @controller.model.is_a?(Page)
- @buttons_partials.each do |partial|
- = render :partial => partial
-%p.buttons
- = save_model_and_continue_editing_button(@controller.model)
+ = render :partial => partial, :locals => {:f => fields}
+%p.buttons{:style=>"clear: left"}
= save_model_button(@controller.model)
+ = save_model_and_continue_editing_button(@controller.model)
- if @controller.authorized_user?
= save_model_and_promote_button(@controller.model)
- or
- = link_to t('cancel'), :action => 'index'
+ - if @controller.model.is_a?(Page)
+ = submit_tag(t('preview', :default => 'Preview'), :class => 'button', :id => 'show-preview')
+ = t('or')
+ = link_to t('cancel'), :action => 'index'
+ - if @controller.model.is_a?(Page)
+ #preview_panel.fullcover.grey_out{:style => 'display: none;'}
+ %iframe{:id => 'page-preview', :class => 'fullcover', :name => 'page-preview', :src => '/loading-iframe.html', :frameborder => 0, :scrolling => "auto"}
+ .preview_tools
+ =submit_tag(t('buttons.save_changes'), :class => 'big save_changes')
+ =submit_tag(t('buttons.save_and_continue'), :class => 'big save_and_continue', :name => 'continue')
+ %span.info
+ = t('or')
+ =link_to(t('edit_page'),{}, :class => 'cancel')
View
4 concurrent_draft_extension.rb
@@ -21,8 +21,8 @@ def activate
SiteController.send :include, ConcurrentDraft::SiteControllerExtensions
%w{page snippet layout}.each do |view|
admin.send(view).edit.add :main, "admin/draft_controls", :before => "edit_header"
- # admin.send(view).edit.form_bottom.delete 'edit_buttons'
- # admin.send(view).edit.add :form_bottom, 'admin/edit_buttons'
+ admin.send(view).edit.form_bottom.delete 'edit_buttons'
+ admin.send(view).edit.add :form_bottom, 'admin/edit_buttons'
end
# admin.page.edit.add :extended_metadata, 'published_meta'
Time::DATE_FORMATS[:long_civilian] = lambda {|time| time.strftime("%B %d, %Y %I:%M%p").gsub(/(\s+)0(\d+)/, '\1\2') }
View
8 lib/concurrent_draft/helper_extensions.rb
@@ -32,8 +32,8 @@ def updated_stamp(model)
# submit_tag label, :name => 'continue', :class => 'button'
# end
#
- # def save_model_and_promote_button(_model)
- # label = _model.new_record? ? "Create" : "Save"
- # submit_tag "#{label} and Promote Now", :name => 'promote', :class => 'button'
- # end
+ def save_model_and_promote_button(_model)
+ label = _model.new_record? ? "Create" : "Save"
+ submit_tag "#{label} and Promote Now", :name => 'promote', :class => 'button'
+ end
end

0 comments on commit 89054d0

Please sign in to comment.
Something went wrong with that request. Please try again.