mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
invoice downloading, cleanup settings tabs
This commit is contained in:
parent
075332d9da
commit
08ac0510a6
5 changed files with 96 additions and 5 deletions
|
@ -15,6 +15,13 @@ def require_ownership_for_settings
|
|||
end
|
||||
end
|
||||
|
||||
get '/settings/invoices/?' do
|
||||
require_login
|
||||
@title = 'Invoices'
|
||||
@invoices = current_site.stripe_customer_id ? Stripe::Invoice.list(customer: current_site.stripe_customer_id) : []
|
||||
erb :'settings/invoices'
|
||||
end
|
||||
|
||||
get '/settings/:username/?' do |username|
|
||||
# This is for the email_unsubscribe below
|
||||
pass if Site.select(:id).where(username: username).first.nil?
|
||||
|
|
|
@ -261,6 +261,21 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" href="#cinvoices">
|
||||
Where can I find invoices for supporter membership?
|
||||
</a>
|
||||
</div>
|
||||
<div id="cinvoices" class="accordion-body collapse">
|
||||
<div class="accordion-inner">
|
||||
<p>
|
||||
Invoices are available for download as PDF files <a href="/settings/invoices">here</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" href="#celeven">
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
<div class="tabbable" style="margin-top: 20px"> <!-- Only required for left/right tabs -->
|
||||
<ul class="nav nav-tabs">
|
||||
|
||||
<li class="active"><a href="#sites" data-toggle="tab">Manage Sites</a></li>
|
||||
<li><a href="#supporter" data-toggle="tab">Supporter Info</a></li>
|
||||
<li><a href="#password" data-toggle="tab">Change Password</a></li>
|
||||
<li><a href="#email" data-toggle="tab">Change Email</a></li>
|
||||
<li class="active"><a href="#sites" data-toggle="tab">Sites</a></li>
|
||||
<li><a href="#supporter" data-toggle="tab">Supporter</a></li>
|
||||
<li><a href="#password" data-toggle="tab">Password</a></li>
|
||||
<li><a href="#email" data-toggle="tab">Email</a></li>
|
||||
<% if current_site.stripe_paying_supporter? %>
|
||||
<li><a href="#billing" data-toggle="tab">Change Card</a></li>
|
||||
<% end %>
|
||||
|
|
|
@ -11,7 +11,11 @@
|
|||
<p class="tiny">
|
||||
You currently have the <strong>Free Plan (<%= current_site.maximum_space.to_space_pretty %>)</strong>.<br>Want to get more space and help Neocities? Become a supporter!
|
||||
</p>
|
||||
<a class="btn-Action" href="/supporter">Supporter Info</a>
|
||||
<a href="/supporter">Supporter Info</a>
|
||||
<% if current_site.stripe_customer_id || current_site.paypal_profile_id %>
|
||||
<br>
|
||||
<a href="/settings/invoices">Generated Invoices</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="modal hide fade" id="endSupporterConfirm" tabindex="-1" role="dialog" aria-labelledby="endSupporterConfirmLabel" aria-hidden="true">
|
||||
|
|
65
views/settings/invoices.erb
Normal file
65
views/settings/invoices.erb
Normal file
|
@ -0,0 +1,65 @@
|
|||
<div class="header-Outro">
|
||||
<div class="row content single-Col">
|
||||
<h1>Account Settings</h1>
|
||||
<h3 class="subtitle">Manage the account for your sites</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content single-Col misc-page txt-Center">
|
||||
<article>
|
||||
<section>
|
||||
<div class="txt-Center">
|
||||
<% if flash[:success] %>
|
||||
<div class="alert alert-block alert-success" style="margin-top: 20px">
|
||||
<%== flash[:success] %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if flash[:error] %>
|
||||
<div class="alert alert-block alert-error" style="margin-top: 20px">
|
||||
<%== flash[:error] %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h2>Generated Invoices</h2>
|
||||
|
||||
<% if @invoices.empty? && !current_site.paypal_profile_id %>
|
||||
<p>No generated invoices.</p>
|
||||
<% else %>
|
||||
<p>
|
||||
<% @invoices.each do |invoice| %>
|
||||
<%= Time.at(invoice.date).strftime('%m/%d/%y') %> - <a href="<%= invoice.invoice_pdf %>">PDF</a><br>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if current_site.paypal_profile_id %>
|
||||
<p>PayPal invoices are available on their <a href="https://paypal.com">web site</a>.</p>
|
||||
<% end %>
|
||||
|
||||
<p><a href="/settings">Back</a></p>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="modal hide fade" id="deleteSite" tabindex="-1" role="dialog" aria-labelledby="deleteSiteLabel" aria-hidden="true">
|
||||
<form method="POST" action="/site/delete">
|
||||
<%== csrf_token_input_html %>
|
||||
<div class="modal-header">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
|
||||
<h3 id="deleteSiteLabel">Permanently Delete Site</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<strong style="color: red">WARNING: This will permanently delete your web site and Neocities account. There is no undo!</strong>
|
||||
|
||||
<p>Delete Site Name: <strong><%= current_site.username %></strong></p>
|
||||
<p>Confirm your site name by typing it here:</p>
|
||||
<input class="input-Area" name="username" type="text">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||
<button type="submit" class="btn-Action">Permanently Delete Site</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
Loading…
Add table
Reference in a new issue