<div class="default-padding">
  <%= render partial: "screen_info", locals: { screen: @screen } %>

  <h4 class="center"><%= t '.view_field_settings' %></h4>

  <div class="center">
    <%= link_to t('.preview_screen'), frontend_screen_path(@screen, preview: "true"), class: "btn", data: {'no-turbolink' => true} if can? :update, @screen %>
  </div>
  <br />

  <% unless @screen.template.nil? %>
  <div class="screen-model screens-show">
    <div class="bottom"><span class="brand"><%= t 'concerto' %></span></div>
    <div class="inset" style="background: url(<%= preview_template_path(@screen.template, width: 800, height: 450, format: :png) %>) center center no-repeat; background-size: 100% 100%;">
      <% @screen.template.positions.each do |pos| %>
        <% set_screen_field_data(@screen,field=pos.field) %>
        <a href="#" class="pos dropdown-control dd-fieldinfo" style="top: <%= pos.top * 100 %>%; left: <%= pos.left * 100 %>%; width: <%= (pos.right - pos.left) * 100 %>%; height: <%= (pos.bottom - pos.top) * 100 %>%;" data-title="<%= t('.field', name: field.name) %>" data-field-id="<%= field.id %>">
          &nbsp;
        </a>

        <div id="field-info-content-<%= field.id %>" style="display: none;">
          <br />
          <div class="clearfix">
            <div class="pull-left">
              <h3><%= Subscription.model_name.human(count: @subscriptions.count) %></h3>
            </div>
            <div class="pull-right">
              <% if can? :update, Subscription.new(screen: @screen, field: field) %>
                &nbsp;&nbsp;&nbsp;<%= link_to t('.manage'), screen_field_subscriptions_path(@screen, field), class: "btn btn-info" %>
              <% end %>
            </div>
          </div>
          <% unless @subscriptions.empty? %>
            <p>(<%=raw @subscriptions.collect{ |s| link_to s.feed.name, s.feed }.join(', ')%>)</p>
          <% end %>
          <hr />

          <div class="clearfix">
            <div class="pull-left">
              <h3><%= t '.field_settings', count: @screen.field_configs.size %></h3>
            </div>
            <div class="pull-right">
              <% if can? :update, FieldConfig.new(screen: @screen, field: field) %>
                &nbsp;&nbsp;&nbsp;<%= link_to t('.manage'), screen_field_field_configs_path(@screen, field), class: "btn btn-info" %>
              <% end %>
            </div>
          </div>

          <br />
        </div>

      <% end %>
    </div>
  </div>
  <% end %>
  <br />
</div>
