style: if ! changed by unless

- if ! changed by unless as it is more readable
- !object.blank? is equivalent to object.present?, also more readable
This commit is contained in:
Ana 2016-08-06 00:57:07 +02:00
parent 96155eb87f
commit 7e5d20c89d
18 changed files with 27 additions and 28 deletions

View file

@ -106,13 +106,13 @@
%td
= @event.language
- if !@event.room.nil?
- unless @event.room.nil?
%tr
%td
%b Room
%td
= @event.room.name
- if !@event.start_time.nil?
- unless @event.start_time.nil?
%tr
%td
%b Scheduled time

View file

@ -62,7 +62,7 @@
- bgcolor=""
%td{:style=>"background-color: #{bgcolor}"}
- if @program.show_voting?
- if !event.submitter.nil?
- unless event.submitter.nil?
=link_to event.submitter.name, admin_user_path(event.submitter)
- if event.submitter.registrations.count < 1
(Unregistered!)

View file

@ -23,7 +23,7 @@
- @event.versions.each do |version|
%tr
%td
- if !version.whodunnit.nil?
- unless version.whodunnit.nil?
= User.find(version.whodunnit).name
- else
No user (probably via the console)
@ -35,4 +35,3 @@
- version.changeset.each_key do |key|
= "#{key}: #{version.changeset[key][0]} -> #{version.changeset[key][1]}"
%br

View file

@ -10,7 +10,7 @@
- slice.each do |lodging|
.col-md-4
.thumbnail
- if !lodging.picture?
- unless lodging.picture?
%p.text-center
%i.fa.fa-home.fa-5x
- else

View file

@ -13,7 +13,7 @@
- if conference.venue
%p
= "#{conference.venue.city}/#{conference.venue.country_name}"
- if !conference.description.blank?
- unless conference.description.blank?
%p
= markdown(conference.description)
.col-md-2

View file

@ -13,7 +13,7 @@
- slice.each do |lodging|
.col-md-4.col-sm-4.ticket.col-centered.col-top
.thumbnail
- if !lodging.picture?
- unless lodging.picture?
%p.text-center
%i.fa.fa-home.fa-5x
- else

View file

@ -7,7 +7,7 @@
= @conference.title
.row
.col-md-8
- if !current_user
- unless current_user
%legend
%span
=link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do

View file

@ -5,7 +5,7 @@
%h4.media-heading
= ticket.title
%h5.media-heading
-if !ticket.description.blank?
-unless ticket.description.blank?
= markdown(ticket.description)
%td.col-sm-1.col-md-1
= text_field_tag("tickets[][#{ticket.id}]", 0, type: 'number', min: 0,

View file

@ -8,7 +8,7 @@
= render partial: 'encouragement_text'
.row
.col-md-8
- if !current_user
- unless current_user
%legend
%span
=link_to('#signup', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do

View file

@ -5,7 +5,7 @@
%h4.media-heading
= ticket.title
%h5.media-heading
-if !ticket.description.blank?
- unless ticket.description.blank?
= markdown(ticket.description)
%td.col-sm-1.col-md-1
- if ticket.bought?(current_user)