Skip to content

Commit

Permalink
change the concept of a "new" form to a form without submissions.
Browse files Browse the repository at this point in the history
remove old form methods .is_new, .action
  • Loading branch information
fiatjaf committed Mar 29, 2016
1 parent fde8951 commit 66438c2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
8 changes: 0 additions & 8 deletions formspree/forms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ def confirm(cls, nonce):
DB.session.commit()
return form

@property
def action(self):
return url_for('send', email_or_string=self.hashid, _external=True)

@property
def hashid(self):
# A unique identifier for the form that maps to its id,
Expand All @@ -298,10 +294,6 @@ def hashid(self):
self._hashid = HASHIDS_CODEC.encode(self.id)
return self._hashid

@property
def is_new(self):
return not self.host

from sqlalchemy.dialects.postgresql import JSON
from sqlalchemy.ext.mutable import MutableDict

Expand Down
8 changes: 4 additions & 4 deletions formspree/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,12 @@ a.alert-box.success:hover {
word-break: break-word; }
.dashboard table.forms td.n-submissions, .dashboard table.emails td.n-submissions {
min-width: 150px; }
.dashboard table.forms tr.verified span[class^="ion-"], .dashboard table.emails tr.verified span[class^="ion-"] {
color: #2A735B; }
.dashboard table.forms tr.waiting_confirmation span[class^="ion-"], .dashboard table.emails tr.waiting_confirmation span[class^="ion-"] {
color: #D87431; }
.dashboard table.forms tr.new span[class^="ion-"], .dashboard table.emails tr.new span[class^="ion-"] {
color: #ff1708; }
.dashboard table.forms tr.waiting_confirmation span[class^="ion-"], .dashboard table.emails tr.waiting_confirmation span[class^="ion-"] {
color: #D87431; }
.dashboard table.forms tr.verified span[class^="ion-"], .dashboard table.emails tr.verified span[class^="ion-"] {
color: #2A735B; }
.dashboard table.forms tr.new a:not(*:hover), .dashboard table.emails tr.new a:not(*:hover) {
display: block;
border-bottom: 1px dotted;
Expand Down
5 changes: 3 additions & 2 deletions formspree/static/scss/dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@
}
td.n-submissions { min-width: 150px; }

tr.verified span[class^="ion-"] { color: $dark-green }
tr.waiting_confirmation span[class^="ion-"] { color: $warning-orange }
tr.new span[class^="ion-"] { color: $red }
tr.waiting_confirmation span[class^="ion-"] { color: $warning-orange }
tr.verified span[class^="ion-"] { color: $dark-green }

tr.new a:not(*:hover) {
display: block;
border-bottom: 1px dotted;
Expand Down
8 changes: 4 additions & 4 deletions formspree/templates/forms/list-item.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<tr class="{% if form.is_new %}new{% elif form.confirmed %}verified{% elif form.confirm_sent %}waiting_confirmation{% endif %}">
<tr class="{% if form.counter == 0 %}new{% endif %} {% if form.confirmed %}verified{% elif form.confirm_sent %}waiting_confirmation{% endif %}">
<td>
<a href="#form-{{ form.hashid }}" class="no-underline">
{% if form.is_new %}
{% if not form.host %}
<span class="tooltip hint--right" data-hint="New form. Place the code generated here in some page and submit it!"><span class="ion-help"></span></span>
{% elif form.confirmed %}
<span class="tooltip hint--right" data-hint="Form confirmed"><span class="ion-checkmark-round"></span></span>
Expand All @@ -12,7 +12,7 @@
</td>
<td>
<a href="#form-{{ form.hashid }}" class="no-underline">
{% if form.is_new %}
{% if not form.host %}
Waiting for a submission
{% else %}
{{ form.host }}
Expand All @@ -29,7 +29,7 @@
</td>
<td class="n-submissions">
<a href="{{ url_for('form-submissions', hashid=form.hashid) }}" class="no-underline">
{% if form.is_new %}
{% if form.counter == 0 %}
<span class="never">never submitted</span>
{% else %}
{{ form.counter }} submissions
Expand Down

0 comments on commit 66438c2

Please sign in to comment.