-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_homepage_excerpt_petition.html
173 lines (119 loc) · 6.06 KB
/
_homepage_excerpt_petition.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{% if homepage_excerpt.petition.is_signed? %}
{% form_for petition_signature %}
{% hidden_field_tag "page_id", homepage_excerpt.id %}
<div class="form">
<h3>Thank you for signing!</h3>
<div class="form-errors">{% error_messages_for petition_signatures %}</div>
{% if homepage_excerpt.is_commentable? %}
<label for="petition_signature_content">Change your comment</label>{% text_area "content", class:"textarea form-control autogrow" %}
{% endif %}
{% if homepage_excerpt.petition.is_image? %}
<label for="petition_signature_image">Upload a picture (140x140)</label>{% file_field "image", class:"file" %}
{% if petition_signature.has_image? %}
<p><img src="{{ petition_signature.large_square_image_url }}" width="140" height="140" border="0"/></p>
{% endif %}
{% endif %}
{% if homepage_excerpt.is_commentable? %}
{% capture signature_name %}Update {{ homepage_excerpt.petition.signature_name }}{% endcapture %}
{% submit_tag signature_name, class:"submit-button btn btn-primary" %}
{% endif %}
{% capture signature_name %}Remove {{ homepage_excerpt.petition.signature_name }}{% endcapture %}
{{ homepage_excerpt.petition.current_signature | delete_link message: signature_name class_name: "btn btn-danger"}}
<div class="form-submit"></div>
</div>
{% endform_for %}
{% else %}
{% form_for petition_signature %}
<div class="form">
{% if request.sorta_logged_in? %}
<h4>Hi {{ request.current_signup.name_or_email }}, will you sign?</h4>
{% if request.logged_in? == false %}
<div class="padtop">
If you're not {{ request.current_signup.name_or_email }}, <a href="{{ request.current_signup.logout_url }}">click here</a>.
</div>
{% endif %}
{% else %}
<h4>Will you sign?</h4>
{% endif %}
<div class="form-errors">{% error_messages_for petition_signature %}</div>
{% if request.sorta_logged_in? == false or request.current_signup.has_name? == false %}
<div class="row">
<div class="col-md-6"><div class="form-group"><label for="petition_signature_first_name">First Name</label>{% text_field "first_name", class:"text form-control" %}</div></div>
<div class="col-md-6"><div class="form-group"><label for="petition_signature_last_name">Last Name</label>{% text_field "last_name", class:"text form-control" %}</div></div>
</div>
{% endif %}
{% if request.sorta_logged_in? == false %}
<div class="row">
<div class="col-md-6"><div class="form-group"><label for="petition_signature_email">Email</label>{% email_field "email", class:"text form-control" %}</div></div>
{% if site.ask_for_mobiles? %}
<div class="col-md-6"><div class="form-group"><label for="petition_signature_mobile_number">Mobile phone</label>{% phone_field "mobile_number", class:"text form-control" %}</div></div>
{% endif %}
</div>
<div class="row">
<div class="col-md-6"><div class="checkbox"><label for="petition_signature_email_opt_in">{% check_box "email_opt_in", class:"checkbox" %} Send me email updates</label></div>
</div>
{% if site.ask_for_mobiles? %}
<div class="col-md-6"><div class="checkbox"><label for="petition_signature_mobile_opt_in">{% check_box "mobile_opt_in", class:"checkbox" %} Send me text message updates</label></div>
</div>
{% endif %}
</div>
{% endif %}
{% if homepage_excerpt.petition.is_phone? %}
<div class="row">
<div class="col-md-12"><div class="form-group"><label for="petition_signature_phone_number">Phone</label>{% phone_field "phone_number", class:"text form-control" %}</div></div>
</div>
{% endif %}
{% if homepage_excerpt.petition.is_address? %}
{% if request.sorta_logged_in? == false or request.current_signup.has_full_address? == false %}
<div class="row">
<div class="col-md-12"><div class="form-group"><label for="petition_signature_submitted_address">Address (Street, City, State, Postal code)</label>
{% if homepage_excerpt.petition.require_address? %}
{% text_field "submitted_address", class:"text form-control", required: "required" %}
{% else %}
{% text_field "submitted_address", class:"text form-control" %}
{% endif %}
</div></div>
</div>
<div class="row">
<div class="col-md-12"><div class="form-group"><label for="petition_signature_country_code">Country</label>
{% collection_select "country_code", homepage_excerpt.petition.countries, "code", "name", class:"select form-control" %}</div></div>
</div>
{% endif %}
{% endif %}
{% if homepage_excerpt.is_commentable? %}
<div class="row">
<div class="col-md-12"><div class="form-group"><label for="petition_signature_content">Comments (optional)</label>{% text_area "content", class:"textarea form-control autogrow" %}</div>
</div>
</div>
{% endif %}
{% if homepage_excerpt.petition.is_image? %}
<div class="row">
<div class="col-md-12"><div class="form-group"><label for="petition_signature_image">Upload a picture (140x140)</label>{% file_field "image", class:"file" %}
</div></div>
</div>
{% endif %}
{% if site.ask_to_publish_to_stream? %}
<div class="row">
<div class="col-md-12"><div class="checkbox"><label for="petition_signature_is_private">{% check_box "is_private", class:"checkbox" %} Don't publish this on the website</label></div>
</div>
</div>
{% endif %}
{% if homepage_excerpt.petition.is_volunteer? and site.ask_for_volunteers? %}
{% if request.sorta_logged_in? == false or request.current_signup.is_volunteer == false %}
<div class="row">
<div class="col-md-12"><div class="checkbox"><label for="petition_signature_is_volunteer">{% check_box "is_volunteer", class:"checkbox" %} I want to volunteer</label></div>
</div>
</div>
{% endif %}
{% endif %}
{% capture signature_name %}Add {{ homepage_excerpt.petition.signature_name }}{% endcapture %}
{% submit_tag signature_name, class:"submit-button btn btn-primary" %}
<div class="form-submit"></div>
</div>
{% endform_for %}
{% if homepage_excerpt.text_keyword_instructions.size > 0 %}
<div class="padbottom padtopmore">
or {{ homepage_excerpt.text_keyword_instructions }}
</div>
{% endif %}
{% endif %}