Files
sure/app/views/settings/providers/_sophtron_panel.html.erb
Sophtron Rocky b32e9dbc45 Add Sophtron Provider (#596)
* Add Sophtron Provider

* fix syncer test issue

* fix schema  wrong merge

* sync #588

* sync code for #588

* fixed a view issue

* modified by comment

* modified

* modifed

* modified

* modified

* fixed a schema issue

* use global subtypes

* add some locales

* fix a safe_return_to_path

* fix exposing raw exception messages issue

* fix a merged issue

* update schema.rb

* fix a schema issue

* fix some issue

* Update bank sync controller to reflect beta status

Signed-off-by: Juan José Mata <jjmata@jjmata.com>

* Rename settings section title to 'Sophtron (alpha)'

Signed-off-by: Juan José Mata <jjmata@jjmata.com>

* Consistency in alpha/beta for Sophtron

* Good PR suggestions from CodeRabbit

---------

Signed-off-by: soky srm <sokysrm@gmail.com>
Signed-off-by: Sophtron Rocky <rocky@sophtron.com>
Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
Signed-off-by: Juan José Mata <jjmata@jjmata.com>
Co-authored-by: soky srm <sokysrm@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
Co-authored-by: Juan José Mata <jjmata@jjmata.com>
2026-04-19 11:16:04 +02:00

68 lines
3.6 KiB
Plaintext

<div class="space-y-4">
<div class="prose prose-sm text-secondary">
<p class="text-primary font-medium"><%= t("sophtron_items.sophtron_panel.setup_instructions_title") %></p>
<ol>
<li><%= t("sophtron_items.sophtron_panel.setup_instructions.step_1_html", url: "https://www.sophtron.com") %></li>
<li><%= t("sophtron_items.sophtron_panel.setup_instructions.step_2") %></li>
<li><%= t("sophtron_items.sophtron_panel.setup_instructions.step_3") %></li>
</ol>
<p class="text-primary font-medium"><%= t("sophtron_items.sophtron_panel.field_descriptions_title") %></p>
<ul>
<li><%= t("sophtron_items.sophtron_panel.field_descriptions.user_id_html") %></li>
<li><%= t("sophtron_items.sophtron_panel.field_descriptions.access_key_html") %></li>
<li><%= t("sophtron_items.sophtron_panel.field_descriptions.base_url_html") %></li>
</ul>
</div>
<% error_msg = local_assigns[:error_message] || @error_message %>
<% if error_msg.present? %>
<div class="p-2 rounded-md bg-destructive/10 text-destructive text-sm overflow-hidden">
<p class="line-clamp-3" title="<%= error_msg %>"><%= error_msg %></p>
</div>
<% end %>
<%
# Variables passed from controller
sophtron_item = @sophtron_item || Current.family.sophtron_items.build
is_new_record = @is_new_record || sophtron_item.new_record?
sophtron_items = @sophtron_items
%>
<%= styled_form_with model: sophtron_item,
url: sophtron_item.new_record? ? sophtron_items_path : sophtron_item_path(sophtron_item),
scope: :sophtron_item,
method: sophtron_item.new_record? ? :post : :patch,
data: { turbo: true },
class: "space-y-3" do |form| %>
<%= form.text_field :user_id,
label: t("sophtron_items.sophtron_panel.fields.user_id.label"),
placeholder: is_new_record ? t("sophtron_items.sophtron_panel.fields.user_id.placeholder_new") : t("sophtron_items.sophtron_panel.fields.user_id.placeholder_edit"),
type: :password %>
<%= form.text_field :access_key,
label: t("sophtron_items.sophtron_panel.fields.access_key.label"),
placeholder: is_new_record ? t("sophtron_items.sophtron_panel.fields.access_key.placeholder_new") : t("sophtron_items.sophtron_panel.fields.access_key.placeholder_edit"),
type: :password %>
<%= form.text_field :base_url,
label: t("sophtron_items.sophtron_panel.fields.base_url.label"),
placeholder: t("sophtron_items.sophtron_panel.fields.base_url.placeholder"),
value: sophtron_item.base_url %>
<div class="flex justify-end">
<%= form.submit is_new_record ? t("sophtron_items.sophtron_panel.save") : t("sophtron_items.sophtron_panel.update"),
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-inverse bg-inverse hover:bg-inverse-hover focus:outline-none focus:ring-2 focus:ring-primary transition-colors" %>
</div>
<% end %>
<div class="flex items-center gap-2">
<% if Current.family.sophtron_items.any? %>
<div class="w-2 h-2 bg-success rounded-full"></div>
<p class="text-sm text-secondary"><%= t("sophtron_items.sophtron_panel.status.configured_html", accounts_path: accounts_path) %></p>
<% else %>
<div class="w-2 h-2 bg-muted rounded-full"></div>
<p class="text-sm text-secondary"><%= t("sophtron_items.sophtron_panel.status.not_configured") %></p>
<% end %>
</div>
</div>