forked from saurabh/orbit4-5
Fix orbit_mailer file read and _right_menu login issue
This commit is contained in:
parent
ccaede2f1d
commit
a1ab533b43
3
Gemfile
3
Gemfile
|
@ -45,6 +45,9 @@ gem 'ckeditor'
|
||||||
gem 'unicorn'
|
gem 'unicorn'
|
||||||
gem 'zhconv'
|
gem 'zhconv'
|
||||||
|
|
||||||
|
#form helpers
|
||||||
|
gem 'dynamic_form'
|
||||||
|
|
||||||
#built in modules
|
#built in modules
|
||||||
eval(File.read(File.dirname(__FILE__) + '/built_in_extensions.rb'))
|
eval(File.read(File.dirname(__FILE__) + '/built_in_extensions.rb'))
|
||||||
#modules installed from the store
|
#modules installed from the store
|
||||||
|
|
|
@ -30,8 +30,8 @@ class OrbitMailer < ActionMailer::Base
|
||||||
unless email.email_files.blank?
|
unless email.email_files.blank?
|
||||||
email.email_files.each_with_index do |email_file, i|
|
email.email_files.each_with_index do |email_file, i|
|
||||||
file_type = File.extname(email_file.file.to_s)
|
file_type = File.extname(email_file.file.to_s)
|
||||||
file_content = File.read(email_file.file.url)
|
# file_content = File.read(email_file.file.url)
|
||||||
attachments["#{email_file.title}#{file_type}"] = file_content.read
|
attachments["#{email_file.title}#{file_type}"] = email_file.file.read
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -61,6 +61,8 @@ class OrbitMailer < ActionMailer::Base
|
||||||
})
|
})
|
||||||
|
|
||||||
mail_log.save
|
mail_log.save
|
||||||
|
|
||||||
|
email.destroy
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ class Email
|
||||||
field :update_user_id
|
field :update_user_id
|
||||||
|
|
||||||
has_many :email_files, :autosave => true, :dependent => :destroy
|
has_many :email_files, :autosave => true, :dependent => :destroy
|
||||||
|
accepts_nested_attributes_for :email_files, :allow_destroy => true
|
||||||
|
|
||||||
scope :can_deliver, ->{ where(:mail_sentdate.lte => Time.now, :is_sent=>false) }
|
scope :can_deliver, ->{ where(:mail_sentdate.lte => Time.now, :is_sent=>false) }
|
||||||
|
|
||||||
|
|
|
@ -56,22 +56,25 @@
|
||||||
<h3 id="ModalLabel"><%= t(:login_orbit) %></h3>
|
<h3 id="ModalLabel"><%= t(:login_orbit) %></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<%= form_for :user, url: sessions_path, html: {class: 'container'} do |f| %>
|
<%= form_tag sessions_path, :class => 'container' do %>
|
||||||
|
<%#= form_for :user, url: sessions_path, html: {class: 'container'} do |f| %>
|
||||||
<div class="input-prepend">
|
<div class="input-prepend">
|
||||||
<span class="add-on">
|
<span class="add-on">
|
||||||
<i class="icon-user"></i>
|
<i class="icon-user"></i>
|
||||||
</span>
|
</span>
|
||||||
<%= f.text_field :user_name, class: "input-xlarge" , placeholder: t("users.user_id") %>
|
<%#= f.text_field :user_name, class: "input-xlarge" , placeholder: t("users.user_id") %>
|
||||||
|
<%= text_field_tag :user_name, params[:user_name], :placeholder => t("users.user_id"), :id=>"user_email" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-prepend">
|
<div class="input-prepend">
|
||||||
<span class="add-on">
|
<span class="add-on">
|
||||||
<i class="icon-lock"></i>
|
<i class="icon-lock"></i>
|
||||||
</span>
|
</span>
|
||||||
<%= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
|
<%#= f.password_field :password, class: "input-xlarge", placeholder: t(:password) %>
|
||||||
|
<%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left" style="width: 150px;">
|
<div class="pull-left" style="width: 150px;">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" name="user[remember_me]" value="1" checked="checked" />
|
<input type="checkbox" name="remember_me" value="1" checked="checked" />
|
||||||
<small>Remember me</small>
|
<small>Remember me</small>
|
||||||
</label>
|
</label>
|
||||||
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
|
||||||
|
|
Loading…
Reference in New Issue