Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sibb committed Mar 30, 2019
2 parents 8d3afae + 336e3e4 commit 6aa1ed3
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 30 deletions.
42 changes: 26 additions & 16 deletions .github/CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,56 @@ Just have a quick question? Please e-mail us at at [email protected]

## How can I contribute

### Report bugs :bug:
### Report bugs

Think you found a bug? Please check [the list of open issues](https://github.com/code4romania/redirectioneaza/issues) to see if your bug has already been reported. If it hasn't please [submit a new issue](https://github.com/code4romania/redirectioneaza/issues/new). Please be as specific as possible when describing the issue, include the steps to reproduce it, screenshots or any other relevant info.
:bug: Think you found a bug? Please check [the list of open issues](https://github.com/code4romania/redirectioneaza/issues) to see if your bug has already been reported. If it hasn't please [submit a new issue](https://github.com/code4romania/redirectioneaza/issues/new).

**If you find a security vulnerability, do not open an issue. Please email [email protected] instead.**
:shield: If you find a **security vulnerability**, do not open an issue. Please email [email protected] instead.

### Suggest new features :bulb:
Please be as specific as possible when describing the issue. Explain the problem and include additional details to help maintainers reproduce the problem:

Feature requests are welcome. We would love to hear your thoughts on how we can improve our project further.
* **Description**
* **Steps to Reproduce**
* Expected behavior
* Actual behavior
* Reproduces how often

To send us a suggestion, just [open an issue](https://github.com/code4romania/redirectioneaza/issues/new) which describes the feature you would like to see. Just make sure to provide as much detail and context as possible.
### Suggest new features

### Contribute to the codebase :computer:
:bulb: Feature requests are welcome. We would love to hear your thoughts on how we can improve our project further.

We'd love for you to get your hands dirty and code for the project.
To send us a suggestion, just [open an issue](https://github.com/code4romania/redirectioneaza/issues/new) which describes the feature you would like to see. Give as much information as you can about what you would like to see:

For more info on how to set it up and get started, please see the [README](https://github.com/code4romania/redirectioneaza/blob/master/README.md).
* Description
* Step by step behaviour
* Explain why this enhancement would be useful

If you are unsure where to begin contributing to the project, you can start by looking through these issues:
### Contribute to the codebase

:computer: We'd love for you to get your hands dirty and code for the project.

[![GitHub issues by-label](https://img.shields.io/github/issues/badges/shields/good-first-issue.svg?style=for-the-badge)](https://github.com/code4romania/redirectioneaza/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) [![GitHub issues by-label](https://img.shields.io/github/issues/badges/shields/help-wanted.svg?style=for-the-badge)](https://github.com/code4romania/redirectioneaza/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
If you are unsure where to begin contributing to the project, you can start by looking through these issues:
* [Good first issues](https://github.com/code4romania/redirectioneaza/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
* [Help wanted](https://github.com/code4romania/redirectioneaza/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)

Please make sure to check out the suggested coding [best practices](#best-practices) and tips with working with git below :wink:

## Best practices

### Coding best practices :ok_hand:

* Codebase language is English.
* Use clean code conventions :heavy_check_mark: *tip: read [The book](https://www.goodreads.com/book/show/3735293-clean-code) if you haven't already. Or at least check out [a summary](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29)*
* **The language we code in is English.** Please name your variables, methods, classes and other structures using English words.
* Use clean code conventions :heavy_check_mark: *tip: read [The book](https://www.goodreads.com/book/show/3735293-clean-code) if you haven't already. Or check out [a summary](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29)*
* Follow the [Python styleguide](https://www.python.org/dev/peps/pep-0008/)
* Tests are appreciated :relieved:
* Please use relevant commit messages and reference issues in the commit message if applicable

### Git workflow

* [Fork the repo](https://github.com/code4romania/redirectioneaza/fork)
* Add your contributions on the develop branch of your fork
* Rebase on upstream develop if it changed
* Create a new Pull Request, clearly mentioning what issues does your pull request fix
* Add your contributions on the `develop` branch of your fork
* Rebase on upstream `develop` if it changed
* Create a new Pull Request, clearly mentioning what issues your pull request fixes

If you need tips on working with Git, Github or contributing to open source projects, we have gathered a list of useful guides and tutorials in our knowledge base. [Have a look](https://code4romania.github.io/knowledge/#contributing-to-open-source). :wink:

Expand Down
3 changes: 3 additions & 0 deletions controllers/ngo.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ def get_post_value(arg, add_to_error_list=True):
# if he would like the ngo to see the donation
donor_dict['anonymous'] = post.get('anonim') != 'on'

donor_dict['income'] = post.get('income', 'wage')

# the ngo data
ngo_data = {
"name": self.ngo.name,
Expand Down Expand Up @@ -233,6 +235,7 @@ def get_post_value(arg, add_to_error_list=True):
email = donor_dict['email'],
tel = donor_dict['tel'],
anonymous = donor_dict['anonymous'],
income = donor_dict['income'],
# make a request to get geo ip data for this user
geoip = self.get_geoip_data(),
ngo = self.ngo.key,
Expand Down
8 changes: 7 additions & 1 deletion models/create_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ def add_donor_data(c, person):

# first x mark
# Venituri din salarii si asimilate salariilor
c.drawString(171, donor_block_x - 145, "x")
# pension
if person['income'] == 'pension':
c.drawString(172, donor_block_x - 162, "x")
# wage
else:
c.drawString(172, donor_block_x - 145, "x")


def add_ngo_data(c, ong):
start_ong_x = 462
Expand Down
3 changes: 3 additions & 0 deletions models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class Donor(BaseEntity):

anonymous = ndb.BooleanProperty(indexed=True, default=True)

# type of income: wage or pension
income = ndb.StringProperty(indexed=False, default='wage') # choices=['wage', 'pension']

geoip = ndb.TextProperty()

ngo = ndb.KeyProperty(indexed=True, kind="NgoEntity")
Expand Down
8 changes: 3 additions & 5 deletions static/css/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@checkbox-border-radius: 2px;



.form-control {
// remove bootstrap's box shadow
&:focus {
Expand All @@ -18,7 +17,6 @@
}



/*
* Checkbox styling
*
Expand Down Expand Up @@ -88,12 +86,12 @@
height: 18px;
border-radius: 50%;

top: -2px;
left: -2px;
top: -3px;
left: -3px;

border: 2px solid #fff;

.scale(0.8);

}
}
}
4 changes: 1 addition & 3 deletions static/css/main.css

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions static/css/twopercent.less
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@
.agree-label {
font-weight: normal;
}

.type-of-income {
legend {
margin-bottom: 0;
}

.income-explanation {
.text-muted;
margin-bottom: 22px;
}
}

.checkbox-container {
margin-top: 40px;
}
}

// the submit button
Expand Down
34 changes: 29 additions & 5 deletions views/twopercent.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<div class="row">
<div class="col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2">
<h2 id="donation-page-title">Redirecționează în 3 pași simpli</h2>
<h4 class="donation-page-subtitle">1. Completează și descarcă formularul</h4>
<h3 class="donation-page-subtitle">1. Completează și descarcă formularul</h3>
{% if ngo.account and ngo.cif %}
<form id="twopercent" class="form form-horizontal" action="{{ ngo.key.id() }}/doilasuta" role="form" method="post">

Expand All @@ -74,26 +74,26 @@ <h4 class="donation-page-subtitle">1. Completează și descarcă formularul</h4>
</div>
<div class="form-group">
<div class="col-xs-12">
<input type="number" class="form-control text-center" id="cnp" value="{{ cnp }}" name="cnp" placeholder="CNP (optional)" x-moz-errormessage="Introdu un CNP valid" />
<input type="number" class="form-control text-center" id="cnp" value="{{ cnp }}" name="cnp" placeholder="CNP (opțional online)" x-moz-errormessage="Introdu un CNP valid" />
</div>
</div>
<div class="form-group">
<div class="col-xs-6">
<input id="email" class="form-control" name="email" type="email" value="{{ email }}" placeholder="Email" autocomplete="email" x-moz-errormessage="Te rugam sa introduci o adresa de email valida" required />
</div>
<div class="col-xs-6">
<input id="telefon" class="form-control" name="tel" type="tel" value="{{ tel }}" placeholder="Telefon mobil (optional)" autocomplete="tel" x-moz-errormessage="Te rugam sa introduci un numar de telefon valid" />
<input id="telefon" class="form-control" name="tel" type="tel" value="{{ tel }}" placeholder="Telefon mobil (opțional)" autocomplete="tel" x-moz-errormessage="Te rugăm să introduci un număr de telefon valid" />
</div>
</div>
</fieldset>

<fieldset class="margin-bottom">
<legend>Adresa de domiciliu</legend>
<div class="form-group">
<div class="col-xs-8">
<div class="col-xs-9">
<input type="text" class="form-control text-capitalize" id="strada" value="{{ strada }}" name="strada" placeholder="Strada" x-moz-errormessage="Strada este obligatorie" maxlength="70" required />
</div>
<div class="col-xs-4">
<div class="col-xs-3">
<input type="text" class="form-control" id="numar" value="{{ numar }}" name="numar" placeholder="Numar" x-moz-errormessage="Numarul este obligatoriu" maxlength="6" required />
</div>
</div>
Expand Down Expand Up @@ -122,6 +122,30 @@ <h4 class="donation-page-subtitle">1. Completează și descarcă formularul</h4>
</div>
</div>
</fieldset>
<fieldset class="margin-bottom">
<div class="form-group type-of-income">
<div class="col-xs-12">
<legend>
Tip de venit <br>
</legend>
<p class="income-explanation">
Pentru ce tip de venit vrei să redirecționezi către acest ONG?
</p>
</div>
<div class="col-xs-12">
<label for="income-wage">
<input id="income-wage" type="radio" name="income" value="wage" checked>
Salariu
</label>
</div>
<div class="col-xs-12">
<label for="income-pension">
<input id="income-pension" type="radio" name="income" value="pension">
Pensie
</label>
</div>
</div>
</fieldset>
<fieldset>
<div class="form-group">
<div class="col-xs-12 col-lg-10 checkbox">
Expand Down

0 comments on commit 6aa1ed3

Please sign in to comment.