1
0
Fork 0

Display table

This commit is contained in:
Alex Kotov 2018-12-12 05:34:30 +05:00
parent 209f81b0c5
commit 18bafe5ec0
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
4 changed files with 38 additions and 1 deletions

View File

@ -5,7 +5,7 @@ class Settings::TelegramContactsController < ApplicationController
def index
authorize %i[settings account_telegram_contact]
@telegram_contacts = policy_scope(
@account_telegram_contacts = policy_scope(
current_account.account_telegram_contacts,
policy_scope_class: Settings::AccountTelegramContactPolicy::Scope,
)

View File

@ -5,6 +5,33 @@
</div>
<div class="col-md-9">
<table class="table">
<thead>
<tr>
<th scope="col">
<%= AccountTelegramContact.human_attribute_name :id %>
</th>
<th scope="col">
<%= TelegramChat.human_attribute_name :remote_id %>
</th>
<th scope="col">
<%= TelegramChat.human_attribute_name :username %>
</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<% @account_telegram_contacts.each do |account_telegram_contact| %>
<tr>
<td scope="row"><%= account_telegram_contact.id %></td>
<td><%= account_telegram_contact.telegram_chat.remote_id %></td>
<td><%= truncate account_telegram_contact.telegram_chat.username, length: 20 %></td>
<td></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>

View File

@ -1,6 +1,9 @@
en:
activerecord:
models:
account_telegram_contact:
one: Telegram contact
other: Telegram contacts
country_state:
one: State
other: States
@ -26,6 +29,8 @@ en:
one: User
other: Users
attributes:
account_telegram_contact:
id: ID
country_state:
id: ID
membership_apps: Membership applications

View File

@ -1,6 +1,9 @@
ru:
activerecord:
models:
account_telegram_contact:
one: Контакт Telegram
other: Контакты Telegram
country_state:
one: Регион
other: Регионы
@ -26,6 +29,8 @@ ru:
one: Пользователь
other: Пользователи
attributes:
account_telegram_contact:
id: ID
country_state:
id: ID
membership_apps: Заявления на вступление