% if folder == "all" %>
<% doAllFolder = true %>
<% title = "Archive" %>
<% else %>
<% doAllFolder = false %>
<% title = "Archive - " + folder.capitalize %>
<% end %>
<%= title %>
<%= erb :headerBoilerplate %>
<%= erb :asidemenu %>
<%= erb :searchTopBar, locals: {folder: folder} %>
<%= erb :searchbar, locals: {folder: folder} %>
<% if folder == "all" %>
<%= erb :index, locals: {folders: ["media", "technology", "news"], searchquery: searchquery} %>
<% else %>
<% if !Dir.exists?(folder) %>
<%= erb :noFolder, locals: {folder: folder} %>
<% else %>
<% if Dir.children("./" + folder).empty? %>
<%= erb :noFile, locals: {file: folder } %>
<% else %>
<%= erb :index, locals: {folders: [folder], searchquery: searchquery} %>
<% end %>
<% end %>
<% end %>
<%# searchquery %>
<%= erb :bottom %>