Skip to content

Instantly share code, notes, and snippets.

View jerzyn's full-sized avatar

Andrzej Jarzyna jerzyn

  • PZU
View GitHub Profile
@jerzyn
jerzyn / cc-restrict-display.html
Last active October 1, 2015 11:26
Restrict the display of Dashboard if credit card is missing
{% if current_account.credit_card_required? %}
{% if current_account.credit_card_stored? %}
<a href="/xxxx">API Credentials</a> |
{% endif %}
{% else %}
<a href="/xxxx">API Credentials</a> |
{% endif %}
@jerzyn
jerzyn / loop-services.html
Created March 21, 2014 16:21
retrieve all the informations about the services
{% for service in provider.services %}
.
.
.
{% endfor %}
@jerzyn
jerzyn / signup-columns.html
Last active August 29, 2015 13:57
We already have our layout and loop accessing the service objects. Now we should decide the way we want to display the service's informations and the signup link. I have decided to divide them into columns with a service description and a Signup link in the bottom. Every column will be a div box with a 'service-column' class and containing all t…
{% for service in provider.services %}
<div class="service-column">
<p>{{ service.name }}</p>
<p>{{ service.description }}</p>
.
.
.
</div>
{% endfor %}
@jerzyn
jerzyn / subscribe-links.html
Last active November 6, 2015 15:18
Subscribe and unsubscribe links
@jerzyn
jerzyn / subscribe.html
Created March 21, 2014 16:24
Check if subscribed and generate links
{% unless service.subscribed? %}
<a href="{{ urls.signup }}?{{ service | to_param }}">Signup to {{ service.name }}</a>
{% endunless %}
.service-column {
float: left;
margin-left: 10%;
width: 45%;
}
.service-column:first-child {
margin-left: 0;
}
@jerzyn
jerzyn / restricted-content.html
Created March 21, 2014 16:27
Restricted blocks of content
{{ if current_account.extra_fields.partner == 'true' }}
// content only accessible to partners
{{ endif }}
@jerzyn
jerzyn / restricted-content-unless.html
Created March 21, 2014 16:28
Restricted blocks of content unless
{{ unless current_account.extra_fields.partner == 'true' }}
// content forbidden for partners
{{ endunless }}
@jerzyn
jerzyn / current-user.html
Created March 21, 2014 16:28
Check if logged in user
{{ if current_user }}
// only visible if the user is logged in
{{ endif }}
@jerzyn
jerzyn / email-config
Created March 31, 2014 10:10
Custom Email configuration
smtpapi._domainkey.YOURDOMAIN.com CNAME dkim.sendgrid.net
smtpapi._domainkey.APIMAIL.YOURDOMAIN.com CNAME dkim.sendgrid.net
o1.APIMAIL.YOURDOMAIN.com A 75.126.253.120