Skip to content

Commit

Permalink
Make enabling/disabling support configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
mjumbewu committed Feb 17, 2016
1 parent df28c8c commit 3493d11
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/flavors/defaultflavor/config.yml
Expand Up @@ -274,6 +274,7 @@ survey:

support:
submission_type: support
adding_supported: true
submit_btn_text: _(Support)
response_name: _(support)
response_plural_name: _(supports)
Expand Down
6 changes: 6 additions & 0 deletions src/sa_web/jstemplates/place-detail-support.html
@@ -1,6 +1,12 @@
{{#if support_config.adding_supported}}
<form action="#" method="post" class="btn btn-block btn-small user-support">
<input type="hidden" name="user_token" value="{{{ user_token }}}">
<input type="hidden" name="visible" value="true">
<input type="checkbox" id="support"{{# is_supporting }} checked="checked"{{/ is_supporting }}>
<label for="support"><span class="support-count">{{#if count }}{{ count }}{{else}}0{{/if }}</span> {{ support_config.submit_btn_text }}</label>
</form>
{{else}}
<form action="#" method="post" class="btn btn-block btn-small user-support disabled">
<label><span class="support-count">{{#if count }}{{ count }}{{else}}0{{/if }}</span> {{ support_config.submit_btn_text }}</label>
</form>
{{/if}}
5 changes: 5 additions & 0 deletions src/sa_web/static/css/default.css
Expand Up @@ -737,6 +737,11 @@ a.close-btn span {
padding-left: 22px;
color: #007fbf;
}
.user-support.disabled:hover,
.user-support.disabled:hover label {
cursor: default;
background-color: #a3c7d9;
}
.user-support input[type=checkbox]:checked ~ label {
background-image: url(images/heart.png);
}
Expand Down

0 comments on commit 3493d11

Please sign in to comment.