modified error msgs and cancle button, but those two have bug...
This commit is contained in:
		
							parent
							
								
									613bbec1f0
								
							
						
					
					
						commit
						0125010a05
					
				| 
						 | 
				
			
			@ -39,7 +39,8 @@ class Desktop::CoAuthorsController < ApplicationController
 | 
			
		|||
    if @co_author.save
 | 
			
		||||
      render json: {success:true, msg: "Co-author successfully saved!"}.to_json
 | 
			
		||||
    else
 | 
			
		||||
      render json: {success: false, msg: @co_author.errors.full_messages}.to_json
 | 
			
		||||
      error_msg = @co_author.errors.full_messages.join("<br />")
 | 
			
		||||
      render json: {success: false, msg: error_msg}.to_json
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -49,7 +50,8 @@ class Desktop::CoAuthorsController < ApplicationController
 | 
			
		|||
    if @co_author.update_attributes(params[:co_author])
 | 
			
		||||
      render json: {success:true, msg: "Co-author successfully update!"}.to_json
 | 
			
		||||
    else
 | 
			
		||||
      render json: {success: false, msg: @co_author.errors.full_messages}.to_json
 | 
			
		||||
      error_msg = @co_author.errors.full_messages.join("<br />")
 | 
			
		||||
      render json: {success: false, msg: error_msg}.to_json
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,7 +23,6 @@ class Desktop::JournalPagesController < ApplicationController
 | 
			
		|||
    @journal_candidate =
 | 
			
		||||
      WritingJournal.where(create_user_id: current_user.id).map{|j|j.journal_title}.uniq
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    respond_to do |format|
 | 
			
		||||
      format.html { render :layout => false}
 | 
			
		||||
    end
 | 
			
		||||
| 
						 | 
				
			
			@ -47,7 +46,8 @@ class Desktop::JournalPagesController < ApplicationController
 | 
			
		|||
    if @writing_journal.save
 | 
			
		||||
      render json: {success: true, msg: "Paper successfully saved!"}.to_json
 | 
			
		||||
    else
 | 
			
		||||
      render json: {success: false, msg: @writing_journal.errors.full_messages}.to_json
 | 
			
		||||
      error_msg = @writing_journal.errors.full_messages.join("<br />")
 | 
			
		||||
      render json: {success: false, msg: error_msg}.to_json
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -58,7 +58,8 @@ class Desktop::JournalPagesController < ApplicationController
 | 
			
		|||
      if @writing_journal.update_attributes(params[:writing_journal])
 | 
			
		||||
        render json: {success: true, msg: "Paper successfully saved!"}.to_json
 | 
			
		||||
      else
 | 
			
		||||
        render json: {success: false, msg: @writing_journal.errors.full_messages}.to_json
 | 
			
		||||
        error_msg = @writing_journal.errors.full_messages.join("<br />")
 | 
			
		||||
        render json: {success: false, msg: error_msg}.to_json
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
| 
						 | 
				
			
			@ -66,19 +67,6 @@ class Desktop::JournalPagesController < ApplicationController
 | 
			
		|||
  def check_file_type file
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
      file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png"
 | 
			
		||||
    else
 | 
			
		||||
      file_type = ""
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
<div class="toolbar hh2">
 | 
			
		||||
  <div class="fn_g hp">
 | 
			
		||||
    <%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn hh2 thmc2 thmtxt" %>
 | 
			
		||||
    <!-- class: bt-cancle can't be remove
 | 
			
		||||
    <%= submit_tag "Cancel", class: "bt-cancel fn_btn hh2 thmc2 thmtxt" %> -->
 | 
			
		||||
    <!-- class: bt-cancle can't be remove -->
 | 
			
		||||
    <%= submit_tag "Cancel", :type => "button", class: "bt-cancel fn_btn hh2 thmc2 thmtxt" %>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="hh2 hp sdm">
 | 
			
		||||
    <div class="sdm_t hh2">Entry Year</div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in New Issue