progress today, clicking and fixing
This commit is contained in:
@@ -9,3 +9,4 @@
|
||||
//= link qr_sheet/application.css
|
||||
//
|
||||
// link user/foundation/application.css
|
||||
//= link admin/application.js
|
||||
|
||||
@@ -6,10 +6,11 @@ module Admin
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@svg_element = SvgElement.new
|
||||
end
|
||||
|
||||
def create
|
||||
@svg_element = SvgElement.new(svg_element_params)
|
||||
if @svg_element.save
|
||||
redirect_to [:edit, :admin, @svg_element]
|
||||
else
|
||||
@@ -18,6 +19,7 @@ module Admin
|
||||
end
|
||||
|
||||
def update
|
||||
@svg_element = SvgElement.find(params[:id])
|
||||
if @svg_element.update_attributes svg_element_params
|
||||
redirect_to [:edit, :admin, @svg_element]
|
||||
else
|
||||
@@ -26,11 +28,11 @@ module Admin
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@svg_element = SvgElement.find(params[:id])
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
@svg_element = SvgElement.find(params[:id])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -114,7 +114,7 @@ module Suppliers
|
||||
image_type = match[1]
|
||||
decoded_attribute = Base64.decode64 value.sub BASE64_IMAGE_MATCHER, ''
|
||||
file = Tempfile.new(['image', ".#{image_type}"])
|
||||
tempfiles << file
|
||||
@tempfiles << file
|
||||
file.binmode
|
||||
file.write decoded_attribute
|
||||
authorized_params[attribute] = file
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module ApplicationHelper
|
||||
# overwrite i18n l, to handle nil values
|
||||
def l(*args)
|
||||
def l(*args, **options)
|
||||
return '' unless args.first
|
||||
super(*args)
|
||||
super(*args, **options)
|
||||
end
|
||||
|
||||
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)
|
||||
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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- model_class = Order
|
||||
div.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @orders.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- model_class = ProductCategory
|
||||
.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @product_categories.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- model_class = Product
|
||||
.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @products.any?
|
||||
table.table.table-striped
|
||||
thead
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- model_class = Section
|
||||
.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @sections.any?
|
||||
table.table.table-striped
|
||||
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
|
||||
= f.input :number
|
||||
.control-group class=(@table.errors[:supplier_id].any? ? 'error' : nil)
|
||||
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
|
||||
.controls
|
||||
= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
|
||||
.form-actions
|
||||
.form-row
|
||||
.form-label= f.label :number
|
||||
.form-field= f.number_field :number
|
||||
.form-row class=(@table.errors[:supplier_id].any? ? 'error' : nil)
|
||||
.form-label= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
|
||||
.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'
|
||||
'
|
||||
= 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
|
||||
.page-header= title :edit, model_class
|
||||
= render 'form'
|
||||
- title :edit, model_class
|
||||
= render 'form'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- model_class = Table
|
||||
div.page-header= title :index, model_class
|
||||
- title :index, model_class
|
||||
- if @tables.any?
|
||||
table.table.table-striped
|
||||
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'
|
||||
- else
|
||||
= 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
|
||||
.page-header
|
||||
= title :new, model_class
|
||||
- title :edit, model_class
|
||||
= render 'form'
|
||||
|
||||
@@ -6,8 +6,8 @@ en:
|
||||
link: Sign in
|
||||
button: Sign in
|
||||
passwords:
|
||||
title: Forgot password
|
||||
link: Forgot password
|
||||
title: Recover password
|
||||
link: Recover password
|
||||
button: Send reset
|
||||
edit:
|
||||
title: Change your password
|
||||
|
||||
Reference in New Issue
Block a user