forked from redbooth/teambox
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alter backend to support uploads in pages Implement page uploads JS actions for page uploads
- Loading branch information
Showing
29 changed files
with
326 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
module PageUploadHelper | ||
|
||
def new_page_upload_link(project,page) | ||
link_to_remote "<span>#{t('.new_upload')}</span>", | ||
:url => new_project_page_upload_path(project,page), | ||
:method => :get, | ||
:html => { :class => 'add_button' } | ||
end | ||
def new_page_upload_link(project,page,in_bar) | ||
link_to_function "<span>#{t('.new_upload')}</span>", show_page_upload_form(in_bar), :class => 'add_button' | ||
end | ||
|
||
def cancel_page_upload_link | ||
link_to t('common.cancel'), '#', :class => 'cancel' | ||
end | ||
|
||
def show_page_upload_form(in_bar) | ||
update_page do |page| | ||
unless in_bar | ||
page.call "InsertionMarker.set", nil, true | ||
page.call "InsertionBar.place" | ||
end | ||
|
||
page.call "InsertionMarker.setEnabled", true | ||
page.call "InsertionBar.clearWidgetForm" | ||
page.call "InsertionBar.insertTempForm", (render :partial => 'uploads/page_upload') | ||
page.reload_javascript_events | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
- cname = slot.rel_object.class.to_s.downcase | ||
|
||
.pageSlot{:id => "page_slot_#{slot.id}", :slot => slot.id} | ||
= render :partial => "#{cname.pluralize}/#{cname}", :locals => {:object => slot.rel_object} | ||
= render :partial => "#{slot.rel_object.slot_view}", :locals => {:object => slot.rel_object, :page => page, :project => project} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
%input{:id => "#{formName}Before", :type => 'hidden', :name => "position[before]", :value => '0'}/ | ||
%input{:id => "#{formName}Slot", :type => 'hidden', :name => "position[slot]", :value => '0'}/ | ||
%input{:id => formName.nil? ? nil : "#{formName}Before", :type => 'hidden', :name => "position[before]", :value => pos_before}/ | ||
%input{:id => formName.nil? ? nil : "#{formName}Slot", :type => 'hidden', :name => "position[slot]", :value => pos_slot}/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.pageForm | ||
.upload_area{} | ||
= cancel_page_upload_link | ||
%h3#upload_header | ||
Upload | ||
%iframe.upload_form#upload_form{:src => page_upload_url_for(@page) + "?iframe=true&{POS}", :scrolling => 'no', :frameborder => 0} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%div.actionContainer | ||
%p.slotActions{ :style => "display: none" } | ||
%span | ||
= destroy_page_upload_link(upload.page, upload) | ||
%p.slotActions.handle{ :style => "display: none;" } | ||
%span | ||
= drag_widget_handle(upload) |
Oops, something went wrong.