Skip to content

Instantly share code, notes, and snippets.

@Rosa-Fox
Created June 20, 2014 15:50
Show Gist options
  • Save Rosa-Fox/b36839798c01a7cef9d2 to your computer and use it in GitHub Desktop.
Save Rosa-Fox/b36839798c01a7cef9d2 to your computer and use it in GitHub Desktop.
Bad example 1
%nav.navbar.navbar-default
.container-fluid
.navbar-header
%span.navbar-brand
=link_to 'Users', admin_users_path
|
=link_to 'Invitations', admin_invitations_path
.collapse.navbar-collapse
.navbar-right
= link_to 'Log out', admin_session_path, method: 'delete', class: 'btn btn-sm btn-default navbar-btn'
.row
.col-md-1
.col-md-5
%h1.text-left Invitations
.row
.col-md-1
.col-md-5
= link_to 'New Invitation', new_admin_invitation_path
.row
.col-md-1
.col-md-9
%h3 Pending Invitations
.text-muted Sent invitations that have yet to expire or be redeemed
%table.table.table-striped
%thead
%tr
%th Email
%th Workshops
%th Sent at
%th Expired at
%tbody
- @invitation.each do |invitation|
- if invitation.expired?(invitation) == false and invitation.redeemed?(invitation) == false
%tr
%td
= invitation.email
%td
= invitation.workshop_ids.join(', ')
%td
= invitation.created_at
%td
= invitation.created_at + 2.weeks
.row
.col-md-1
.col-md-9
%h3 Expired Invitations
.text-muted Invitations that expired without being redeemed
%table.table.table-striped
%thead
%tr
%th Email
%th Workshops
%th Sent at
%th Expired at
%tbody
- @invitation.each do |invitation|
- if invitation.expired?(invitation) and invitation.redeemed?(invitation) == false
%tr
%td
= invitation.email
%td
= invitation.workshop_ids.join(', ')
%td
= invitation.created_at
%td
= invitation.created_at + 2.weeks
.row
.col-md-1
.col-md-9
%h3 Redeemed Invitations
.text-muted Invitations that were redeemed before they were expired
%table.table.table-striped
%thead
%tr
%th Email
%th Workshops
%th Sent at
%th Created at
%th Redeemed at
%tbody
- @invitation.each do |invitation|
- if invitation.redeemed?(invitation) and invitation.expired?(invitation) == false
%tr
%td
= link_to invitation.email, edit_admin_user_path(invitation.user_id)
%td
= invitation.workshop_ids.join(', ')
%td
= invitation.created_at
%td
= invitation.created_at + 2.weeks
%td
= invitation.redeemed_at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment