Commit da822ad3 by Mykhailo Makohin

make email sending

parent e7c178aa
...@@ -40,6 +40,8 @@ gem 'aasm' ...@@ -40,6 +40,8 @@ gem 'aasm'
gem 'ransack' gem 'ransack'
gem 'liqpay', github: 'liqpay/sdk-ruby' gem 'liqpay', github: 'liqpay/sdk-ruby'
gem 'country_select', '~> 4.0' gem 'country_select', '~> 4.0'
gem 'gibbon'
group :development, :test do group :development, :test do
gem 'byebug', platform: :mri gem 'byebug', platform: :mri
......
...@@ -126,6 +126,9 @@ GEM ...@@ -126,6 +126,9 @@ GEM
formtastic_i18n (0.6.0) formtastic_i18n (0.6.0)
friendly_id (5.3.0) friendly_id (5.3.0)
activerecord (>= 4.0.0) activerecord (>= 4.0.0)
gibbon (3.2.0)
faraday (>= 0.9.1)
multi_json (>= 1.11.0)
globalid (0.4.2) globalid (0.4.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
globalize (5.2.0) globalize (5.2.0)
...@@ -353,6 +356,7 @@ DEPENDENCIES ...@@ -353,6 +356,7 @@ DEPENDENCIES
country_select (~> 4.0) country_select (~> 4.0)
devise devise
friendly_id friendly_id
gibbon
globalize globalize
globalize-accessors globalize-accessors
gmaps4rails gmaps4rails
......
...@@ -9,27 +9,6 @@ ActiveAdmin.register_page "Dashboard" do ...@@ -9,27 +9,6 @@ ActiveAdmin.register_page "Dashboard" do
end end
end end
# menu priority: 2, label: proc { I18n.t("active_admin.models.user.other") }
# Here is an example of a simple dashboard with columns and panels.
#
# columns do
# column do
# panel "Recent Posts" do
# ul do
# Post.recent(5).map do |post|
# li link_to(post.title, admin_post_path(post))
# end
# end
# end
# end
# column do
# panel "Info" do
# para "Welcome to ActiveAdmin."
# end
# end
# end
controller do controller do
# before_action :authenticate_user! # before_action :authenticate_user!
load_and_authorize_resource load_and_authorize_resource
......
...@@ -10,9 +10,6 @@ ActiveAdmin.register Payment do ...@@ -10,9 +10,6 @@ ActiveAdmin.register Payment do
column "User" do |p| column "User" do |p|
p.user p.user
end end
column "Email" do |p|
p.user.email
end
column "Project" do |p| column "Project" do |p|
p.project p.project
end end
......
...@@ -18,7 +18,6 @@ ActiveAdmin.register Project do ...@@ -18,7 +18,6 @@ ActiveAdmin.register Project do
filter :updated_at, label: I18n.t("active_admin.attributes.project.updated_at") filter :updated_at, label: I18n.t("active_admin.attributes.project.updated_at")
controller do controller do
# skip_before_action :verify_authenticity_token
def create def create
@project = Project.new(project_params) @project = Project.new(project_params)
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
//= require jBox.all //= require jBox.all
//= require demo //= require demo
//= require jquery.remotipart //= require jquery.remotipart
//= require bootstrap.min
//= require outdatedbrowser //= require outdatedbrowser
//= require owl.carousel //= require owl.carousel
//= require pgwslider.min //= require pgwslider.min
......
function liqpay_form() {
document.getElementById('liqpay_form').style.display = 'block';
document.getElementById('interkassa_form').style.display = 'none';
}
function interkassa_form() {
document.getElementById('liqpay_form').style.display = 'none';
document.getElementById('interkassa_form').style.display = 'block';
}
...@@ -22,6 +22,7 @@ jQuery(document).ready(function($){ ...@@ -22,6 +22,7 @@ jQuery(document).ready(function($){
// initTip(); // initTip();
// initMap(); // initMap();
// initBookmarkAnimation(); // initBookmarkAnimation();
initBeerSlider();
submitForm(); submitForm();
onlyNumbers(); onlyNumbers();
initSlider(); initSlider();
...@@ -34,6 +35,10 @@ jQuery(document).ready(function($){ ...@@ -34,6 +35,10 @@ jQuery(document).ready(function($){
// $('[data-toggle="popover"]').popover({title: "<span class=\"usr_surname\">Фондар</span><span class=\"usr_name\">Вікторія Тараневська <a href=\"#\" class=\"round_link\"><i class=\"icon icon_fb\"></i></span>", content: "<div class=\"usr_contributions\">Внесків 3</div><div class=\"usr_funds\"><div class=\"usr_funds_value\">на суму: 14 200 UAH</div></div><div class=\"usr_volunteering\">Волонтерство 2</div>", html: true, placement: "top"}); // $('[data-toggle="popover"]').popover({title: "<span class=\"usr_surname\">Фондар</span><span class=\"usr_name\">Вікторія Тараневська <a href=\"#\" class=\"round_link\"><i class=\"icon icon_fb\"></i></span>", content: "<div class=\"usr_contributions\">Внесків 3</div><div class=\"usr_funds\"><div class=\"usr_funds_value\">на суму: 14 200 UAH</div></div><div class=\"usr_volunteering\">Волонтерство 2</div>", html: true, placement: "top"});
}) })
function initBeerSlider(){
new BeerSlider( document.getElementById( "slider" ) );
}
function submitForm(){ function submitForm(){
$( ".simple_form" ).submit(function() { $( ".simple_form" ).submit(function() {
if ($(this).valid() && $( "#payments_attributes_amount" ).val() > '0' ) { if ($(this).valid() && $( "#payments_attributes_amount" ).val() > '0' ) {
...@@ -43,21 +48,6 @@ function submitForm(){ ...@@ -43,21 +48,6 @@ function submitForm(){
}); });
} }
// function initBookmarkAnimation(){
// let anchorlinks = document.querySelectorAll('a[href^="#"]')
// for (let item of anchorlinks) { // relitere
// item.addEventListener('click', (e)=> {
// let hashval = item.getAttribute('href')
// let target = document.querySelector(hashval)
// target.scrollIntoView({
// behavior: 'smooth'
// })
// history.pushState(null, null, hashval)
// e.preventDefault()
// })
// }
// }
function initSlider(){ function initSlider(){
$(document).ready(function(){ $(document).ready(function(){
......
class EmailApiController < ApplicationController
def subscribe
@list_id = "YOUR-LIST-ID"
gb = Gibbon::API.new
gb.lists.subscribe({ id: @list_id, email: { email: params[:email][:address] } } )
end
end
...@@ -11,11 +11,53 @@ class PaymentsController < ApplicationController ...@@ -11,11 +11,53 @@ class PaymentsController < ApplicationController
responce_hash["type_of_payment"] = responce_hash.delete("type") responce_hash["type_of_payment"] = responce_hash.delete("type")
responce_hash["project_id"] = responce_hash["order_id"].split("_")[0] responce_hash["project_id"] = responce_hash["order_id"].split("_")[0]
responce_hash["user_id"] = current_user.id responce_hash["user_id"] = current_user.id
if responce_hash['status'] == "success" if responce_hash["status"] == "success"
Payment.create(responce_hash) Payment.create(responce_hash)
end end
end end
redirect_to root_path redirect_to root_path
end end
def interkassa_success
ap 'success'
redirect_to root_path
# ap '------------------------'
# params["amount"] = params.delete("ik_co_rfn")
# responce_hash = {}
# responce_hash['amount'] = params['amount']
# params["payment_id"] = params.delete("ik_inv_id")
# responce_hash['payment_id'] = params['payment_id']
# ap responce_hash
# Payment.create(responce_hash)
# redirect_to root_path
# Payment.create(amount: 3, payment_id: params['ik_inv_id'] )
# responce_hash = params
# responce_hash["payment_id"] = responce_hash.delete("ik_inv_id")
# responce_hash["status"] = responce_hash.delete("ik_inv_st")
# responce_hash["currency"] = responce_hash.delete("ik_cur")
# responce_hash["description"] = responce_hash.delete("ik_desc")
# responce_hash["create_date"] = responce_hash.delete("ik_inv_crt")
# responce_hash["end_date"] = responce_hash.delete("ik_inv_prc")
# responce_hash["amount"] = responce_hash.delete("ik_co_rfn")
# responce_hash["transaction_id"] = responce_hash.delete("ik_trn_id")
# responce_hash["paytype"] = responce_hash.delete("ik_pw_via")
# responce_hash["project_id"] = responce_hash["ik_pm_no"].split("_")[1]
# # responce_hash["user_id"] = current_user.id
# # Payment.create(responce_hash)
# ap '________________________________'
# puts responce_hash
end
def interkassa_interaction
ap 'interaction'
params["amount"] = params.delete("ik_co_rfn")
responce_hash = {}
responce_hash['amount'] = params['amount']
params["payment_id"] = params.delete("ik_inv_id")
responce_hash['payment_id'] = params['payment_id']
responce_hash['description'] = params['ik_desc']
ap responce_hash
Payment.create(responce_hash)
end
end end
class ApplicationJob < ActiveJob::Base
end
class Contribution < ApplicationRecord
belongs_to :user
belongs_to :project
validates :contribution, presence: true, numericality: { only_integer: true }
end
class ProjectPartial < ApplicationRecord class ProjectPartial < ApplicationRecord
# acts_as_list top_of_list: 0
belongs_to :project belongs_to :project
acts_as_list scope: :project acts_as_list scope: :project
end end
...@@ -3,6 +3,8 @@ class User < ApplicationRecord ...@@ -3,6 +3,8 @@ class User < ApplicationRecord
after_initialize :set_default_role, :if => :new_record? after_initialize :set_default_role, :if => :new_record?
after_create :send_email_to_user
mount_uploader :avatar, AvatarUploader mount_uploader :avatar, AvatarUploader
has_many :payments, dependent: :destroy has_many :payments, dependent: :destroy
...@@ -43,6 +45,12 @@ class User < ApplicationRecord ...@@ -43,6 +45,12 @@ class User < ApplicationRecord
protected protected
def send_email_to_user
gibbon = Gibbon::Request.new(api_key: "e5f9a6a9edc148b49496c1b972f673b7-us4")
gibbon.lists('938061d57b').members.create(body: {email_address: self.email, status: "subscribed",
merge_fields: {MMERGE1: self.name}})
end
def password_required? def password_required?
return false if skip_password_validation return false if skip_password_validation
super super
......
class ContributionsService
# def initialize(contribution)
# @contribution = contribution
# end
# def params_project_partial
# [{title: 'description', position: 0},
# {title: 'project_galeries', position: 1},
# {title: 'project_qoutes', position: 2},
# {title: 'project_videos', position: 3},
# {title: 'project_photos', position: 4},
# {title: 'project_links', position: 5},
# {title: 'project_documents', position: 6}]
# end
# def set_project_partials
# @project.project_partials.create(params_project_partial)
# end
end
<% unless current_user %>
<%= link_to "Sign in with Facebook", user_facebook_omniauth_authorize_path %>
<%= link_to "Sign in with Google", user_google_oauth2_omniauth_authorize_path %>
<%= link_to "Sign in with LinkedIn", user_linkedin_omniauth_authorize_path %>
<% else %> <%= current_user[:name] %>
<%= link_to "Logout", destroy_user_session_path, method: :delete %>
<% end %>
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
%span.project_item_top %span.project_item_top
= image_tag(project.photo_preview_url(:thumb_small)) = image_tag(project.photo_preview_url(:thumb_small))
%span.item_label %span.item_label
= t "#{project.types}" = t "#{ project.types }"
%i.icon.icon_plus %i.icon.icon_plus
%span.project_item_middle %span.project_item_middle
%span.project_item_title #{project.title} %span.project_item_title #{ project.title}
%span.project_item_subtitle= t "#{project.status}" %span.project_item_subtitle= t "#{ project.status }"
%span.project_item_text= raw project.short_description %span.project_item_text= raw project.short_description
%span.project_item_bot %span.project_item_bot
%span.progress %span.progress
%span.progress-bar{"aria-valuemax" => "100", "aria-valuemin" => "0", "aria-valuenow" => "20", role: "progressbar", style: "width:20%"} %span.progress-bar{ "aria-valuemax" => "100", "aria-valuemin" => "0", "aria-valuenow" => "20", role: "progressbar", style: "width:20%" }
%span.progress_value= t ('collected_money') %span.progress_value= t ('collected_money')
%span.progress_details.clearfix %span.progress_details.clearfix
%span.progress_details_item %span.progress_details_item
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
%span.progress_details_item %span.progress_details_item
= t ('joined_people') = t ('joined_people')
%strong 214 %strong 214
= link_to "#{t ('more')}", root_path(limit: @projects.count + 1), remote: true, class: ' loadMore btn btn_default btn_bordered btn_more' = link_to "#{ t ('more') }", root_path(limit: @projects.count + 1), remote: true, class: ' loadMore btn btn_default btn_bordered btn_more'
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
%meta{:content => "", :name => "description"} %meta{:content => "", :name => "description"}
%meta{:content => "width=device-width", :name => "viewport"} %meta{:content => "width=device-width", :name => "viewport"}
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"} %meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}
%meta{:content => "bbb10760db4991c16fdc0c13d01e9ac3", :name => "interkassa-verification"}/
%link{:href => "https://cdn.jsdelivr.net/bxslider/4.2.12/jquery.bxslider.css", :rel => "stylesheet"}/ %link{:href => "https://cdn.jsdelivr.net/bxslider/4.2.12/jquery.bxslider.css", :rel => "stylesheet"}/
/ %script{:src => "https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"} / %script{:src => "https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"}
%script{src: "https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"} %script{src: "https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%nav.navbar.navbar-default %nav.navbar.navbar-default
.container-fluid .container-fluid
.navbar-header .navbar-header
%button.navbar-toggle.collapsed{"aria-expanded" => "false", "data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", :type => "button"} %button.navbar-toggle.collapsed{ "aria-expanded" => "false", "data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", type: "button" }
%span.sr-only Toggle navigation %span.sr-only Toggle navigation
%span.icon-bar %span.icon-bar
%span.icon-bar %span.icon-bar
...@@ -13,28 +13,28 @@ ...@@ -13,28 +13,28 @@
#bs-example-navbar-collapse-1.collapse.navbar-collapse #bs-example-navbar-collapse-1.collapse.navbar-collapse
%ul.nav.navbar-nav %ul.nav.navbar-nav
%li %li
%a{:href => "#"}= t ("header.platfform") = link_to (t "header.platfform"), "#"
%li %li
%a{:href => "#"}= t ("header.grants") = link_to (t "header.grants"), "#"
%li %li
%a{:href => "#projects"}= t ("header.projects") = link_to (t "header.projects"), "#"
%li %li
%a{:href => "#"}= t ("header.partners") = link_to (t "header.partners"), "#"
%li %li
%a{:href => "#"}= t ("header.digital") = link_to (t "header.digital"), "#"
%li %li
%a{:href => "#"}= t ("header.about_us") = link_to (t "header.about_us"), "#"
%li %li
%a{:href => "#"}= t ("header.news") = link_to (t "header.news"), "#"
%li %li
%a{:href => "#"}= t ("header.reports") = link_to (t "header.reports"), "#"
%li %li
%a{:href => "#"} connectif = link_to "connectif", "#"
%ul.nav.nav-tabs.nav_btns %ul.nav.nav-tabs.nav_btns
%li.active %li.active
%a{"data-toggle" => "tab", :href => "#1"}= t 'header.people' = link_to (t "header.people"), "#1", "data-toggle" => "tab"
%li %li
%a{"data-toggle" => "tab", :href => "#2"}= t 'header.businesses' = link_to (t "header.businesses"), "#2", "data-toggle" => "tab"
.show_tip .show_tip
Ознайомтесь з дружніми бізнесами Ознайомтесь з дружніми бізнесами
які допомагають формувати які допомагають формувати
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
- unless current_user - unless current_user
.login_wrap .login_wrap
%div %div
%button.login_btn{"data-target" => "#modal3", "data-toggle" => "modal"} %button.login_btn{ "data-target" => "#modal3", "data-toggle" => "modal" }
= image_tag ("login.png") = image_tag ("login.png")
- else - else
#sign_in #sign_in
.dropdown.user_dropdown .dropdown.user_dropdown
%button#dropdownMenu1.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"} %button#dropdownMenu1.dropdown-toggle{ "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"}
- if current_user.avatar? - if current_user.avatar?
= image_tag(current_user.avatar_url) = image_tag(current_user.avatar_url)
- else - else
...@@ -55,12 +55,12 @@ ...@@ -55,12 +55,12 @@
%ul.dropdown-menu{"aria-labelledby" => "dropdownMenu1"} %ul.dropdown-menu{"aria-labelledby" => "dropdownMenu1"}
- if current_user.admin? - if current_user.admin?
%li %li
%a{:href => "/admin"}= t 'header.admin' = link_to (t "header.admin"), admin_root_path
%li %li
%a{:href => "#"}= t 'header.profile' = link_to (t "header.profile"), "#"
%li %li
= link_to("#{t 'header.log_out'}", destroy_user_session_path, method: :delete) = link_to (t "header.log_out"), destroy_user_session_path, method: :delete
.search_block .search_block
%input#search_field.search_field{placeholder: "#{t 'header.find_by_name'}", :type => "text"}/ %input#search_field.search_field{placeholder: (t "header.find_by_name"), type: "text"}/
%button.search_btn %button.search_btn
%i.icon.icon_search %i.icon.icon_search
\ No newline at end of file
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
= t ('adress') = t ('adress')
.footer_contacts_text .footer_contacts_text
= t ('ivano_frankivsk') = t ('ivano_frankivsk')
%br/ %br
= t ('akademika_sakharova') = t ('akademika_sakharova')
%br/ %br
= t ('promprylad') = t ('promprylad')
.footer_contacts_item .footer_contacts_item
.footer_contacts_title .footer_contacts_title
...@@ -17,21 +17,21 @@ ...@@ -17,21 +17,21 @@
info@warm.if.ua info@warm.if.ua
.footer_btns.col-sm-6 .footer_btns.col-sm-6
.footer_soc .footer_soc
%a.round_link.soc_link_fb{:href => "#"} = link_to "#", class: "round_link soc_link_fb" do
%i.icon.icon_fb %i.icon.icon_fb
%a.round_link.soc_link_tw{:href => "#"} = link_to "#", class: "round_link soc_link_tw" do
%i.icon.icon_tw %i.icon.icon_tw
.lang .lang
%a.lang_link{:href => "#"} ENG = link_to "ENG", "/en", class: "lang_link"
%a.lang_link.active{:href => "#"} UA = link_to "UK", "/uk", class: "lang_link active"
.footer_middle .footer_middle
.footer_subscribe_envelope .footer_subscribe_envelope
.footer_subscribe_text .footer_subscribe_text
= t ('footer_subscribe_text') = t ('footer_subscribe_text')
.footer_subscribe_to .footer_subscribe_to
.input_styled_wrap .input_styled_wrap
%input.input_styled{placeholder: "#{t ('your_email')}", :type => "email"}/ %input.input_styled{ placeholder: (t "your_email"), type: "email" }
%a.btn.btn_default.btn_sm_size.btn_subscribe{:href => "#"}= t ('subscribe') = link_to (t "subscribe"), "#", class: "btn btn_default btn_sm_size btn_subscribe"
.footer_bot .footer_bot
.footer_doneby .footer_doneby
.footer_doneby_made .footer_doneby_made
...@@ -41,5 +41,5 @@ ...@@ -41,5 +41,5 @@
%span © %span ©
2015 2016 Warm-city. All Rights Reserved 2015 2016 Warm-city. All Rights Reserved
.footer_links .footer_links
%a.footer_link_item{:href => "https://bvblogic.com/"} = link_to "https://bvblogic.com", class: "footer_link_item" do
=image_tag ('bvb_logo.png') = image_tag ('bvb_logo.png')
#modal.modal.modal_styled.in{"aria-labelledby" => "modalLabel", :role => "dialog", :tabindex => "-1"} #modal.modal.modal_styled.in{ "aria-labelledby" => "modalLabel", role: "dialog", tabindex: "-1" }
.modal-dialog{:role => "document"} .modal-dialog{ role: "document" }
.modal-content .modal-content
#user_form #user_form
= simple_form_for :user, remote: true, html: { novalidate: true, autocomplete: 'off' }, url: users_path do |f| = simple_form_for :user, remote: true, html: { novalidate: true, autocomplete: 'off' }, url: users_path do |f|
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
.modal-header_steps_wrap .modal-header_steps_wrap
%span#first_step.modal-header_step.active Step 1 %span#first_step.modal-header_step.active Step 1
%span#second_step.modal-header_step Step 2 %span#second_step.modal-header_step Step 2
%button.round_link.close{"aria-label" => "Close", "data-dismiss" => "modal", type: "button"} %button.round_link.close{ "aria-label" => "Close", "data-dismiss" => "modal", type: "button" }
%i.icon.icon_close %i.icon.icon_close
.modal-header_bot .modal-header_bot
.row .row
......
#modal_payment.fade.modal.modal_styled{"aria-labelledby" => "modalLabel", role: "dialog", tabindex: "-1"} #modal_payment.fade.modal.modal_styled{ "aria-labelledby" => "modalLabel", role: "dialog", tabindex: "-1" }
.modal-dialog{role: "document"} .modal-dialog{ role: "document" }
.modal-content .modal-content
.modal-header .modal-header
.modal-header_top.clearfix .modal-header_top.clearfix
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
.modal-header_steps_wrap .modal-header_steps_wrap
%span.modal-header_step крок 1 %span.modal-header_step крок 1
%span.modal-header_step.active крок 2 %span.modal-header_step.active крок 2
%button.round_link.close{"aria-label" => "Close", "data-dismiss" => "modal", type: "button"} %button.round_link.close{ "aria-label" => "Close", "data-dismiss" => "modal", type: "button" }
%i.icon.icon_close %i.icon.icon_close
.modal-header_bot .modal-header_bot
.row .row
...@@ -15,22 +15,31 @@ ...@@ -15,22 +15,31 @@
%h3#modalLabel.modal-title Фондування %h3#modalLabel.modal-title Фондування
.col-sm-7.modal-header_bot_amount .col-sm-7.modal-header_bot_amount
.form-group .form-group
%label{ for: "id_1"} %label{ for: "id_1" }
Сума внеску в Сума внеску в
%span.currency UAH %span.currency UAH
%span.amount_value #{payment.amount} %span.amount_value #{ payment.amount }
.modal-body .modal-body
.help_text Оберіть платіжну систему зручну для вас .help_text Оберіть платіжну систему зручну для вас
.radio .radio
.radio_item .radio_item
%input#liqpay{ checked: "checked", name: "payment_system", type: "radio", value: "liqpay" } %input#liqpay{ checked: "checked", name: "payment_system", type: "radio", value: "liqpay", onclick: "liqpay_form();"}
%label{ for: "liqpay" } %label{ for: "liqpay" }
= image_tag( 'liqpay.png' ) = image_tag('liqpay.png')
.radio_item .radio_item
%input#webmoney{ name: "payment_system", type: "radio", value: "webmoney" } %input#interkassa{ name: "payment_system", type: "radio", value: "interkassa", onclick: "interkassa_form();" }
%label{ for: "webmoney" } %label{ for: "interkassa" }
= image_tag( 'w4p_white.png' ) = image_tag('interkassa.png')
.text-center.modal_btns .text-center.modal_btns
= raw Liqpay.new.cnb_form( { action: "pay", amount: payment.amount, currency: "UAH", description: "Dobrovilna pozhertva", order_id: "#{payment.project_id}_#{SecureRandom.hex}", result_url: "http://localhost:3000/payments/liqpay_payment", server_url: "http://localhost:3000/payments/liqpay_payment", version: "3" } ) #interkassa_form{ style: "display: none;" }
%form#payment{ action: "https://sci.interkassa.com/", enctype: "utf-8", method: "post", name: "payment" }
%input{ name: "ik_co_id", type: "hidden", value: "5dd792771ae1bd13008b4579" }
%input{ name: "ik_pm_no", type: "hidden", value: "ID_#{ payment.project_id }" }
%input{ name: "ik_am", type: "hidden", value: payment.amount }
%input{ name: "ik_cur", type: "hidden", value: "UAH" }
%input{ name: "ik_desc", type: "hidden", value: "Dobrovilna pozhertva(INTERKASSA)" }
%input.btn.btn_primary{ type: "submit", value: (t "pay") }
#liqpay_form
= raw Liqpay.new.cnb_form({ action: "pay", amount: payment.amount, currency: "UAH", description: "Dobrovilna pozhertva (LiqPay)", order_id: "#{payment.project_id}_#{SecureRandom.hex}", result_url: "http://localhost:3000/payments/liqpay_payment", server_url: "http://localhost:3000/payments/liqpay_payment", version: "3" })
.nav_link .nav_link
%a.link{ "data-dismiss" => "modal", "data-target" => "#modal", "data-toggle" => "modal", type: "button" } Назад = link_to "Назад", "#", "data-dismiss" => "modal", "data-target" => "#modal", "data-toggle" => "modal"
= simple_form_for :user, url: users_path, authenticity_token: true do |f| = simple_form_for :user, url: users_path, authenticity_token: true do |f|
#modal3.modal.fade.modal_styled.in{"aria-labelledby" => "modalLabel", :role => "dialog", :tabindex => "-1"} #modal3.modal.fade.modal_styled.in{ "aria-labelledby" => "modalLabel", role: "dialog", tabindex: "-1" }
.modal-dialog{:role => "document"} .modal-dialog{ role: "document" }
.modal-content .modal-content
.modal-header .modal-header
.modal-header_top.clearfix .modal-header_top.clearfix
.modal-header_top_bg .modal-header_top_bg
%button.round_link.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"} %button.round_link.close{ "aria-label" => "Close", "data-dismiss" => "modal", type: "button" }
%i.icon.icon_close %i.icon.icon_close
.modal-header_bot .modal-header_bot
%h3#modalLabel.modal-title Вхід %h3#modalLabel.modal-title Вхід
...@@ -18,19 +18,19 @@ ...@@ -18,19 +18,19 @@
%h4.modal_subtitle %h4.modal_subtitle
Авторизація Авторизація
.form-group .form-group
%label{:for => "id_3"} %label{ for: "id_3" }
%span.asterisk> * %span.asterisk> *
E-mail E-mail
.field_wrap .field_wrap
= f.input :email, class: 'form-control', label: false = f.input :email, class: 'form-control', label: false
.form-group .form-group
%label{:for => "id_2"} %label{ for: "id_2" }
%span.asterisk> * %span.asterisk> *
Ім'я та прізвище Ім'я та прізвище
.field_wrap .field_wrap
= f.input :name, class: 'form-control', label: false = f.input :name, class: 'form-control', label: false
.form-group .form-group
%label{:for => "user_location"} %label{ for: "user_location" }
Населений пункт Населений пункт
.field_wrap .field_wrap
= f.input :location, class: 'form-control', label: "" = f.input :location, class: 'form-control', label: ""
...@@ -38,11 +38,9 @@ ...@@ -38,11 +38,9 @@
%h4.modal_subtitle %h4.modal_subtitle
Швидка реєстрація Швидка реєстрація
.soc_btn_wrap.clearfix .soc_btn_wrap.clearfix
%a.soc_btn.soc_btn_fb{href: "/users/auth/facebook"} = link_to user_facebook_omniauth_authorize_path, class: 'soc_btn soc_btn_fb' do
%i.icon.icon_fb %i.icon.icon_fb
%a.soc_btn.soc_btn_tw{href: "/users/auth/linkedin"} = link_to user_google_oauth2_omniauth_authorize_path, class: 'soc_btn soc_btn_google' do
%i.icon.icon_tw
%a.soc_btn.soc_btn_google{href: "/users/auth/google_oauth2"}
%i.icon.icon_google %i.icon.icon_google
.text-center .text-center
= f.button :submit, "Register Now", class: "btn btn-success btn-lg" = f.button :submit, "Register Now", class: "btn btn-success btn-lg"
......
...@@ -13,20 +13,20 @@ ...@@ -13,20 +13,20 @@
#bs-example-navbar-collapse-1.collapse.navbar-collapse #bs-example-navbar-collapse-1.collapse.navbar-collapse
%ul.nav.navbar-nav %ul.nav.navbar-nav
%li %li
%a{:href => "#"}= t ("header.platfform") = link_to (t "header.platfform"), "#"
%li %li
%a{:href => "#"}= t ("header.grants") = link_to (t "header.grants"), "#"
%li %li
%a{:href => "#"}= t ("header.projects") = link_to (t "header.projects"), "#"
%li %li
%a{:href => "#"}= t ("header.partners") = link_to (t "header.partners"), "#"
%li %li
%a{:href => "#"}= t ("header.digital") = link_to (t "header.digital"), "#"
%li %li
%a{:href => "#"}= t ("header.about_us") = link_to (t "header.about_us"), "#"
%li %li
%a{:href => "#"}= t ("header.news") = link_to (t "header.news"), "#"
%li %li
%a{:href => "#"}= t ("header.reports") = link_to (t "header.reports"), "#"
%li %li
%a{:href => "#"} connectif = link_to "connectif", "#"
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
%li.file_item_wrap %li.file_item_wrap
%a.file_item{:href => "#"} %a.file_item{:href => "#"}
- @project.project_documents.each do |project_document| - @project.project_documents.each do |project_document|
#{project_document.document_name} #{ project_document.document_name }
%span.file_img %span.file_img
= image_tag ("file_pdf_large.png") = image_tag ("file_pdf_large.png")
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
- @project.project_links.each do |project_link| - @project.project_links.each do |project_link|
%ul.list %ul.list
%li %li
#{project_link.title} #{ project_link.title }
= link_to project_link.site = link_to project_link.site
.container .container
.text_container .text_container
- @project.project_videos.each do |project_video| - @project.project_videos.each do |project_video|
#{project_video.short} #{ project_video.short }
= raw project_video.short = raw project_video.short
/ .video_container / .video_container
/ %iframe{:allowfullscreen => "", :frameborder => "0", :height => "", :src => "#{project_video.video_link}", :width => "100%"} / %iframe{:allowfullscreen => "", :frameborder => "0", :height => "", :src => "#{project_video.video_link}", :width => "100%"}
#modal_pay #modal_pay
.wrapper .wrapper
.content .content
.head_block{style: "background: transparent url(#{@project.photo.url}) no-repeat center center;background-size: cover; margin-bottom: 6px;"} .head_block{ style: "background: transparent url(#{ @project.photo.url }) no-repeat center center;background-size: cover; margin-bottom: 6px;" }
.container .container
.info_title .info_title
%span.info_title_text= t "#{@project.types}" %span.info_title_text= t "#{ @project.types }"
%a.info_link #{@project.site} %a.info_link #{ @project.site }
%h2.heading_with_btn %h2.heading_with_btn
%span #{@project.title} %span #{ @project.title }
%a.btn.btn_default{"data-target" => "#modal", "data" => "#{@project.id}", "data-toggle" => "modal", :href => "#"} = link_to "#", class: "btn btn_default", "data-target" => "#modal", "data-toggle" => "modal" do
%i.icon.icon_plus> %i.icon.icon_plus>
= t ('donate') = t ('donate')
.large_progress_wrap .large_progress_wrap
.large_progress_title .large_progress_title
= t "#{@project.status}" = t "#{ @project.status }"
.project_content .project_content
.project_partials .project_partials
- @project.project_partials.order(:position).each do |project_partial| - @project.project_partials.order(:position).each do |project_partial|
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
%ul %ul
%li %li
= render "#{project_partial.title}" = render "#{project_partial.title}"
.support_block{style: "background: transparent url(#{@project.footer_photo.url}) no-repeat center center; padding: 30px 0 20px; background-size: cover;"} .support_block{ style: "background: transparent url(#{ @project.footer_photo.url }) no-repeat center center; padding: 30px 0 20px; background-size: cover;" }
.container .container
%h2.heading_with_btn %h2.heading_with_btn
%span #{@project.title} %span #{@project.title}
%a.btn.btn_default{"data-target" => "#modal", "data-toggle" => "modal", :href => "#"} = link_to "#", class: "btn btn_default", "data-target" => "#modal", "data-toggle" => "modal" do
%i.icon.icon_plus> %i.icon.icon_plus>
підтримати проект = t ('donate')
#simple #simple
.news_wrap .news_wrap
.container.grid_padding_xs .container.grid_padding_xs
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
Новини про проект Новини про проект
.row .row
.col-sm-4 .col-sm-4
%a.news_item{:href => "#"} = link_to "#", class: "news_item" do
%span.news_head %span.news_head
= image_tag('news1.jpg') = image_tag('news1.jpg')
%span.news_details.clearfix %span.news_details.clearfix
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
Грaнти — грошові або інші засоби, що передаються громадянами юридиими також міжнародними організаціями Грaнти — грошові або інші засоби, що передаються громадянами юридиими також міжнародними організаціями
проведення конкретних наукових... проведення конкретних наукових...
.col-sm-4 .col-sm-4
%a.news_item{:href => "#"} = link_to "#", class: "news_item" do
%span.news_head %span.news_head
= image_tag('news2.jpg') = image_tag('news2.jpg')
%span.news_details.clearfix %span.news_details.clearfix
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
%span.news_text %span.news_text
Досліджень, розробки законопроектів, підготовки кадрів та інших цілей на умовах, передбачених грантодавцем. Гранти надаються безкоштовно і без повернення для осіб... Досліджень, розробки законопроектів, підготовки кадрів та інших цілей на умовах, передбачених грантодавцем. Гранти надаються безкоштовно і без повернення для осіб...
.col-sm-4 .col-sm-4
%a.news_item{:href => "#"} = link_to "#", class: "news_item" do
%span.news_head %span.news_head
= image_tag('news3.jpg') = image_tag('news3.jpg')
%span.news_details.clearfix %span.news_details.clearfix
...@@ -71,6 +71,3 @@ ...@@ -71,6 +71,3 @@
У випадку довгого заголовка який не бажано обрізати чи вкорочувати, буде так У випадку довгого заголовка який не бажано обрізати чи вкорочувати, буде так
%span.news_text %span.news_text
Досліджень, розробки законопроектів, підготовки кадрів та інших цілей на умовах, передбачених грантодавцем. Досліджень, розробки законопроектів, підготовки кадрів та інших цілей на умовах, передбачених грантодавцем.
:javascript
new BeerSlider( document.getElementById( "slider" ) );
Gibbon::Request.api_key = "e5f9a6a9edc148b49496c1b972f673b7-us4"
\ No newline at end of file
uk: uk:
pay: "Oplatutu"
activerecord: activerecord:
errors: errors:
models: models:
......
uk:
pay: "Оплатити"
\ No newline at end of file
...@@ -2,7 +2,6 @@ Rails.application.routes.draw do ...@@ -2,7 +2,6 @@ Rails.application.routes.draw do
scope "(:locale)", locale: /en|uk/ do scope "(:locale)", locale: /en|uk/ do
mount Ckeditor::Engine => '/ckeditor' mount Ckeditor::Engine => '/ckeditor'
root 'home#index' root 'home#index'
get "/autocomplete_user", to: "users#autocomplete_user" get "/autocomplete_user", to: "users#autocomplete_user"
put "/admin/projects/:id", to: 'admin/projects#sort' put "/admin/projects/:id", to: 'admin/projects#sort'
ActiveAdmin.routes(self) ActiveAdmin.routes(self)
...@@ -11,6 +10,10 @@ Rails.application.routes.draw do ...@@ -11,6 +10,10 @@ Rails.application.routes.draw do
resources :payments do resources :payments do
collection do collection do
post :liqpay_payment, to: "payments#liqpay_payment", as: :liqpay_payment post :liqpay_payment, to: "payments#liqpay_payment", as: :liqpay_payment
post :interkassa_success, to: "payments#interkassa_success", as: :interkassa_success
post :interkassa_fail, to: "payments#interkassa_fail", as: :interkassa_fail
post :interkassa_pending, to: "payments#interkassa_pending", as: :interkassa_pending
post :interkassa_interaction, to: "payments#interkassa_interaction", as: :interkassa_interaction
end end
end end
end end
......
...@@ -37,6 +37,12 @@ class CreatePayments < ActiveRecord::Migration[5.0] ...@@ -37,6 +37,12 @@ class CreatePayments < ActiveRecord::Migration[5.0]
t.bigint :create_date t.bigint :create_date
t.bigint :end_date t.bigint :end_date
t.integer :transaction_id t.integer :transaction_id
t.string :ik_co_id
t.bigint :ik_co_prs_id
t.string :ik_pm_no
t.float :ik_am
t.float :ik_ps_price
t.string :ik_sign
t.references :user t.references :user
t.references :project t.references :project
t.timestamps t.timestamps
......
...@@ -86,6 +86,12 @@ ActiveRecord::Schema.define(version: 20191119123400) do ...@@ -86,6 +86,12 @@ ActiveRecord::Schema.define(version: 20191119123400) do
t.bigint "create_date" t.bigint "create_date"
t.bigint "end_date" t.bigint "end_date"
t.integer "transaction_id" t.integer "transaction_id"
t.string "ik_co_id"
t.bigint "ik_co_prs_id"
t.string "ik_pm_no"
t.float "ik_am", limit: 24
t.float "ik_ps_price", limit: 24
t.string "ik_sign"
t.integer "user_id" t.integer "user_id"
t.integer "project_id" t.integer "project_id"
t.datetime "created_at", null: false t.datetime "created_at", null: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment