Skip to content

Commit

Permalink
added new settings, fixed broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Oct 2, 2023
1 parent 713a029 commit deb837c
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 20 deletions.
6 changes: 3 additions & 3 deletions app/components/common/footer/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</div>
</h4>
<div class="c-footer__highlight__info">
Paldiski mnt 80, 10617 Tallinn<br>
Registrikood: 90010019
<%= Setting.find_by(code: 'invoice_issuer_address').retrieve %><br>
<%= t('reg_no') %>: <%= Setting.find_by(code: 'invoice_issuer_reg_no').retrieve %>
<br>
</div>
</div>
Expand All @@ -36,7 +36,7 @@
<span><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path
fill="#fff"
d="M11.825 15.772a3.665 3.665 0 0 1-1.82-.484l-.079-.044A24.293 24.293 0 0 1 1.165 6.67l-.408-.68a3.63 3.63 0 0 1 .547-4.44l.812-.812a1.752 1.752 0 0 1 2.476 0l1.79 1.79a1.757 1.757 0 0 1 .288 2.096l-.673 1.195a.132.132 0 0 0 .022.159l3.985 3.985a.134.134 0 0 0 .16.021l1.193-.672a1.758 1.758 0 0 1 2.097.287l1.79 1.792a1.752 1.752 0 0 1 0 2.475l-.848.848a3.63 3.63 0 0 1-2.57 1.059ZM3.355 1.466c-.131 0-.262.05-.36.149l-.813.812a2.39 2.39 0 0 0-.36 2.922l.407.68a23.047 23.047 0 0 0 8.31 8.135l.079.044a2.41 2.41 0 0 0 2.9-.373l.848-.848a.51.51 0 0 0 0-.72l-1.79-1.792a.512.512 0 0 0-.61-.083l-1.193.672a1.38 1.38 0 0 1-1.646-.225L5.14 6.854a1.377 1.377 0 0 1-.225-1.646l.673-1.194a.511.511 0 0 0-.084-.61l-1.79-1.789a.508.508 0 0 0-.36-.149Z"></path></svg><a
href="tel:727 1000">727 1000</a></span>
href="tel:<%= Setting.find_by(code: 'organization_phone').retrieve %>"><%= Setting.find_by(code: 'organization_phone').retrieve %></a></span>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/components/common/header/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="c-toolbar__nav">
<ul class="s-toolbar-nav">
<li>
<a href="#"><%= t('common.open_portal') %>l</a>
<a href="https://internet.ee"><%= t('common.open_portal') %>l</a>
</li>
<li class="is-active" data-controller='navbar--expandable'>
<a>Oksjonikeskkond</a>
Expand All @@ -25,10 +25,10 @@

</li>
<li>
<a href="#"><%= t('common.registrar_portal') %></a>
<a href="https://www.internet.ee/registrar-portal"><%= t('common.registrar_portal') %></a>
</li>
<li>
<a href="#"><%= t('common.registrant_portal') %></a>
<a href="https://registrant.internet.ee"><%= t('common.registrant_portal') %></a>
</li>
<li>
<a href="#">eeIDc-hero</a>
Expand Down
2 changes: 1 addition & 1 deletion app/components/modals/change_offer/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
class: billing_profiles.size == 1 ? "disabled" : "",
data: { action: 'change->autotax-counter#updateTax' } %>
</div>
<a class="c-modal__link c-modal__link--first-col" href="#"><%= t('new_billing_profile') %></a>
<%= link_to t('new_billing_profile'), billing_profiles_path, class: 'c-modal__link c-modal__link--first-col', target: '_top' %>
<% end %>
</div>
<div class="c-modal__footer">
Expand Down
2 changes: 1 addition & 1 deletion app/components/modals/change_offer_po/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
class: billing_profiles.size == 1 ? "disabled" : "",
data: { action: 'change->autotax-counter#updateTax' } %>
</div>
<a class="c-modal__link c-modal__link--first-col" href="#"><%= t(:new_billing_profile) %></a>
<%= link_to t('new_billing_profile'), billing_profiles_path, class: 'c-modal__link c-modal__link--first-col', target: '_top' %>
<% end %>

</div>
Expand Down
8 changes: 4 additions & 4 deletions app/components/modals/pay_invoice/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
</div>
<div class="c-modal__col">
<label class="c-modal__text-title"><%= t('invoices.address') %></label>
<span class="c-modal__text">Paldiski mnt 80, Tallinn, Harjumaa, Estonia</span>
<span class="c-modal__text"><%= Setting.find_by(code: 'invoice_issuer_address').retrieve %></span>
<div class="c-modal__extrainfo u-flex u-align-start u-mt-32">
<div class="c-modal__extrainfo-col">
<label class="c-modal__text-title">Reg. nr</label>
<span class="c-modal__text">90010019</span>
<label class="c-modal__text-title"><%= t('reg_no') %></label>
<span class="c-modal__text"><%= Setting.find_by(code: 'invoice_issuer_reg_no').retrieve %></span>
</div>
<div class="c-modal__extrainfo-col">
<label class="c-modal__text-title">VAT nr</label>
<span class="c-modal__text">EE101286464</span>
<span class="c-modal__text"><%= Setting.find_by(code: 'invoice_issuer_vat_number').retrieve %></span>
</div>
</div>
</div>
Expand Down
6 changes: 0 additions & 6 deletions app/views/auctions/_auction.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,9 @@
<%= button_to offer_path(auction.offer_from_user(user).uuid), method: :delete, form: { data: { turbo_confirm: t(".confirm_delete") } }, class: "c-btn c-btn--ghost c-btn--icon" do %>
<span class="o-delete-icon"></span>
<% end %>

<%# <button class="c-btn c-btn--ghost c-btn--icon js-edit-modal-toggle" title="Edit"><span %>
<%# class="o-edit-icon"></span></button> %>
<%# <button class="c-btn c-btn--ghost c-btn--icon js-modal-delete-toggle" title="Delete"><span %>
<%# class="o-delete-icon"></span></button> %>
</div>
<% else %>
<%= link_to t('auctions.bid'), new_auction_offer_path(auction_uuid: auction.uuid), class: "c-btn c-btn--green js-modal-toggle-po", data: { turbo_frame: 'modal' } %>
<%# <td class="u-text-left u-text-center-l"><a href="#" class="c-btn c-btn--green">Esita pakkumus</a></td> %>
<% end %>

<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<%= t('.identity_document_text')%>
</p>
<div class="c-login__buttons-wrapper u-flex u-content-sp u-content-center">
<a class="c-login__button c-btn c-btn--blue-secondary" href="#" title="Sisene"><%= t(:sign_in) %></a>
<%= button_to t(:sign_in), "/auth/tara", data: { turbo: false }, class: "c-login__button c-btn c-btn--blue-secondary", target: '_top' %>
<div class="c-login__icons u-flex u-content-sp u-content-center">
<%= render partial: 'svg/id_auth' %>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ en:
'no': "No"

close: Close
reg_no: "Registration code"

auctions_name: "Auctions"
billing_profiles_name: "Billing Profiles"
Expand Down
1 change: 1 addition & 0 deletions config/locales/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ et:
'no': "Ei"

close: "Sulge"
reg_no: "Registrikood"

auctions_name: "Oksjonid"
billing_profiles_name: "Arve aadressid"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
class AddInvoiceIssuerSeparateInformations < ActiveRecord::Migration[7.0]
def change
# Default issuer address
invoice_issuer_address_description = <<~TEXT.squish
Default issuer address
TEXT

invoice_issuer_address_value = <<~TEXT.squish
Paldiski mnt 80, Tallinn, Harjumaa, 10617 Estonia,
TEXT

invoice_issuer_address_setting = Setting.new(code: :invoice_issuer_address, value: invoice_issuer_address_value,
description: invoice_issuer_address_description,
value_format: 'string')

invoice_issuer_address_setting.save

# Default issuer reg no
invoice_issuer_reg_no_description = <<~TEXT.squish
Default issuer reg no
TEXT

invoice_issuer_reg_no_value = <<~TEXT.squish
90010019
TEXT

invoice_issuer_reg_no_setting = Setting.new(code: :invoice_issuer_reg_no, value: invoice_issuer_reg_no_value,
description: invoice_issuer_reg_no_description,
value_format: 'string')

invoice_issuer_reg_no_setting.save

# Default issuer vat number
invoice_issuer_vat_no_description = <<~TEXT.squish
Default issuer vat number
TEXT

invoice_issuer_vat_no_value = <<~TEXT.squish
EE101286464
TEXT

invoice_issuer_vat_no_setting = Setting.new(code: :invoice_issuer_vat_number, value: invoice_issuer_vat_no_value,
description: invoice_issuer_vat_no_description,
value_format: 'string')

invoice_issuer_vat_no_setting.save

# Default organization phone
default_organization_phone_description = <<~TEXT.squish
Default organization phone
TEXT
default_organization_phone_value = '+372 727 1000'
default_organization_phone_setting = Setting.new(code: :organization_phone,
value: default_organization_phone_value,
description: default_organization_phone_description,
value_format: 'string')
default_organization_phone_setting.save
end

def down
Setting.where(code: :invoice_issuer_address).delete_all
Setting.where(code: :invoice_issuer_reg_no).delete_all
Setting.where(code: :invoice_issuer_vat_number).delete_all
Setting.where(code: :organization_phone).delete_all
end
end
56 changes: 56 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,51 @@

invoice_issuer_setting.save

# Default issuer address
invoice_issuer_address_description = <<~TEXT.squish
Default issuer address
TEXT

invoice_issuer_address_value = <<~TEXT.squish
Paldiski mnt 80, Tallinn, Harjumaa, 10617 Estonia,
TEXT

invoice_issuer_address_setting = Setting.new(code: :invoice_issuer_address, value: invoice_issuer_address_value,
description: invoice_issuer_address_description,
value_format: 'string')

invoice_issuer_address_setting.save

# Default issuer reg no
invoice_issuer_reg_no_description = <<~TEXT.squish
Default issuer reg no
TEXT

invoice_issuer_reg_no_value = <<~TEXT.squish
90010019
TEXT

invoice_issuer_reg_no_setting = Setting.new(code: :invoice_issuer_reg_no, value: invoice_issuer_reg_no_value,
description: invoice_issuer_reg_no_description,
value_format: 'string')

invoice_issuer_reg_no_setting.save

# Default issuer vat number
invoice_issuer_vat_no_description = <<~TEXT.squish
Default issuer vat number
TEXT

invoice_issuer_vat_no_value = <<~TEXT.squish
EE101286464
TEXT

invoice_issuer_vat_no_setting = Setting.new(code: :invoice_issuer_vat_number, value: invoice_issuer_vat_no_value,
description: invoice_issuer_vat_no_description,
value_format: 'string')

invoice_issuer_vat_no_setting.save

# Default invoice reminder
invoice_reminder_description = <<~TEXT.squish
Number of days before due date on which reminders about unpaid invoices are sent.
Expand Down Expand Up @@ -381,3 +426,14 @@
description: openai_evaluation_prompt_description,
value_format: 'string')
openai_domains_evaluation_prompt_setting.save

# Default organization phone
default_organization_phone_description = <<~TEXT.squish
Default organization phone
TEXT
default_organization_phone_value = '+372 727 1000'
default_organization_phone_setting = Setting.new(code: :organization_phone,
value: default_organization_phone_value,
description: default_organization_phone_description,
value_format: 'string')
default_organization_phone_setting.save
3 changes: 2 additions & 1 deletion db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3125,4 +3125,5 @@ INSERT INTO "schema_migrations" (version) VALUES
('20230607092953'),
('20230705192353'),
('20230925130405'),
('20230721102651');
('20230721102651'),
('20231002090548');

0 comments on commit deb837c

Please sign in to comment.