Skip to content

Commit

Permalink
Hide emails in production site.
Browse files Browse the repository at this point in the history
  • Loading branch information
fatlotus committed Jan 13, 2016
1 parent 89eee2f commit 8542076
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 73 deletions.
1 change: 1 addition & 0 deletions caravel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CsrfProtect(app)

# Imported for side effects:
import caravel.storage.config
import caravel.controllers.listings
import caravel.controllers.api
import caravel.controllers.moderation
Expand Down
11 changes: 5 additions & 6 deletions caravel/templates/listing_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
{% if form.principal %}
{{ wtf.form_field(form.principal) }}
{% endif %}
<div class="alert alert-warning" role="alert">
BSD/Medicine/Medical School affiliates: if you are unable to sign
in with your CNetID, please enter your email in the box. Your
listing might not be posted immediately. We reserve the right to
remove listings at any time.
</div>
<p class="alert alert-warning" role="alert">
Alumni/BSD/Medicine/Medical School affiliates: if you are unable
to sign in with your CNetID, please enter your email in the box.
Your listing might not be posted immediately. We reserve the right
to remove listings at any time.</p>
{{ wtf.form_field(form.categories) }}
{{ wtf.form_field(form.price) }}
{{ wtf.form_field(form.body) }}
Expand Down
6 changes: 3 additions & 3 deletions caravel/templates/listings/fullpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ <h2>{{ listing.title }}</h2>
<span class="label label-default">{{ category }}</span>
{% endfor %}
</p>
<p>Posted <strong>{{ listing.posted_at|as_duration }}</strong>
by {% if current_user %}
<p>Posted <strong>{{ listing.posted_at|as_duration }}</strong>.
{# by {% if current_user %}
<a href="{{ url_for('search_listings',
q=listing.principal.email) }}">
{{ listing.principal.email }}</a>
{%- else -%}
[address hidden] (<a href="{{ login_url() }}">sign in</a> to view)
{%- endif -%}.
{%- endif -%}. #}
Price: <strong>{{ '${:,.2f}'.format(listing.price) }}</strong>
</p>
{% if is_admin %}
Expand Down
4 changes: 2 additions & 2 deletions caravel/templates/listings/thumbnail.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ <h3>
{% for category in listing.categories %}
<span class="label label-default">{{ category }}</span>
{% endfor %}<br/>
{% if current_user %}
{# }{% if current_user %}
<span class="label label-primary">{{ listing.principal.email }}</span>
{% endif %}
{% endif %} #}
<span class="label label-info">{{
listing.posted_at|as_duration }}</span>
</p>
Expand Down
3 changes: 2 additions & 1 deletion caravel/tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def clean(self, markup):
markup = re.sub(r'Marketplace is.*lists.uchicago.edu\. ', '', markup)
markup = re.sub(r'(^.*UChicago Marketplace)|(&#169;.*$)', '', markup)
markup = re.sub(r'Please .* Update to Marketplace \. ', '', markup)
markup = re.sub(r'tip: .*? listings ', '', markup)
markup = re.sub(r'tip: .*? listings ', '', markup)
markup = re.sub(r'Alumni/BSD.*?any time\. ', '', markup)
return markup.strip()

def extract_photos(self, markup):
Expand Down
Loading

0 comments on commit 8542076

Please sign in to comment.