From 2efd219d9a536e15314dffbcc27145963be8925b Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sat, 12 Apr 2014 23:39:35 -0700 Subject: [PATCH] cleaner looking file display on dashboard --- views/dashboard.slim | 67 +++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/views/dashboard.slim b/views/dashboard.slim index 4999b944..37f9e5f9 100644 --- a/views/dashboard.slim +++ b/views/dashboard.slim @@ -1,3 +1,9 @@ +css: + #files a { + color: #D00000; + text-decoration: none; + } + javascript: function confirmFileDelete(name) { $('#deleteFileName').html(name); @@ -14,46 +20,31 @@ javascript: .col.col-60 h1 Your Website - + p These are the files on your site. index.html is the main page, it is the first page loaded when users visit your site. not_found.html is the page users see when they try to access a file on the site that's not there (it is also commonly referred to as the 404 page). - current_site.file_list.each do |file| - - if file.ext == 'html' || file.ext == 'htm' || file.ext == 'txt' || file.ext == 'js' || file.ext == 'css' || file.ext == 'md' - span -    #{file.filename} - - if file.filename == 'index.html' - p.tiny This is your index file! It is the "default file" that loads when you go to #{current_site.username}.neocities.org. In effect, it's your front page. If you want to change your front page, you need to edit (or overwrite) this file, which you should do right now if you just created your site. The default file is always named index.html, and you cannot delete it. - - div style="margin-bottom:30px" - span - i class="icon-globe"    - a href="http://#{current_site.username}.neocities.org/#{file.filename}" target="_blank" View
- span - i class="icon-edit"    - a href="/site_files/text_editor/#{file.filename}" Edit with text editor
- span - i class="icon-edit"    - span Edit with visual editor (coming soon)
- span - i class="icon-edit"    - span: a href="/site_files/download/#{file.filename}" Download
+ hr style="margin: 12px 0px" + .row style="margin-bottom: 0px" id="files" + .col.col-60 + a href="http://#{current_site.username}.neocities.org/#{file.filename}" title="View #{file.filename}" target="_blank" + - if file.ext.match(/jpg|png|bmp|gif/) + i class="icon-picture icon": span style="margin-left: 5px" #{file.filename} + - else + i class="icon-file-alt icon": span style="margin-left: 10px;" #{file.filename} + span style="float: right" + - if file.ext.match(/html|htm|txt|js|css|md/) + a href="/site_files/text_editor/#{file.filename}" : i class="icon-edit" style="margin-right: 10px" title="Edit" + - else + span style="margin-left: 25px" + + a href="/site_files/download/#{file.filename}": i class="icon-download" style="margin-right: 10px" title="Download" + - if file.filename != 'index.html' + a href="#" onclick="confirmFileDelete('#{file.filename}')": i class="icon-trash" style="margin-right: 10px" title="Delete" + - else + span style="margin-left: 22px" + + + - - if file.filename != 'index.html' - span - i class="icon-trash"    - a href="#" onclick="confirmFileDelete('#{file.filename}')" Delete - - else -    #{file.filename} - div style="margin-top: 3px; margin-bottom: 30px" - | To use in an HTML file, paste this text: <img src="/#{file.filename}"> - span - i class="icon-globe"    - a href="http://#{current_site.username}.neocities.org/#{file.filename}" target="_blank" View
- span - i class="icon-edit"    - span: a href="/site_files/download/#{file.filename}" Download
- span - i class="icon-trash"    - a href="#" onclick="confirmFileDelete('#{file.filename}')" Delete - .col.col-40 div.txt-Center.dash-SS