-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
663 additions
and
691 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.3.0 | ||
2.3.3 |
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 |
---|---|---|
|
@@ -31,3 +31,7 @@ | |
|
||
.btn-info { background-color: #2b9cbd; } | ||
|
||
.large-data-table { | ||
display: block; | ||
overflow-x: auto; | ||
} |
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,12 @@ | ||
class Api::V1::ApiBaseController < ActionController::API | ||
include ActionController::HttpAuthentication::Token::ControllerMethods | ||
|
||
before_filter :authenticate | ||
|
||
protected | ||
def authenticate | ||
authenticate_or_request_with_http_token do |token, _options| | ||
@api_account = Account.find_by(authentication_token: token) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
class Api::V1::UsersController < Api::V1::ApiBaseController | ||
# Creates User. | ||
# Create a user for authenticated account. | ||
# == Example Request | ||
# curl -i -H "Authorization: Token token=7LGWItoVYJmjCAMbdRHTSAtt" -X POST -d "user[name]=API User" -d "user[email]=email@api.com" -d "user[tag_list]= tester, new user" -d "attributes[phone]=+123456456" -d "attributes[custom_key]=custom_value" http://localhost:3000/api/v1/users | ||
# == Request Type: | ||
# POST | ||
# == Parameters: | ||
# [String] user[email] User's email (required) | ||
# [String] user[name] User's name (optional) | ||
# [String] user[tag_list] User's tags (optional) | ||
# [String] attributes[key] User's attributes (optional) | ||
def create | ||
user = @api_account.users.new(user_params) | ||
if user.save | ||
if params[:attributes].present? | ||
params[:attributes].keys.each do |key| | ||
user.user_attributes.create(key: key, value: params[:attributes][key]) | ||
end | ||
end | ||
render json: { | ||
user: user.attributes.merge(tags: user.tag_list, atributes: user.user_attributes.pluck(:key, :value) ) | ||
}, status: 200 | ||
else | ||
render json: { errors: user.errors.messages }, status: 422 | ||
end | ||
end | ||
|
||
# Requiered Paramaters for create a User | ||
def user_params | ||
params.require(:user).permit(:name, :email, :tag_list) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ class HomeController < ApplicationController | |
|
||
def index; end | ||
|
||
def documentation; 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
module CampaignsHelper | ||
def status_card(display_text, count, status_percent) | ||
content_tag :div, class: 'col-md-2 col-sm-4 col-xs-6 tile_stats_count' do | ||
(content_tag :span, class: 'count_top' do | ||
concat (display_text) | ||
end) + | ||
|
||
(content_tag :div, class: 'count' do | ||
count.to_s | ||
end) + | ||
|
||
(content_tag :span, class: 'count_bottom' do | ||
content_tag :i, class: 'content' | ||
"#{status_percent} %" | ||
end) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
%table.table.table-bordered | ||
%thead | ||
%tr | ||
%th Campaign | ||
%th Status | ||
%th Tags | ||
|
||
%tbody | ||
- user.campaign_users.each do |cu| | ||
%tr | ||
%td= link_to cu.campaign.name, cu.campaign | ||
%td= cu.status | ||
%td | ||
%div{id: "CampaignUserTags-#{cu.id}"} | ||
= render partial: 'tags/item_tags', locals: { item: cu } |
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,94 +1,24 @@ | ||
.row.tile_count | ||
.col-md-1 | ||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Draft Emails | ||
.count= @stats['draft'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['draft'], @total_users_count).to_i} %" | ||
= status_card('Draft', (@stats['draft'] || 0), Campaign.calculate_percent(@stats['draft'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Processed Emails | ||
.count.green= @stats['processed'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['processed'] , @total_users_count).to_i} %" | ||
= status_card('Processed', (@stats['processed'] || 0), Campaign.calculate_percent(@stats['processed'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Dropped Emails | ||
.count= @stats['dropped'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['dropped'] , @total_users_count).to_i} %" | ||
= status_card('Dropped', (@stats['dropped'] || 0), Campaign.calculate_percent(@stats['dropped'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Delivered Emails | ||
.count= @stats['delivered'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['delivered'] , @total_users_count).to_i} %" | ||
= status_card('Delivered', (@stats['delivered'] || 0), Campaign.calculate_percent(@stats['delivered'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Deferred Emails | ||
.count= @stats['deferred'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['deferred'] , @total_users_count).to_i} %" | ||
= status_card('Deferred', (@stats['deferred'] || 0), Campaign.calculate_percent(@stats['deferred'], @total_users_count).to_i) | ||
|
||
.row.tile_count | ||
.col-md-1 | ||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Bounced Emails | ||
.count= @stats['bounce'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['bounce'], @total_users_count).to_i} %" | ||
= status_card('Bounced', (@stats['bounce'] || 0), Campaign.calculate_percent(@stats['bounce'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Opened Emails | ||
.count.green= @stats['open'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['open'] , @total_users_count).to_i} %" | ||
= status_card('Opened', (@stats['open'] || 0), Campaign.calculate_percent(@stats['open'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Clicked Emails | ||
.count= @stats['click'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['click'] , @total_users_count).to_i} %" | ||
= status_card('Clicked', (@stats['click'] || 0), Campaign.calculate_percent(@stats['click'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Spamreport Emails | ||
.count= @stats['spamreport'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['spamreport'] , @total_users_count).to_i} %" | ||
= status_card('Spam', (@stats['spamreport'] || 0), Campaign.calculate_percent(@stats['spamreport'], @total_users_count).to_i) | ||
|
||
.col-md-2.col-sm-4.col-xs-6.tile_stats_count | ||
%span.count_top | ||
%i.fa.fa-user | ||
Unsubscribed Emails | ||
.count= @stats['unsubscribe'] || 0 | ||
%span.count_bottom | ||
%i.green | ||
= "#{Campaign.calculate_percent(@stats['unsubscribe'] , @total_users_count).to_i} %" | ||
= status_card('Unsubscribed', (@stats['unsubscribe'] || 0), Campaign.calculate_percent(@stats['unsubscribe'], @total_users_count).to_i) | ||
.col-md-1 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.