progress today, clicking and fixing
This commit is contained in:
@@ -9,3 +9,4 @@
|
|||||||
//= link qr_sheet/application.css
|
//= link qr_sheet/application.css
|
||||||
//
|
//
|
||||||
// link user/foundation/application.css
|
// link user/foundation/application.css
|
||||||
|
//= link admin/application.js
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ module Admin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
@svg_element = SvgElement.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@svg_element = SvgElement.new(svg_element_params)
|
||||||
if @svg_element.save
|
if @svg_element.save
|
||||||
redirect_to [:edit, :admin, @svg_element]
|
redirect_to [:edit, :admin, @svg_element]
|
||||||
else
|
else
|
||||||
@@ -18,6 +19,7 @@ module Admin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
@svg_element = SvgElement.find(params[:id])
|
||||||
if @svg_element.update_attributes svg_element_params
|
if @svg_element.update_attributes svg_element_params
|
||||||
redirect_to [:edit, :admin, @svg_element]
|
redirect_to [:edit, :admin, @svg_element]
|
||||||
else
|
else
|
||||||
@@ -26,11 +28,11 @@ module Admin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@svg_element = SvgElement.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@svg_element = SvgElement.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ module Suppliers
|
|||||||
image_type = match[1]
|
image_type = match[1]
|
||||||
decoded_attribute = Base64.decode64 value.sub BASE64_IMAGE_MATCHER, ''
|
decoded_attribute = Base64.decode64 value.sub BASE64_IMAGE_MATCHER, ''
|
||||||
file = Tempfile.new(['image', ".#{image_type}"])
|
file = Tempfile.new(['image', ".#{image_type}"])
|
||||||
tempfiles << file
|
@tempfiles << file
|
||||||
file.binmode
|
file.binmode
|
||||||
file.write decoded_attribute
|
file.write decoded_attribute
|
||||||
authorized_params[attribute] = file
|
authorized_params[attribute] = file
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
# overwrite i18n l, to handle nil values
|
# overwrite i18n l, to handle nil values
|
||||||
def l(*args)
|
def l(*args, **options)
|
||||||
return '' unless args.first
|
return '' unless args.first
|
||||||
super(*args)
|
super(*args, **options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_root_path
|
def user_root_path
|
||||||
|
|||||||
@@ -7,5 +7,19 @@ module Mozo
|
|||||||
lnd = Lnrpc::Client.new(credentials_path: Rails.application.config.lnd_credentials_path, macaroon_path: Rails.application.config.lnd_macaroon_path)
|
lnd = Lnrpc::Client.new(credentials_path: Rails.application.config.lnd_credentials_path, macaroon_path: Rails.application.config.lnd_macaroon_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.get_info
|
||||||
|
begin
|
||||||
|
client.lightning.get_info
|
||||||
|
|
||||||
|
|
||||||
|
rescue StandardError => exception
|
||||||
|
if exception&.message =~ /wallet locked/
|
||||||
|
Rails.logger.fatal 'FATAL: LND wallet locked'
|
||||||
|
#TODO handle wallet locket
|
||||||
|
end
|
||||||
|
raise exception
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- model_class = Order
|
- model_class = Order
|
||||||
div.page-header= title :index, model_class
|
- title :index, model_class
|
||||||
- if @orders.any?
|
- if @orders.any?
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
thead
|
thead
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- model_class = ProductCategory
|
- model_class = ProductCategory
|
||||||
.page-header= title :index, model_class
|
- title :index, model_class
|
||||||
- if @product_categories.any?
|
- if @product_categories.any?
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
thead
|
thead
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- model_class = Product
|
- model_class = Product
|
||||||
.page-header= title :index, model_class
|
- title :index, model_class
|
||||||
- if @products.any?
|
- if @products.any?
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
thead
|
thead
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- model_class = Section
|
- model_class = Section
|
||||||
.page-header= title :index, model_class
|
- title :index, model_class
|
||||||
- if @sections.any?
|
- if @sections.any?
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
thead
|
thead
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
= simple_form_for [:admin, @table], html: {class: 'form-horizontal' } do |f|
|
= form_for [:admin, @table], html: {class: 'form-horizontal' } do |f|
|
||||||
= render 'error_messages', target: @table
|
= render 'error_messages', target: @table
|
||||||
= f.input :number
|
.form-row
|
||||||
.control-group class=(@table.errors[:supplier_id].any? ? 'error' : nil)
|
.form-label= f.label :number
|
||||||
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
|
.form-field= f.number_field :number
|
||||||
.controls
|
.form-row class=(@table.errors[:supplier_id].any? ? 'error' : nil)
|
||||||
= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
|
.form-label= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
|
||||||
.form-actions
|
.form-field= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
|
||||||
|
/.form-actions
|
||||||
= f.submit nil, class: 'btn btn-primary'
|
= f.submit nil, class: 'btn btn-primary'
|
||||||
'
|
'
|
||||||
= link_to t("helpers.links.cancel"), admin_tables_path, class: 'btn'
|
= link_to t("helpers.links.cancel"), admin_tables_path, class: 'btn'
|
||||||
|
/.form-row: .form-actions
|
||||||
|
= f.submit @submit || update_button_text(f.object), class: 'button'
|
||||||
|
= link_to t("helpers.links.cancel"), admin_tables_path, class: 'btn'
|
||||||
|
- content_for :page_links do
|
||||||
|
ul
|
||||||
|
li= f.submit @submit || update_button_text(f.object), class: 'button'
|
||||||
|
li= link_to link_to_index_content(Table), [:admin, Table], class: 'to-index-button'
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
- model_class = Table
|
- model_class = Table
|
||||||
.page-header= title :edit, model_class
|
- title :edit, model_class
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- model_class = Table
|
- model_class = Table
|
||||||
div.page-header= title :index, model_class
|
- title :index, model_class
|
||||||
- if @tables.any?
|
- if @tables.any?
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
thead
|
thead
|
||||||
@@ -20,5 +20,8 @@ div.page-header= title :index, model_class
|
|||||||
= link_to t("helpers.links.destroy"), [:admin, table], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
= link_to t("helpers.links.destroy"), [:admin, table], method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
|
||||||
- else
|
- else
|
||||||
= no_content_given model_class
|
= no_content_given model_class
|
||||||
= link_to t("helpers.links.new"), new_admin_table_path, class: 'btn btn-primary'
|
/= link_to t("helpers.links.new"), new_admin_table_path, class: 'btn btn-primary'
|
||||||
|
|
||||||
|
- content_for :page_links do
|
||||||
|
ul
|
||||||
|
li= link_to link_to_new_content(Table), new_admin_table_path, class: 'record-new-button'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
- model_class = Table
|
- model_class = Table
|
||||||
.page-header
|
- title :edit, model_class
|
||||||
= title :new, model_class
|
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ en:
|
|||||||
link: Sign in
|
link: Sign in
|
||||||
button: Sign in
|
button: Sign in
|
||||||
passwords:
|
passwords:
|
||||||
title: Forgot password
|
title: Recover password
|
||||||
link: Forgot password
|
link: Recover password
|
||||||
button: Send reset
|
button: Send reset
|
||||||
edit:
|
edit:
|
||||||
title: Change your password
|
title: Change your password
|
||||||
|
|||||||
Reference in New Issue
Block a user