merge
This commit is contained in:
commit
da1b871481
86 files changed
+3209
-1258
No files matched your search
@@ -21,6 +21,7 @@ class Desktop::JournalPagesController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.html { render :layout => false}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@@ -39,14 +40,19 @@ class Desktop::JournalPagesController < ApplicationController
|
||||
|
||||
@writing_journal = WritingJournal.new(params[:writing_journal])
|
||||
if @writing_journal.save
|
||||
respond_to do |format|
|
||||
format.html { redirect_to desktop_journal_pages_url, :layout => false, notice: 'User was successfully created.'}
|
||||
# format.json { render json: @writing_journal, status: :created, location: @writing_journal}
|
||||
# format.js
|
||||
end
|
||||
# respond_to do |format|
|
||||
# format.html { redirect_to desktop_journal_pages_url, :layout => false, notice: 'User was successfully created.'}
|
||||
# # format.json { render json: @writing_journal, status: :created, location: @writing_journal}
|
||||
# # format.js
|
||||
# end
|
||||
render :json => {"success"=>true,"msg"=>"Paper successfully saved!"}.to_json
|
||||
else
|
||||
render :json => {"success"=>false,"msg"=>"Saving failed!"}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
render :json => {"success"=>true,"msg"=>"Paper successfully saved!"}.to_json
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -74,19 +80,19 @@ class Desktop::JournalPagesController < ApplicationController
|
||||
if not file.nil?
|
||||
file_type = MIME::Types.type_for(file).first.to_s.split("/")[1]
|
||||
|
||||
case file_type
|
||||
when "jpg", "jpeg"
|
||||
type = "jpg"
|
||||
when "text", "txt"
|
||||
type = "txt"
|
||||
when "pdf"
|
||||
type = "pdf"
|
||||
when "png"
|
||||
type = "png"
|
||||
else "readme"
|
||||
end
|
||||
# case file_type
|
||||
# when "jpg", "jpeg"
|
||||
# type = "jpg"
|
||||
# when "text", "txt"
|
||||
# type = "txt"
|
||||
# when "pdf"
|
||||
# type = "pdf"
|
||||
# when "png"
|
||||
# type = "png"
|
||||
# else "readme"
|
||||
# end
|
||||
|
||||
file_type = "/assets/ft-icons/#{type}/#{type}-48_32.png"
|
||||
file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png"
|
||||
else
|
||||
file_type = ""
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user