-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acba007
commit e6dc727
Showing
36 changed files
with
400 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<div class="sm:col-span-2"> | ||
<div class="mt-8 border-t border-gray-200 pt-8"> | ||
<% if status_notes.present? %> | ||
<h2 class="text-sm font-medium text-gray-500 mb-2"><%= t('.status_notes') %></h2> | ||
|
||
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg mt-8"> | ||
<table class="min-w-full divide-y divide-gray-300"> | ||
<thead class="bg-gray-50"> | ||
<tr> | ||
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Status</th> | ||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Note</th> | ||
</tr> | ||
</thead> | ||
<tbody class="divide-y divide-gray-200 bg-white"> | ||
<% status_notes.each do |k, v| %> | ||
<tr> | ||
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6"> | ||
<span class="inline-flex items-center rounded-full bg-indigo-100 px-3 py-0.5 text-sm font-medium text-indigo-800"> | ||
<svg class="-ml-1 mr-1.5 h-2 w-2 text-indigo-400" fill="currentColor" viewBox="0 0 8 8"> | ||
<circle cx="4" cy="4" r="3" /> | ||
</svg> | ||
<%= k %> | ||
</span> | ||
</td> | ||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"><%= v %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
<% else %> | ||
<h2 class="text-sm font-medium text-gray-500 mb-2"><%= t('.statuses') %></h2> | ||
|
||
<div class="prose prose-sm mt-4 text-gray-500"> | ||
<ul role="list" class='flex space-x-3'> | ||
<% statuses.each do |status| %> | ||
<li> | ||
<span class="inline-flex items-center rounded-full bg-indigo-100 px-3 py-0.5 text-sm font-medium text-indigo-800"> | ||
<svg class="-ml-1 mr-1.5 h-2 w-2 text-indigo-400" fill="currentColor" viewBox="0 0 8 8"> | ||
<circle cx="4" cy="4" r="3" /> | ||
</svg> | ||
<%= status %> | ||
</span> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Common | ||
module StatusesInfo | ||
class Component < ViewComponent::Base | ||
|
||
attr_reader :status_notes, :statuses | ||
|
||
def initialize(status_notes:, statuses:, **options) | ||
super | ||
|
||
@statuses = statuses | ||
@status_notes = status_notes | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2"> | ||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.name') %></dt> | ||
<dd class="mt-1 text-sm text-gray-900"><%= @contact.name %></dd> | ||
</div> | ||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.object_code') %></dt> | ||
<% if @contact.code.present? %> | ||
<dd class="mt-1 text-sm text-gray-900"><%= @contact.code %></dd> | ||
<% else %> | ||
<dd class="mt-1 text-sm text-red-500"><%= t('.no_code_need_synchronize') %></dd> | ||
<% end %> | ||
</div> | ||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.identity_code') %></dt> | ||
<dd class="mt-1 text-sm text-gray-900"><%= @contact.ident %></dd> | ||
</div> | ||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.email')%></dt> | ||
<dd class="mt-1 text-sm text-gray-900"><%= @contact.email %></dd> | ||
</div> | ||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.phone')%></dt> | ||
<dd class="mt-1 text-sm text-gray-900"><%= @contact.phone %></dd> | ||
</div> | ||
|
||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.registry_created_at')%></dt> | ||
<dd class="mt-1 text-sm text-gray-900"><%= l(@contact.registry_created_at.to_datetime) %></dd> | ||
</div> | ||
|
||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.registry_updated_at')%></dt> | ||
<dd class="mt-1 text-sm text-gray-900"><%= l(@contact.registry_updated_at.to_datetime) %></dd> | ||
</div> | ||
|
||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.state')%></dt> | ||
<dd class="mt-1"> | ||
<span class="py-1 px-4 rounded-3xl text-white <%= @contact.active? ? 'bg-green-500' : 'bg-gray-500' %>"><%= @contact.state %></span> | ||
</dd> | ||
</div> | ||
|
||
<% if show_address? %> | ||
<div class="sm:col-span-1"> | ||
<dt class="text-sm font-medium text-gray-500"><%= t('.postal_address')%></dt> | ||
<dd class="mt-1 text-sm text-gray-900"><%= @contact.postal_address %></dd> | ||
</div> | ||
<% end %> | ||
|
||
<div class="sm:col-span-2"> | ||
<div class="mt-8 border-t border-gray-200 pt-8"> | ||
<h2 class="text-sm font-medium text-gray-900"><%= t('.statuses') %></h2> | ||
|
||
<% if @contact.statuses.present? %> | ||
<div class="prose prose-sm mt-4 text-gray-500"> | ||
<ul role="list" class='flex space-x-3'> | ||
<% @contact.statuses.each do |status| %> | ||
<li> | ||
<span class="inline-flex items-center rounded-full bg-indigo-100 px-3 py-0.5 text-sm font-medium text-indigo-800"> | ||
<svg class="-ml-1 mr-1.5 h-2 w-2 text-indigo-400" fill="currentColor" viewBox="0 0 8 8"> | ||
<circle cx="4" cy="4" r="3" /> | ||
</svg> | ||
<%= status.join %> | ||
</span> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% else %> | ||
<div class="prose prose-sm mt-4 text-red-500"> | ||
<p><%= t('.no_statuses_need_synchronize') %></p> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</dl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Contacts | ||
module Info | ||
class Component < ViewComponent::Base | ||
include ::Registrars::ContactsHelper | ||
|
||
attr_reader :contact | ||
|
||
def initialize(contact:, **options) | ||
super | ||
|
||
@contact = contact | ||
end | ||
end | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
app/components/form/checkbox_with_description/component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="relative flex items-start"> | ||
<div class="flex h-5 items-center"> | ||
<%= form.check_box attribute, { class: "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500", checked: value }, "true", "false" %> | ||
</div> | ||
<div class="ml-3 text-sm"> | ||
<%= form.label label_name, class: 'font-medium text-gray-700' %> | ||
<p id="comments-description" class="text-gray-500"><%= description %></p> | ||
</div> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
app/components/form/checkbox_with_description/component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Form | ||
module CheckboxWithDescription | ||
class Component < ApplicationViewComponent | ||
attr_reader :form, :attribute, :label_name, :description, :value | ||
|
||
def initialize(form:, attribute:, label_name: nil, description: nil, value: false, **options) | ||
super | ||
|
||
@form = form | ||
@attribute = attribute | ||
@label_name = label_name | ||
@description = description | ||
@value = value | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Registrars | ||
module ContactsHelper | ||
def show_address? | ||
Setting.show_address_customer | ||
end | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
app/javascript/controllers/filter/clear_form_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// app/javascript/controllers/debounce_controller.js | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ["form"] | ||
|
||
clearForm() { | ||
this.formTarget.reset(); | ||
this.formTarget.requestSubmit(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.