This commit is contained in:
Victoria Wang 2014-09-17 18:46:54 -07:00
commit 9628238d91
10 changed files with 157 additions and 102 deletions

View file

@ -141,7 +141,7 @@ GEM
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
retriable (1.4.1)
rmagick (2.13.2)
rmagick (2.13.3)
safe_yaml (1.0.1)
sass (3.3.8)
screencap (0.1.1)

View file

@ -61,7 +61,9 @@ if ENV['RACK_ENV'] == 'development'
module Worker
module ClassMethods
def perform_async(*args)
Thread.new {
self.new.perform *args
}
end
end
end

View file

@ -22,109 +22,67 @@
</div>
<% end %>
</div>
<!--
<ul class="nav nav-tabs">
<li class="active">
<a href="#">Plan</a>
</li>
<li>
<a href="#">Profile</a>
</li>
<li>
<a href="">Custom Domain</a>
</li>
<li>
<a href="">Password</a>
</li>
<li>
<a href="">Email</a>
</li>
<li>
<a href="">Username</a>
</li>
<li>
<a href="">18+</a>
</li>
</ul>
-->
<h2>Neocities Plan</h2>
<% if current_site.supporter? && !current_site.plan_ended %>
<p class="tiny">You currently have the <strong>Supporter Plan (<%= current_site.maximum_space_in_megabytes %>MB)</strong>. Thank you! We love you.
</p>
<a class="btn-Action" href="/plan">Manage Plan</a>
<% else %>
<p class="tiny">
You currently have the <strong>Free Plan (<%= current_site.maximum_space_in_megabytes %>MB)</strong>.<br>Want to get more space and help Neocities? Become a supporter!
</p>
<a class="btn-Action" href="/plan">Supporter Info</a>
<% end %>
<h2>Site Profile</h2>
<div>
<form method="POST" action="/settings/profile">
<%== csrf_token_input_html %>
<p>
<input name="site[profile_comments_enabled]" type="hidden" value="true">
<input name="site[profile_comments_enabled]" type="checkbox" value="false"
<% if current_site.profile_comments_enabled == false %>checked<% end %>
> Turn off profile comments
</p>
<input class="btn-Action" type="submit" value="Update Site Profile Settings">
</form>
<div class="tabbable" style="margin-top: 20px"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active"><a href="#plan" data-toggle="tab">Plan</a></li>
<li><a href="#profile" data-toggle="tab">Profile</a></li>
<li><a href="#customdomain" data-toggle="tab">Custom Domain</a></li>
<li><a href="#password" data-toggle="tab">Password</a></li>
<li><a href="#email" data-toggle="tab">Email</a></li>
<li><a href="#username" data-toggle="tab">Username</a></li>
<li><a href="#nsfw" data-toggle="tab">18+</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="plan">
<%== erb :'settings/plan' %>
</div>
<div class="tab-pane" id="profile">
<%== erb :'settings/profile' %>
</div>
<div class="tab-pane" id="customdomain">
<%== erb :'settings/custom_domain' %>
</div>
<div class="tab-pane" id="password">
<%== erb :'settings/password' %>
</div>
<div class="tab-pane" id="email">
<%== erb :'settings/email' %>
</div>
<div class="tab-pane" id="username">
<%== erb :'settings/username' %>
</div>
<div class="tab-pane" id="nsfw">
<%== erb :'settings/nsfw' %>
</div>
</div>
</div>
<h2>Custom Domain</h2>
<p>
You can configure a custom domain for your Neocities site! <strong><a href="/custom_domain">Click Here</a></strong> for more information.
</p>
<h2>Change Password</h2>
<form method="POST" action="/change_password">
<%== csrf_token_input_html %>
<p>Current Password:</p>
<input class="input-Area" name="current_password" type="password">
<p>New Password:</p>
<input class="input-Area" name="new_password" type="password">
<p>Confirm New Password:</p>
<input class="input-Area" name="new_password_confirm" type="password">
<input class="btn-Action" type="submit" value="Change Password">
</form>
<h2>Change Email</h2>
<form method="POST" action="/change_email">
<%== csrf_token_input_html %>
<p>Current Email: <strong><%= current_site.email %></strong></p>
<p>New Email:</p>
<input class="input-Area" name="email" type="text">
<div>
<input class="btn-Action" type="submit" value="Change Email">
</div>
</form>
<h2>Change Site (User) Name</h2>
<form method="POST" action="/change_name">
<%== csrf_token_input_html %>
<p class="tiny">
It cannot contain spaces, and can only use the following characters: a-z A-Z 0-9 _ -
</p>
<p>
Current Name:
<span style="color: green"><strong><%= current_site.username %></strong></span>
</p>
<p>
New name:
<input name="name" class="input-Area" type="text" placeholder="newname" style="width: 200px">
</p>
<input class="btn-Action" type="submit" value="Change Name">
</form>
<h2>18+ Content</h2>
<p class="tiny">
If your site contains objectionable (18+) content, check this box. Your site will not be removed, but it will be listed on a special browse page. We don't have an official policy on what defines 18+ content yet, but basically it's just pornography and lewd/sick/gross images. Thanks for your patience and understanding as we try to find a way to balance out the needs of everyone.
</p>
<form method="POST" action="/change_nsfw">
<%== csrf_token_input_html %>
<input name="is_nsfw" type="hidden" value="false">
<p>
<strong>
My page has 18+ content:&nbsp;&nbsp;&nbsp;
<input name="is_nsfw" type="checkbox" value="true" style="margin-top: 0px"
<% if current_site.is_nsfw %>checked<% end %>
>
</strong>
</p>
<input class="btn-Action" type="submit" value="Update">
</form>
<!--
<h2>Delete Site</h2>
<p class="tiny">

View file

@ -0,0 +1,4 @@
<h2>Custom Domain</h2>
<p>
You can configure a custom domain for your Neocities site! <strong><a href="/custom_domain">Click Here</a></strong> for more information.
</p>

12
views/settings/email.erb Normal file
View file

@ -0,0 +1,12 @@
<h2>Change Email</h2>
<form method="POST" action="/change_email">
<%== csrf_token_input_html %>
<p>Current Email: <strong><%= current_site.email %></strong></p>
<p>New Email:</p>
<input class="input-Area" name="email" type="text">
<div>
<input class="btn-Action" type="submit" value="Change Email">
</div>
</form>

20
views/settings/nsfw.erb Normal file
View file

@ -0,0 +1,20 @@
<h2>18+ Content</h2>
<p class="tiny">
If your site contains objectionable (18+) content, check this box. Your site will not be removed, but it will be listed on a special browse page. We don't have an official policy on what defines 18+ content yet, but basically it's just pornography and lewd/sick/gross images. Thanks for your patience and understanding as we try to find a way to balance out the needs of everyone.
</p>
<form method="POST" action="/change_nsfw">
<%== csrf_token_input_html %>
<input name="is_nsfw" type="hidden" value="false">
<p>
<strong>
My page has 18+ content:&nbsp;&nbsp;&nbsp;
<input name="is_nsfw" type="checkbox" value="true" style="margin-top: 0px"
<% if current_site.is_nsfw %>checked<% end %>
>
</strong>
</p>
<input class="btn-Action" type="submit" value="Update">
</form>

View file

@ -0,0 +1,15 @@
<h2>Change Password</h2>
<form method="POST" action="/change_password">
<%== csrf_token_input_html %>
<p>Current Password:</p>
<input class="input-Area" name="current_password" type="password">
<p>New Password:</p>
<input class="input-Area" name="new_password" type="password">
<p>Confirm New Password:</p>
<input class="input-Area" name="new_password_confirm" type="password">
<input class="btn-Action" type="submit" value="Change Password">
</form>

11
views/settings/plan.erb Normal file
View file

@ -0,0 +1,11 @@
<h2>Neocities Plan</h2>
<% if current_site.supporter? && !current_site.plan_ended %>
<p class="tiny">You currently have the <strong>Supporter Plan (<%= current_site.maximum_space_in_megabytes %>MB)</strong>. Thank you! We love you.
</p>
<a class="btn-Action" href="/plan">Manage Plan</a>
<% else %>
<p class="tiny">
You currently have the <strong>Free Plan (<%= current_site.maximum_space_in_megabytes %>MB)</strong>.<br>Want to get more space and help Neocities? Become a supporter!
</p>
<a class="btn-Action" href="/plan">Supporter Info</a>
<% end %>

View file

@ -0,0 +1,14 @@
<h2>Site Profile</h2>
<div>
<form method="POST" action="/settings/profile">
<%== csrf_token_input_html %>
<p>
<input name="site[profile_comments_enabled]" type="hidden" value="true">
<input name="site[profile_comments_enabled]" type="checkbox" value="false"
<% if current_site.profile_comments_enabled == false %>checked<% end %>
> Turn off profile comments
</p>
<input class="btn-Action" type="submit" value="Update Site Profile Settings">
</form>
</div>

View file

@ -0,0 +1,19 @@
<h2>Change Site (User) Name</h2>
<form method="POST" action="/change_name">
<%== csrf_token_input_html %>
<p class="tiny">
It cannot contain spaces, and can only use the following characters: a-z A-Z 0-9 _ -
</p>
<p>
Current Name:
<span style="color: green"><strong><%= current_site.username %></strong></span>
</p>
<p>
New name:
<input name="name" class="input-Area" type="text" placeholder="newname" style="width: 200px">
</p>
<input class="btn-Action" type="submit" value="Change Name">
</form>