<% page_title t('titles.organisation'), t('titles.servers'), @server.cn %>

<%= render :partial => 'shared/main_information', :locals => { :device => @server} %>

<%= render :partial => 'shared/linux_device_information', :locals => { :device => @server} %>

<%= render :partial => 'devices/hwinfo', :locals => { :rawInfo => @server.puavoDeviceHWInfo } %>

<%= start_box t('.automounts'), extraClass="fullWidth" %>
  <% if Array(@server.puavoExport).empty? %>
  <p class="empty"><%= t('.no_automounts') %></p>
  <% else %>
  <table>
    <tr>
      <th><%= t("activeldap.attributes.#{@server.class.to_s.downcase}.puavoExport") %></th>
      <td><%= safe_join(Array(@server.puavoExport), "<br>".html_safe)  %></td>
    </tr>
  </table>
  <% end %>
<%= end_box %>

<% unless Array(@server.puavoSchool).empty? %>
<%= start_box t('servers.school_limit.title'), extraClass="fullWidth" %>
  <ul id="serverSchoolLimitBox">
    <% @server.forced_schools.each do |school| %>
      <li><%= link_to school.displayName, school_path(school)  %></li>
    <% end %>
  </ul>
<%= end_box %>
<% end %>

<% content_for :page_tools do %>
<%=
toolbar do |tb|
  tb.link t('link.edit'),
          href: edit_server_path(@server),
          icon: 'pencil'

  if @server.hostCertificates
    tb.link t('link.set_install_mode'),
            href: revoke_certificate_server_path(@server),
            confirm: t('general_confirm'),
            method: 'delete',
            danger: true,
            icon: 'cancel'
  end
end %>
<% end %>

<script>
const ALL_PUAVOCONF = <%= raw JSON.pretty_generate(@full_puavoconf) %>;
</script>

<% content_for :javascript do %>
<%= render partial: 'shared/copy_text', formats: [:js] %>
<%= render partial: 'shared/copy_basic_info', formats: [:js], locals: { device: @server } %>
<%= render partial: 'shared/puavoconf_table', formats: [:js], locals: { select: 'div.basicInfo select#changeVisibleConfig', container: 'div.basicInfo div#puavoConfOutput', type: 'dev' } %>
<% end %>
