Merge branch 'master' of ssh://51.254.143.84:9319/home/git/invoice_keeper
This commit is contained in:
commit
5a8d805460
|
|
@ -20,3 +20,4 @@
|
|||
# Ignore Byebug command history file.
|
||||
.byebug_history
|
||||
Gemfile.lock
|
||||
Gemfile.lock
|
||||
|
|
|
|||
4
Gemfile
4
Gemfile
|
|
@ -2,7 +2,7 @@ source 'http://rubygems.org'
|
|||
|
||||
|
||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
|
||||
gem 'rails', '~> 5.1.4'
|
||||
# Use sqlite3 as the database for Active Record
|
||||
# gem 'sqlite3'
|
||||
gem 'momentjs-rails', '>= 2.9.0'
|
||||
|
|
@ -11,7 +11,7 @@ gem 'devise'
|
|||
|
||||
gem 'mysql2'
|
||||
# Use Puma as the app server
|
||||
gem 'puma', '~> 3.0'
|
||||
gem 'puma', '~> 3.7'
|
||||
# Use SCSS for stylesheets
|
||||
gem 'sass-rails', '~> 5.0'
|
||||
# Use Uglifier as compressor for JavaScript assets
|
||||
|
|
|
|||
16
Gemfile.lock
16
Gemfile.lock
|
|
@ -39,7 +39,10 @@ GEM
|
|||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
arel (7.1.2)
|
||||
bcrypt (3.1.11-x64-mingw32)
|
||||
bcrypt (3.1.11-x86-mingw32)
|
||||
bootstrap3-datetimepicker-rails (4.14.30)
|
||||
momentjs-rails (>= 2.8.1)
|
||||
builder (3.2.2)
|
||||
coffee-rails (4.2.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
|
|
@ -78,9 +81,15 @@ GEM
|
|||
mime-types-data (3.2016.0521)
|
||||
mini_portile2 (2.1.0)
|
||||
minitest (5.9.1)
|
||||
momentjs-rails (2.15.1)
|
||||
railties (>= 3.1)
|
||||
multi_json (1.12.1)
|
||||
mysql2 (0.4.4-x64-mingw32)
|
||||
mysql2 (0.4.4-x86-mingw32)
|
||||
nio4r (1.2.1)
|
||||
nokogiri (1.6.8-x64-mingw32)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
pkg-config (~> 1.1.7)
|
||||
nokogiri (1.6.8-x86-mingw32)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
pkg-config (~> 1.1.7)
|
||||
|
|
@ -152,17 +161,21 @@ GEM
|
|||
websocket-driver (0.6.4)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.2)
|
||||
wicked_pdf (1.1.0)
|
||||
|
||||
PLATFORMS
|
||||
x64-mingw32
|
||||
x86-mingw32
|
||||
|
||||
DEPENDENCIES
|
||||
bootstrap3-datetimepicker-rails (~> 4.14.30)
|
||||
byebug
|
||||
coffee-rails (~> 4.2)
|
||||
coffee-script-source (= 1.8.0)
|
||||
devise
|
||||
jbuilder (~> 2.5)
|
||||
jquery-rails
|
||||
momentjs-rails (>= 2.9.0)
|
||||
mysql2
|
||||
puma (~> 3.0)
|
||||
rails (~> 5.0.0, >= 5.0.0.1)
|
||||
|
|
@ -171,6 +184,7 @@ DEPENDENCIES
|
|||
tzinfo-data
|
||||
uglifier (>= 1.3.0)
|
||||
web-console
|
||||
wicked_pdf
|
||||
|
||||
BUNDLED WITH
|
||||
1.13.1
|
||||
1.13.2
|
||||
|
|
|
|||
|
|
@ -3,19 +3,11 @@ class ApplicationController < ActionController::Base
|
|||
before_action :authenticate_user!
|
||||
before_action :set_locale
|
||||
layout :layout_by_resource
|
||||
after_action :set_headers
|
||||
|
||||
def set_locale
|
||||
I18n.locale = params[:lang] || I18n.default_locale
|
||||
end
|
||||
|
||||
def set_headers
|
||||
headers['Access-Control-Allow-Origin'] = '*'
|
||||
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
|
||||
headers['Access-Control-Request-Method'] = '*'
|
||||
headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def layout_by_resource
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ class InvoicesController < ApplicationController
|
|||
disposition: 'attachment',
|
||||
layout: 'pdf',
|
||||
encoding: 'UTF-8',
|
||||
page_size: 'A4',
|
||||
margin: { top: 8, # default 10 (mm)
|
||||
bottom: 8,
|
||||
left: 8,
|
||||
right: 8 },
|
||||
viewport_size: '1280x1024'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@
|
|||
<table width="100%" class="table table-bordered">
|
||||
<tr><td>Sprzedający:</td></tr>
|
||||
<tr>
|
||||
<td height="100" valign="bottom" class="text-center" style="vertical-align:bottom;"><span style="font-size:14px"><b>Hinz Adrian</b></span><br />Osoba upowazniona do wystawienia faktury VAT</td>
|
||||
<td height="100" valign="bottom" class="text-center" style="vertical-align:bottom;"><span style="font-size:14px"><b>Hinz Adrian</b></span><br />Osoba upoważniona do wystawienia faktury VAT</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -200,7 +200,7 @@
|
|||
<table width="100%" class="table table-bordered">
|
||||
<tr><td>Kupujący:</td></tr>
|
||||
<tr>
|
||||
<td height="100" class="text-center" style="vertical-align:bottom;">Osoba upowazniona do odbioru faktury VAT</td>
|
||||
<td height="100" class="text-center" style="vertical-align:bottom;">Osoba upoważniona do odbioru faktury VAT</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
<head>
|
||||
<title>FireStorm - Faktury</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= wicked_pdf_stylesheet_link_tag "bootstrap.css" -%>
|
||||
<%= wicked_pdf_stylesheet_link_tag "bootstrap-theme.css" -%>
|
||||
<%= wicked_pdf_stylesheet_link_tag "style.css" -%>
|
||||
<meta charset='utf-8' />
|
||||
<%= wicked_pdf_stylesheet_link_tag "bootstrap" -%>
|
||||
<%= wicked_pdf_stylesheet_link_tag "bootstrap-theme" -%>
|
||||
<%= wicked_pdf_stylesheet_link_tag "style" -%>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -13,14 +13,6 @@ module InvoiceKeeper
|
|||
# -- all .rb files in that directory are automatically loaded.
|
||||
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
|
||||
config.i18n.default_locale = :pl
|
||||
config.action_dispatch.default_headers.merge!({'X-Frame-Options' => 'ALLOWALL'})
|
||||
config.middleware.insert_before 0, Rack::Cors do
|
||||
allow do
|
||||
origins '*'
|
||||
resource '*', :headers => :any, :methods => [:get, :post, :options]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
|
||||
config.assets.precompile += %w( .svg .eot .woff .ttf .otf .woff2 )
|
||||
|
|
|
|||
Loading…
Reference in New Issue