Skip to content

Commit

Permalink
Merge branch 'release/v1.1.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
sadikay committed Jul 4, 2017
2 parents 0768b44 + b29aff6 commit c8fd26e
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 37 deletions.
2 changes: 1 addition & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_options(settings)
address: settings.address,
port: settings.port,
domain: settings.domain,
authentication: 'plain',
authentication: 'login',
enable_starttls_auto: true
}
end
Expand Down
5 changes: 5 additions & 0 deletions app/models/admin_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AdminUser < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable
end
8 changes: 0 additions & 8 deletions app/models/mail_setting.rb

This file was deleted.

83 changes: 83 additions & 0 deletions app/views/home/documentation.html.erb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/views/imap_settings/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

.field
= f.label 'IMAP address'
= f.text_field :address, class: 'form-control'
= f.text_field :address, class: 'form-control', placeholder: 'outlook.office365.com'
.field
= f.label :port
= f.text_field :port, class: 'form-control', required: true
= f.text_field :port, class: 'form-control', required: true, placeholder: '993'
.field
= f.label :email
= f.select :email, options_for_select(current_account.smtp_settings.pluck(:reply_to).uniq), { include_blank: false }, { class: 'form-control' }
Expand Down
30 changes: 15 additions & 15 deletions app/views/inbox/_detail.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
= render partial: 'tags/item_tags', locals: { item: campaign_user }
- if campaign_users.count < 1
%p.text-center.text-danger Campaign User Not Found!

.row
.panel.panel-default
.panel-heading
User Attributes
.panel-body
%table.table-bordered.table-condensed
%thead
%tr
%td Attribute
%td Value
%tbody
- user.user_attributes.each do |attr|
- if user.user_attributes.present?
.row
.panel.panel-default
.panel-heading
User Attributes
.panel-body
%table.table-bordered.table-condensed
%thead
%tr
%td= attr.key
%td= attr.value
%td Attribute
%td Value
%tbody
- user.user_attributes.each do |attr|
%tr
%td= attr.key
%td= attr.value



Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
Sidekiq
%li
%a{:href => 'https://github.com/svtek/smart-emailing', :target => '_blank'}
%img{:alt => "Known Vulnerabilities", "data-canonical-src" => "https://snyk.io/test/github/svtek/smart-emailing", :src => "http://github-release-version.herokuapp.com/github/svtek/smart-emailing/release.svg?style=flat", :style => "max-width:100%;"}/
%img{:alt => "Known Vulnerabilities", :src => "https://img.shields.io/github/release/svtek/smart-emailing.svg?maxAge=2592000", :style => "max-width:100%;"}/
/ top navigation
.top_nav
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/welcome.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
.row
.col-lg-12
.col-md-6.text-left
%img{:alt => "Known Vulnerabilities", "data-canonical-src" => "https://snyk.io/test/github/svtek/smart-emailing", :src => "http://github-release-version.herokuapp.com/github/svtek/smart-emailing/release.svg?style=flat", :style => "max-width:100%;"}/
%img{:alt => "Known Vulnerabilities", :src => "https://img.shields.io/github/release/svtek/smart-emailing.svg?maxAge=2592000", :style => "max-width:100%;"}/
.col-md-6.text-right
%p.copyright.text-muted.small Copyright © 2017. All Rights Reserved
12 changes: 6 additions & 6 deletions app/views/smtp_settings/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@

.field
= f.label :from_email
= f.text_field :from_email, class: 'form-control', required: true
= f.text_field :from_email, class: 'form-control', required: true, placeholder: 'email@example.com'
.field
= f.label :reply_to
= f.text_field :reply_to, class: 'form-control', required: true
= f.text_field :reply_to, class: 'form-control', required: true, placeholder: 'support@example.com'
.field
= f.label :provider
= f.text_field :provider, class: 'form-control', required: true
= f.text_field :provider, class: 'form-control', required: true, placeholder: 'sendgrid, google, outlook etc...'
.field
= f.label :address
= f.text_field :address, class: 'form-control', required: true
= f.text_field :address, class: 'form-control', required: true, placeholder: 'smtp.sendgrid.net'
.field
= f.label :port
= f.text_field :port, class: 'form-control', required: true
= f.text_field :port, class: 'form-control', required: true, placeholder: '587'
.field
= f.label :domain
= f.text_field :domain, class: 'form-control', required: true
= f.text_field :domain, class: 'form-control', required: true, placeholder: 'email-domain.com'
.field
= f.label :username
= f.text_field :username, class: 'form-control', required: true
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/rails_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

## == Devise ==
config.authenticate_with do
warden.authenticate! scope: :account
warden.authenticate! scope: :admin_user
end
config.current_user_method(&:current_account)
config.current_user_method(&:current_admin_user)

## == Cancan ==
# config.authorize_with :cancan
Expand Down
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Rails.application.routes.draw do

devise_for :admin_users
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'

devise_for :accounts

authenticated :account do
Expand Down
42 changes: 42 additions & 0 deletions db/migrate/20170704205043_devise_create_admin_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class DeviseCreateAdminUsers < ActiveRecord::Migration[5.0]
def change
create_table :admin_users do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""

## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at

## Rememberable
t.datetime :remember_created_at

## Trackable
t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip

## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable

## Lockable
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at


t.timestamps null: false
end

add_index :admin_users, :email, unique: true
add_index :admin_users, :reset_password_token, unique: true
# add_index :admin_users, :confirmation_token, unique: true
# add_index :admin_users, :unlock_token, unique: true
end
end
19 changes: 18 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20170703122535) do
ActiveRecord::Schema.define(version: 20170704205043) do

create_table "accounts", force: :cascade do |t|
t.string "email", default: "", null: false
Expand All @@ -32,6 +32,23 @@
t.index ["email"], name: "index_accounts_on_email", unique: true
end

create_table "admin_users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["email"], name: "index_admin_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
end

create_table "campaign_users", force: :cascade do |t|
t.integer "campaign_id"
t.integer "user_id"
Expand Down

0 comments on commit c8fd26e

Please sign in to comment.