Initial Commit
Co-authored-by: Subin <subinthattaparambil@gmail.com> Co-authored-by: Manoj <manojmj92@gmail.com> Co-authored-by: Nithin <webofnithin@gmail.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
json.data do
|
||||
json.page_details @page_details
|
||||
json.user_access_token @user_access_token
|
||||
end
|
||||
9
app/views/api/v1/contacts/index.json.jbuilder
Normal file
9
app/views/api/v1/contacts/index.json.jbuilder
Normal file
@@ -0,0 +1,9 @@
|
||||
json.payload do
|
||||
json.array! @contacts do |contact|
|
||||
json.id contact.id
|
||||
json.name contact.name
|
||||
json.email contact.email
|
||||
json.phone_number contact.phone_number
|
||||
json.thumbnail contact.avatar.thumb.url
|
||||
end
|
||||
end
|
||||
7
app/views/api/v1/contacts/show.json.jbuilder
Normal file
7
app/views/api/v1/contacts/show.json.jbuilder
Normal file
@@ -0,0 +1,7 @@
|
||||
json.payload do
|
||||
json.id @contact.id
|
||||
json.name @contact.name
|
||||
json.email @contact.email
|
||||
json.phone_number @contact.phone_number
|
||||
json.thumbnail @contact.avatar.thumb.url
|
||||
end
|
||||
7
app/views/api/v1/contacts/update.json.jbuilder
Normal file
7
app/views/api/v1/contacts/update.json.jbuilder
Normal file
@@ -0,0 +1,7 @@
|
||||
json.payload do
|
||||
json.id @contact.id
|
||||
json.name @contact.name
|
||||
json.email @contact.email
|
||||
json.phone_number @contact.phone_number
|
||||
json.thumbnail @contact.avatar.thumb.url
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
json.payload do
|
||||
json.assignee @conversation.assignee
|
||||
json.conversation_id @conversation.display_id
|
||||
end
|
||||
14
app/views/api/v1/conversations/get_messages.json.jbuilder
Normal file
14
app/views/api/v1/conversations/get_messages.json.jbuilder
Normal file
@@ -0,0 +1,14 @@
|
||||
json.payload do
|
||||
json.array! @messages do |message|
|
||||
json.id message.id
|
||||
json.content message.content
|
||||
json.inbox_id message.inbox_id
|
||||
json.conversation_id message.conversation.display_id
|
||||
json.message_type message.message_type_before_type_cast
|
||||
json.created_at message.created_at.to_i
|
||||
json.private message.private
|
||||
json.fb_id message.fb_id
|
||||
json.attachment message.attachment.push_event_data if message.attachment
|
||||
json.sender message.user.push_event_data if message.user
|
||||
end
|
||||
end
|
||||
34
app/views/api/v1/conversations/index.json.jbuilder
Normal file
34
app/views/api/v1/conversations/index.json.jbuilder
Normal file
@@ -0,0 +1,34 @@
|
||||
json.data do
|
||||
json.meta do
|
||||
json.open_count @conversations_count[:open]
|
||||
json.resolved_count @conversations_count[:closed]
|
||||
json.conversation_type @type
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.array! @conversations do |conversation|
|
||||
json.meta do
|
||||
json.sender do
|
||||
json.id conversation.sender_id
|
||||
json.name conversation.sender.name
|
||||
json.thumbnail conversation.sender.avatar.thumb.url
|
||||
json.channel conversation.inbox.try(:channel).try(:name)
|
||||
end
|
||||
json.assignee conversation.assignee
|
||||
end
|
||||
|
||||
json.id conversation.display_id
|
||||
unless conversation.unread_incoming_messages.count == 0
|
||||
json.messages conversation.unread_messages.map(&:push_event_data)
|
||||
else
|
||||
json.messages [conversation.messages.last.try(:push_event_data)]
|
||||
end
|
||||
json.inbox_id conversation.inbox.id
|
||||
json.status conversation.status_before_type_cast
|
||||
json.timestamp conversation.messages.last.try(:created_at).try(:to_i)
|
||||
json.user_last_seen_at conversation.user_last_seen_at.to_i
|
||||
json.agent_last_seen_at conversation.agent_last_seen_at.to_i
|
||||
json.unread_count conversation.unread_incoming_messages.count
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
json.data do
|
||||
json.meta do
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.labels @labels
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
json.id @message.id
|
||||
json.content @message.content
|
||||
json.inbox_id @message.inbox_id
|
||||
json.conversation_id @message.conversation_id
|
||||
json.message_type @message.message_type_before_type_cast
|
||||
json.created_at @message.created_at.to_i
|
||||
json.private @message.private
|
||||
json.attachment @message.attachment.push_event_data if @message.attachment
|
||||
18
app/views/api/v1/conversations/show.json.jbuilder
Normal file
18
app/views/api/v1/conversations/show.json.jbuilder
Normal file
@@ -0,0 +1,18 @@
|
||||
json.meta do
|
||||
json.labels @conversation.label_list
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.array! @messages do |message|
|
||||
json.id message.id
|
||||
json.content message.content
|
||||
json.inbox_id message.inbox_id
|
||||
json.conversation_id message.conversation.display_id
|
||||
json.message_type message.message_type_before_type_cast
|
||||
json.created_at message.created_at.to_i
|
||||
json.private message.private
|
||||
json.fb_id message.fb_id
|
||||
json.attachment message.attachment.push_event_data if message.attachment
|
||||
json.sender message.user.push_event_data if message.user
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
json.meta do
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.success @status
|
||||
json.current_status @conversation.status_before_type_cast
|
||||
json.conversation_id @conversation.display_id
|
||||
end
|
||||
|
||||
8
app/views/api/v1/inbox_members/show.json.jbuilder
Normal file
8
app/views/api/v1/inbox_members/show.json.jbuilder
Normal file
@@ -0,0 +1,8 @@
|
||||
json.data do
|
||||
json.payload do
|
||||
json.array! @agents do |agent|
|
||||
json.user_id agent.id
|
||||
json.name agent.name
|
||||
end
|
||||
end
|
||||
end
|
||||
15
app/views/api/v1/inboxes/index.json.jbuilder
Normal file
15
app/views/api/v1/inboxes/index.json.jbuilder
Normal file
@@ -0,0 +1,15 @@
|
||||
json.data do
|
||||
json.meta do
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.array! @inboxes do |inbox|
|
||||
json.id inbox.id
|
||||
json.channel_id inbox.channel_id
|
||||
json.name inbox.name
|
||||
json.channel_type inbox.channel_type
|
||||
json.avatar_url inbox.channel.avatar.url
|
||||
json.page_id inbox.channel.page_id
|
||||
end
|
||||
end
|
||||
end
|
||||
8
app/views/api/v1/labels/index.json.jbuilder
Normal file
8
app/views/api/v1/labels/index.json.jbuilder
Normal file
@@ -0,0 +1,8 @@
|
||||
json.data do
|
||||
json.meta do
|
||||
end
|
||||
|
||||
json.payload do
|
||||
json.labels @labels
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
<p>Hi <%= @agent.name %>,</p>
|
||||
|
||||
<p>Time to save the world. A new conversation has been assigned to you</p>
|
||||
|
||||
<p>Click <%= link_to 'here', conversation_url(id: @conversation.display_id) %> to get cracking. </p>
|
||||
0
app/views/dashboard/index.html.erb
Normal file
0
app/views/dashboard/index.html.erb
Normal file
15
app/views/home/index.html.erb
Normal file
15
app/views/home/index.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Facebook Auth Example</title>
|
||||
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
|
||||
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
</div>
|
||||
<%= yield %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
24
app/views/layouts/application.html.erb
Normal file
24
app/views/layouts/application.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Chatwoot</title>
|
||||
<%= csrf_meta_tags %>
|
||||
|
||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
<% if current_user %>
|
||||
<body data-account-id="<%= current_user.account_id %>" >
|
||||
<% end %>
|
||||
<% if user_signed_in? %>
|
||||
<li>
|
||||
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link_to('Login', new_user_session_path) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
13
app/views/layouts/mailer.html.erb
Normal file
13
app/views/layouts/mailer.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Email styles need to be inline */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
1
app/views/layouts/mailer.text.erb
Normal file
1
app/views/layouts/mailer.text.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= yield %>
|
||||
13
app/views/layouts/vueapp.html.erb
Normal file
13
app/views/layouts/vueapp.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Chatwoot</title>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= javascript_pack_tag 'application' %>
|
||||
<%= stylesheet_pack_tag 'application' %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
16
app/views/users/confirmations/new.html.erb
Normal file
16
app/views/users/confirmations/new.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<h2>Resend confirmation instructions</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Resend confirmation instructions" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
@@ -0,0 +1,5 @@
|
||||
<p>Welcome <%= @email %>!</p>
|
||||
|
||||
<p>You can confirm your account email through the link below:</p>
|
||||
|
||||
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
|
||||
3
app/views/users/mailer/password_change.html.erb
Normal file
3
app/views/users/mailer/password_change.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>We're contacting you to notify you that your password has been changed.</p>
|
||||
@@ -0,0 +1,8 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
||||
|
||||
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
|
||||
|
||||
<p>If you didn't request this, please ignore this email.</p>
|
||||
<p>Your password won't change until you access the link above and create a new one.</p>
|
||||
7
app/views/users/mailer/unlock_instructions.html.erb
Normal file
7
app/views/users/mailer/unlock_instructions.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
||||
|
||||
<p>Click the link below to unlock your account:</p>
|
||||
|
||||
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
|
||||
25
app/views/users/passwords/edit.html.erb
Normal file
25
app/views/users/passwords/edit.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<h2>Change your password</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
<%= f.hidden_field :reset_password_token %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password, "New password" %><br />
|
||||
<% if @minimum_password_length %>
|
||||
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
|
||||
<% end %>
|
||||
<%= f.password_field :password, autofocus: true, autocomplete: "off" %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password_confirmation, "Confirm new password" %><br />
|
||||
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Change my password" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
16
app/views/users/passwords/new.html.erb
Normal file
16
app/views/users/passwords/new.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<h2>Forgot your password?</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Send me reset password instructions" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
43
app/views/users/registrations/edit.html.erb
Normal file
43
app/views/users/registrations/edit.html.erb
Normal file
@@ -0,0 +1,43 @@
|
||||
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true %>
|
||||
</div>
|
||||
|
||||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
||||
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
||||
<% end %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
||||
<%= f.password_field :password, autocomplete: "off" %>
|
||||
<% if @minimum_password_length %>
|
||||
<br />
|
||||
<em><%= @minimum_password_length %> characters minimum</em>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password_confirmation %><br />
|
||||
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
||||
<%= f.password_field :current_password, autocomplete: "off" %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Update" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3>Cancel my account</h3>
|
||||
|
||||
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
|
||||
|
||||
<%= link_to "Back", :back %>
|
||||
34
app/views/users/registrations/new.html.erb
Normal file
34
app/views/users/registrations/new.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<h2>Sign up</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password %>
|
||||
<% if @minimum_password_length %>
|
||||
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
||||
<% end %><br />
|
||||
<%= f.password_field :password, autocomplete: "off" %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password_confirmation %><br />
|
||||
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
||||
</div>
|
||||
|
||||
<%= f.fields_for :account_attributes do |i| %>
|
||||
<p><%= i.label :name %><br />
|
||||
<%= i.text_field :name %></p>
|
||||
<% end %>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Sign up" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
26
app/views/users/sessions/new.html.erb
Normal file
26
app/views/users/sessions/new.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<h2>Log in</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :password %><br />
|
||||
<%= f.password_field :password, autocomplete: "off" %>
|
||||
</div>
|
||||
|
||||
<% if devise_mapping.rememberable? -%>
|
||||
<div class="field">
|
||||
<%= f.check_box :remember_me %>
|
||||
<%= f.label :remember_me %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Log in" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
25
app/views/users/shared/_links.html.erb
Normal file
25
app/views/users/shared/_links.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<%- if controller_name != 'sessions' %>
|
||||
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
||||
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
||||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
||||
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.omniauthable? %>
|
||||
<%- resource_class.omniauth_providers.each do |provider| %>
|
||||
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
16
app/views/users/unlocks/new.html.erb
Normal file
16
app/views/users/unlocks/new.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<h2>Resend unlock instructions</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Resend unlock instructions" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
||||
Reference in New Issue
Block a user