Changeset - e0bb98ffe38a
[Not reviewed]
default
0 2 4
Dennis Fink - 11 years ago 2014-02-03 23:47:05
dennis.fink@c3l.lu
added namecoin and litecoin donations
6 files changed with 73 insertions and 1 deletions:
0 comments (0 inline, 0 general)
ennstatus/donate/views.py
Show inline comments
 
from flask import (Blueprint, render_template, request,
 
                   redirect, url_for, current_app)
 

	
 
from ennstatus.donate.forms import DateForm
 
from ennstatus.donate.functions import load_csv, get_choices
 

	
 
donate_page = Blueprint('donate', __name__)
 

	
 

	
 
@donate_page.route('/')
 
def index():
 
    return render_template('donate/index.html')
 

	
 

	
 
@donate_page.route('/wiretransfer')
 
def wiretransfer():
 
    return render_template('donate/wiretransfer.html')
 

	
 

	
 
@donate_page.route('/snailmail')
 
def snailmail():
 
    return render_template('donate/snailmail.html')
 

	
 

	
 
@donate_page.route('/paypal')
 
def paypal():
 
    return render_template('donate/paypal.html')
 

	
 

	
 
@donate_page.route('/bitcoin')
 
def bitcoin():
 
    return render_template('donate/bitcoin.html')
 

	
 

	
 
@donate_page.route('/litecoin')
 
def litecoin():
 
    return render_template('donate/litecoin.html')
 

	
 

	
 
@donate_page.route('/namecoin')
 
def namecoin():
 
    return render_template('donate/namecoin.html')
 

	
 

	
 
@donate_page.route('/flattr')
 
def flattr():
 
    return render_template('donate/flattr.html')
 

	
 

	
 
@donate_page.route('/bpm')
 
def bpm():
 
    return render_template('donate/bpm.html')
 

	
 

	
 
@donate_page.route('/received',
 
                   methods=('GET', 'POST'))
 
def received():
 

	
 
    current_app.logger.info('Handling received')
 
    form = DateForm()
 

	
 
    current_app.logger.debug('Creating choices')
 
    choices = [name for name in get_choices()]
 
    choices.sort()
 
    form.date.choices = [(name, name) for name in choices]
 

	
 
    if not choices:
 
        current_app.logger.warn('No donations found!')
 
        return render_template('donate/received.html',
 
                               form=form, csv_file=None,
 
                               date=None)
 

	
 
    if request.method == 'POST':
 
        current_app.logger.debug('Validating form')
 
        if form.validate_on_submit():
 
            date = form.date.data
 
            return redirect(url_for('donate.received', date=date))
 
    else:
 
        if 'date' in request.args:
 
            date = request.args['date']
 
            if date in choices:
 
                current_app.logger.info('Showing date %s' % date)
 
                form.date.data = date
 
                csv_file = load_csv(date)
 
            else:
 
                current_app.logger.warn('Date %s not found' % date)
 
                return ('Date %s not found!' % date, 500,
 
                        {'Content-Type': 'text/plain'})
 
        else:
 
            current_app.logger.info('Showing last date %s' % choices[-1])
 
            form.date.data = choices[-1]
 
            csv_file = load_csv(choices[-1])
ennstatus/static/images/LiteCoin_Logo.jpg
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
ennstatus/static/images/NameCoin_Logo.png
Show inline comments
 
new file 100644
 
binary diff not shown
Show images
ennstatus/templates/donate/index.html
Show inline comments
 
@@ -15,71 +15,91 @@
 

	
 
    <p>Act <strong>now</strong> supporting a <strong>#FreeInternet</strong> either by
 
    <ul>
 
      <li>becoming an active / support <a href="{{ url_for('static', filename='files/MembershipForm.pdf') }}">member</a></li>
 
      <li>sponsoring bandwidth</li>
 
      <li>traditional donations</li>
 
      <li>or what you might judge as useful for us.</li>
 
    </ul>   
 
    <div class="col-md-4">    
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.wiretransfer') }}"><img src="{{ url_for('static', filename='images/WireTransfer.png') }}" width="135" height="135"></img></a>
 
          <h5>Wire Transfer</h5>
 
          <p>The easiest way.</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.wiretransfer') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>
 
    <div class="col-md-4">
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.snailmail') }}"><img src="{{ url_for('static', filename='images/SnailMail.png') }}" width="135" height="135"></img></a>
 
          <h5>SnailMail</h5>
 
          <p>As anonymous as possible.</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.snailmail') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>
 
    <div class="col-md-4">
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.paypal') }}"><img src="{{ url_for('static', filename='images/PayPal_Logo.png') }}" width="135" height="135"></img></a>
 
          <h5>PayPal</h5>
 
          <p>All major cards accepted.</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.paypal') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>
 
    <!-- Second row of possibilities -->
 
    <div class="col-md-4">
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.bitcoin') }}"><img src="{{ url_for('static', filename='images/BitCoin_Logo.png') }}" width="135" height="135"></img></a>
 
          <h5>BitCoin</h5>
 
          <p>A free alternative method.</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.bitcoin') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>  
 
    </div>
 
    <div class="col-md-4">
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.litecoin') }}"><img src="{{ url_for('static', filename='images/LiteCoin_Logo.jpg') }}" width="135" height="135"></img></a>
 
          <h5>LiteCoin</h5>
 
          <p>Another free alternative method.</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.litecoin') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>
 
    <div class="col-md-4">
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.namecoin') }}"><img src="{{ url_for('static', filename='images/NameCoin_Logo.png') }}" width="135" height="135"></img></a>
 
          <h5>NameCoin</h5>
 
          <p>A third free alternative method.</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.namecoin') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>
 
    <div class="col-md-4">
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.flattr') }}"><img src="{{ url_for('static', filename='images/Flattr_Logo.png') }}" width="135" height="135"></img></a>
 
          <h5>Flattr</h5>
 
          <p>Flattr us!</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.flattr') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>
 
    <div class="col-md-4">
 
      <div class="thumbnail">
 
        <center>
 
          <a href="{{ url_for('donate.bpm') }}"><img src="{{ url_for('static', filename='images/BPM.gif') }}" width="135" height="135"></img></a>
 
          <h5>BPM Points</h5>
 
          <p>For our parcel station!</p>
 
          <a class="btn btn-info" href="{{ url_for('donate.bpm') }}">Take Action Now</a>
 
        </center>
 
      </div>
 
    </div>
 
  </div>
 
{% endblock %}
ennstatus/templates/donate/litecoin.html
Show inline comments
 
new file 100644
 
{% extends "base.html" %}
 

	
 
{% set title = "Donate - Litecoin" %}
 

	
 
{% block content %}
 
  <div class="col-md-4 text-center">
 
    <img src="{{ url_for('static', filename='images/LiteCoin_Logo.jpg') }}" class="img-rounded" alt="Litecoin" width="160"></img>
 
    <h2>Litecoin</h2>
 
  </div>
 
  <div class="col-md-8">
 
    <blockquote>
 
      <p>"<em>This may be the purest form of democracy the world has ever known, and I - for one - am thrilled to be here to watch it unfold.</em>"</p>
 
      <small>Paco Ahlgren</small>
 
    </blockquote>
 

	
 
    <p><strong>Litecoin</strong></p>
 

	
 
    <div class="alert-success"><strong>Litecoin Address</strong></div>
 
    <p>LQdhbm1rMnKJ78hrw8PhdaXw4MsnqGUnXm</p>
 
  </div>
 
{% endblock %}
ennstatus/templates/donate/namecoin.html
Show inline comments
 
new file 100644
 
{% extends "base.html" %}
 

	
 
{% set title = "Donate - Namecoin" %}
 

	
 
{% block content %}
 
  <div class="col-md-4 text-center">
 
    <img src="{{ url_for('static', filename='images/NameCoin_Logo.png') }}" class="img-rounded" alt="Namecoin" width="160"></img>
 
    <h2>Namecoin</h2>
 
  </div>
 
  <div class="col-md-8">
 
    <blockquote>
 
      <p>"<em>This may be the purest form of democracy the world has ever known, and I - for one - am thrilled to be here to watch it unfold.</em>"</p>
 
      <small>Paco Ahlgren</small>
 
    </blockquote>
 

	
 
    <p><strong>Namecoin</strong></p>
 

	
 
    <div class="alert-success"><strong>Namecoin Address</strong></div>
 
    <p>N2wV81m8vEG1yeQV7izPwT4SUUhHi4jo2E</p>
 
  </div>
 
{% endblock %}
0 comments (0 inline, 0 general)