Friday, September 20, 2024 3:01:21 AM
> settings

Customize


Authenticate

> id_lookup.html.erb
<div class="id-lookup">
  <h2>Community / Server ID Lookup</h2>
  <div class="uk-margin">
    <p>
      Looking for a community or server but don't know their ID? Try searching for a Discord's server name, Discord's server ID, an Arma 3 server name, or an Arma 3 server IP address.
    </p>

    <p class="uk-form-label uk-margin-remove-bottom">
      Search for:
    </p>

    <%= form_with url: id_lookup_tools_path, class: "uk-grid", method: :get do |f| %>
      <div class="uk-width-2-3">
        <%= f.text_field :q, value: params[:q], class: "uk-input" %>
      </div>
      <div class="uk-width-1-3">
        <%= f.submit "Search", class: "uk-button uk-button-primary" %>
      </div>
    <% end %>

    <% if local_assigns[:communities] %>
      <h3>Communities</h3>
      <table class="uk-table uk-table-striped">
        <thead>
          <th class="uk-width-1-4">Community ID</th>
          <th>Name</th>
        </thead>
        <tbody>
          <% if communities.size == 0 && related_communities.size == 0 %>
            <tr>
              <td colspan=2>No communities found</td>
            </tr>
          <% end %>

          <% communities.each do |community| %>
            <tr>
              <td><%= community.community_id %></td>
              <td><%= community.community_name %></td>
            </tr>
          <% end %>

          <% related_communities.each do |community| %>
            <tr class="uk-text-muted">
              <td><%= community.community_id %></td>
              <td><%= community.community_name %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    <% end %>

    <% if local_assigns[:servers] %>
      <h3>Servers</h3>
      <table class="uk-table uk-table-striped">
        <thead>
          <th class="uk-width-1-4">Server ID</th>
          <th>Name</th>
          <th>IP Address</th>
        </thead>
        <tbody>
          <% if servers.size == 0 && related_servers.size == 0 %>
            <tr>
              <td colspan=3>No servers found</td>
            </tr>
          <% end %>

          <% servers.each do |server| %>
            <tr>
              <td><%= server.server_id %></td>
              <td><%= server.server_name %></td>
              <td><%= server.server_ip %></td>
            </tr>
          <% end %>

          <% related_servers.each do |server| %>
            <tr class="uk-text-muted">
              <td><%= server.server_id %></td>
              <td><%= server.server_name %></td>
              <td><%= server.server_ip %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    <% end %>
  </div>
</div>
All opinions represented herein are my own
- © 2024 itsthedevman
- build 340fbb8