refactor file logic into models to prepare for API, minor touches.

This commit is contained in:
Kyle Drake 2014-04-04 22:18:36 -07:00
parent 9124ab81be
commit 6a36a9e3ac
No known key found for this signature in database
GPG key ID: 8BE721072E1864BE
9 changed files with 196 additions and 128 deletions

View file

@ -20,8 +20,7 @@ javascript:
span
<i class="icon-file-alt icon-3x"></i>&nbsp;&nbsp; <span style="font-size: 20pt">#{file.filename}</span>
- if file.filename == 'index.html'
p.tiny
This is your index file! It is the "default file" that loads when you go to <a href="http://#{current_site.username}.neocities.org">#{current_site.username}.neocities.org</a>. In effect, it's your front page. If you want to change your front page, you need to edit (or overwrite) this file. The default file is always named <b>index.html</b>.
p.tiny This is your index file! It is the "default file" that loads when you go to <a href="http://#{current_site.username}.neocities.org">#{current_site.username}.neocities.org</a>. 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 <b>index.html</b>, and you cannot delete it.
div style="margin-bottom:30px"
span
@ -36,14 +35,23 @@ javascript:
span
i class="icon-edit" &nbsp;&nbsp;
span: a href="/site_files/download/#{file.filename}" Download <br />
span
i class="icon-trash" &nbsp;&nbsp;
a href="#" onclick="confirmFileDelete('#{file.filename}')" Delete
- if file.filename != 'index.html'
span
i class="icon-trash" &nbsp;&nbsp;
a href="#" onclick="confirmFileDelete('#{file.filename}')" Delete
- else
<i class="icon-picture icon-3x"></i>&nbsp;&nbsp; <span style="font-size: 20pt">#{file.filename}</span>
div style="margin-top: 3px; margin-bottom:10px"
| To use in an HTML file, paste this text: <code class="tiny" style="margin:0">&lt;img src="/#{file.filename}"&gt;</code>
div style="margin-top: 3px; margin-bottom: 30px"
| To use in an HTML file, paste this text: <code class="tiny" style="margin:0">&lt;img src="/#{file.filename}"&gt;</code>
span
i class="icon-globe" &nbsp;&nbsp;
a href="http://#{current_site.username}.neocities.org/#{file.filename}" target="_blank" View <br />
span
i class="icon-edit" &nbsp;&nbsp;
span: a href="/site_files/download/#{file.filename}" Download <br />
span
i class="icon-trash" &nbsp;&nbsp;
a href="#" onclick="confirmFileDelete('#{file.filename}')" Delete
.col.col-40

View file

@ -53,9 +53,7 @@ css:
option value="ace/theme/twilight" Twilight
option value="ace/theme/vibrant_ink" Vibrant Ink
div id="editor" style="width: 100%; height: 600px; position: relative; margin-bottom:25px"
== encoding_fix @file_data
<div id="editor" style="width: 100%; height: 600px; position: relative; margin-bottom:25px">#{{encoding_fix(@file_data)}}</div>
.row
.col.col-33.txt-Center style="margin-bottom:10px"
@ -125,4 +123,5 @@ css:
editor.getSession().setUseWrapMode(true);
editor.setFontSize(14);
editor.setShowPrintMargin(false);
});
});

View file

@ -1,8 +1,8 @@
server {
listen 80;
server_name <%= current_site.domain %> *.<%= current_site.domain %>;
server_name <%= domain %> *.<%= domain %>;
access_log /var/log/nginx/neocities-domains.log neocitiesdomain;
root /home/web/neocities-web/public/sites/<%= current_site.username %>;
root /home/web/neocities-web/public/sites/<%= username %>;
index /index.html;
error_page 404 = @notfound;

View file

@ -3,7 +3,7 @@ html
head
meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
title #{template_site_title @site.username} - Front Page
title #{username}
meta name="description" content=""
meta name="keywords" content=""

View file

@ -3,7 +3,7 @@ html
head
meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
title #{template_site_title @site.username} - Not Found
title #{username} - Page Not Found
link href="//groundfloor.neocities.org/default.css" rel="stylesheet" type="text/css" media="all"