ount<script src="/js/dropzone-min.js"></script>
<style>
  .dz-default {
    display: none;
  }
  .dz-preview {
    display: none;
  }
  .dz-processing {
    display: none;
  }
  .dz-error {
    display: none;
  }
  .dz-image-preview {
    display: none;
  }
</style>
<div class="header-Outro with-site-image dashboard">
  <div class="row content wide">
    <div class="col col-50 signup-Area">
      <div class="signup-Form">
  	  <fieldset class="content">
        <a href="<%= current_site.uri %>" class="screenshot dashboard" style="background-image:url(<%= current_site.screenshot_url('index.html', '540x405') %>);"></a>
	    </fieldset>
      </div>
    </div>

	<div class="col col-50">
    <h2 class="eps"><%= current_site.title %></h2>
    <p class="site-url">
      <a href="<%= current_site.uri %>" target="_blank"><%= current_site.host %></a>
      <a href="#" id="shareButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'_share', layout: false, locals: {site: current_site} %>'><i class="fa fa-share-alt"></i> <span>Share</span></a>
    </p>
	<ul>
    <% if current_site.site_updated_at %>
      <li>Last updated <strong class="local-date-title" data-timestamp="<%= current_site.site_updated_at.to_i %>"><%= current_site.site_updated_at.ago.downcase %></strong></li>
    <% end %>
    <li>Using <strong><%= current_site.space_percentage_used %>% (<%= current_site.total_space_used.to_space_pretty %>)</strong> of your <strong><%= current_site.maximum_space.to_space_pretty %></strong> storage.
    <br>
    <li>
      Used <%= current_site.monthly_bandwidth_used.to_bytes_pretty %> of bandwidth this month.
      <br>
      <% unless current_site.is_education || current_site.supporter? %>Need more space? <a href="/supporter">Become a Supporter!</a><% end %>
    </li>
	</ul>
	</div>

  </div> <!-- end .row -->
</div> <!-- end .header-Outro -->

<main class="content-Base" role="main">

<div class="content wide">

<% unless current_site.changed_count >= 1 %>
<div class="welcome">
  <!-- <div class="close-button"></div> -->
  <h4>Hello! Welcome to your new site.</h4>
  To get started, click on the <strong>index.html</strong> file below to edit your home page. Once you make changes your website will begin appearing in our <a href="/browse">website gallery</a>. You can add more files (such as images) by dragging them from your computer into the box below. Need help building web sites? Try our <a href="/tutorial/html/">HTML tutorial</a>!
</div>
<% end %>

<div id="alertDialogue" class="alert alert-block alert-success" style="display: none; max-height: 200px; overflow-y: auto;"></div>

<div id="filesDisplay" class="files">
  <%== erb :'dashboard/files' %>
</div>

      <input id="deleteCSRFToken" type="hidden" value="<%= csrf_token %>">

      <div class="modal hide" id="deleteConfirmModal" tabindex="-1" role="dialog" aria-labelledby="deleteConfirmModalLabel" aria-hidden="true">
        <div class="modal-header">
          <button class="close" id="deleteConfirmCloseButton" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
          <h3 id="deleteConfirmModalLabel">Confirm deletion</h3>
        </div>
        <div class="modal-body">
          <p id="deleteSingleMessage">You are about to delete <strong><span id="deleteFileName"></span></strong>. Are you sure?</p>
          <p id="deleteMultipleMessage" style="display: none">You are about to delete <strong><span id="deleteFileCount">0</span> items</strong>. Are you sure?</p>
          <ul id="deleteFileList" class="delete-file-list"></ul>
          <p id="deleteProgressMessage" class="delete-progress-message" style="display: none"><i class="fa fa-spinner fa-spin"></i><span id="deleteProgressText">Deleting selected files...</span></p>
        </div>
        <div class="modal-footer">
          <button class="btn cancel" id="deleteCancelButton" data-dismiss="modal" aria-hidden="true" type="button">Cancel</button>
          <button class="btn-Action btn-danger" id="deleteConfirmButton" type="button" onclick="fileDelete()"><i class="fa fa-trash" title="Delete"></i>Delete</button>
        </div>
      </div>

      <div class="modal hide" id="renameModal" tabindex="-1" role="dialog" aria-labelledby="renameModalLabel" aria-hidden="true">
        <form method="post" action="/site_files/rename">
          <input type="hidden" value="<%= csrf_token %>" name="csrf_token">
          <input type="hidden" value="<%= @dir %>" name="dir">
          <input type="hidden" id="renamePathInput" name="path">

          <div class="modal-header">
            <button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
            <h3 id="renameModalLabel">Rename / Move</h3>
          </div>
          <div class="modal-body">
            <input id="renameNewPathInput" name="new_path" type="text" style="width: 100%">
            <p>Note: We will automatically scrub any characters not matching: a-z A-Z 0-9 _ - .</p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
            <button type="submit" class="btn-Action">Rename</button>
          </div>
        </form>
      </div>


<div class="site-actions" style="margin-bottom:25px">
  <% if !current_site.plan_feature(:no_file_restrictions) %>
    <a href="/site_files/allowed_types">Allowed file types</a> |
  <% end %>
    <% unless is_education? %>
    Thank you for being here!  <% end %>
</div>

</div>
</main>

<form id="uploadFilesButtonForm" method="POST" action="/api/upload" enctype="multipart/form-data" style="display: none" onsubmit="event.preventDefault(); showUploadProgress(); uploadFileFromButton();">
  <input name="csrf_token" type="hidden" value="<%= csrf_token %>">
  <input name="from_button" type="hidden" value="true">
  <input name="dir" type="hidden" id="dir" value="<%= @dir %>">
  <input id="uploadFiles" type="file" name="file" multiple>
</form>

<div class="modal hide" id="createDir" tabindex="-1" role="dialog" aria-labelledby="createDirLabel" aria-hidden="true">
  <form method="post" action="/api/create_directory">
    <input type="hidden" value="<%= csrf_token %>" name="csrf_token">
    <input type="hidden" value="true" name="from_dashboard">
    <input type="hidden" value="<%= @dir %>" name="dir">
    <div class="modal-header">
      <button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
      <h3 id="createDirLabel">Create Folder</h3>
    </div>
    <div class="modal-body">
      <input id="newDirInput" name="name" type="text" placeholder="folder_name">
    </div>
    <div class="modal-footer">
      <button type="button" class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
      <button type="submit" class="btn-Action">Create</button>
    </div>
  </form>
</div>

<div class="modal hide" id="createFile" tabindex="-1" role="dialog" aria-labelledby="createFileLabel" aria-hidden="true">
  <form id="createFileForm" onsubmit="return false;">
    <input type="hidden" value="<%= csrf_token %>" name="csrf_token" id="createFileCSRFToken">
    <input type="hidden" value="<%= @dir %>" name="dir" id="createFileDir">
    <div class="modal-header">
      <button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
      <h3 id="createFileLabel">Create New File</h3>
    </div>
    <div class="modal-body">
      <div id="createFileError" class="alert alert-error" style="display: none; margin-bottom: 15px;"></div>
      <input id="newFileInput" name="filename" type="text" placeholder="newfile.html">
      <p>Note: We will automatically scrub any characters not matching: a-z A-Z 0-9 _ - .</p>
      <p>Allowed file types: html, htm, txt, js, css, md, json, xml, py, and others. Must be an editable file type.</p>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
      <button type="button" class="btn-Action" id="createFileSubmitButton" onclick="handleCreateFile()">Create</button>
    </div>
  </form>
</div>

<script src="/js/dashboard.js"></script>
