Skip to content

Commit

Permalink
Add inline_svg gem and icons
Browse files Browse the repository at this point in the history
Add icons for location, calendar and website
  • Loading branch information
lujanfernaud committed Apr 19, 2018
1 parent 8499aaf commit 443b4db
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 9 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gem 'rolify', '~> 5.2'
gem 'sucker_punch', '~> 2.0', '>= 2.0.4'
gem 'figaro', '~> 1.1', '>= 1.1.1'
gem 'gravatar_image_tag', '~> 1.2'
gem 'inline_svg', '~> 1.3', '>= 1.3.1'

# Add type-casting and other features on top of ActiveRecord::Store.store_accessor
gem 'storext', '~> 2.2', '>= 2.2.2'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ GEM
i18n_data (0.8.0)
ice_nine (0.11.2)
inflecto (0.0.2)
inline_svg (1.3.1)
activesupport (>= 3.0)
nokogiri (>= 1.6)
ipaddress (0.8.3)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -514,6 +517,7 @@ DEPENDENCIES
guard (= 2.14.0)
guard-livereload (~> 2.5, >= 2.5.2)
guard-minitest (= 2.4.6)
inline_svg (~> 1.3, >= 1.3.1)
jbuilder (~> 2.5)
jquery-rails (= 4.3.1)
listen (>= 3.0.5, < 3.2)
Expand Down
1 change: 1 addition & 0 deletions app/assets/images/icons/if_icon-calendar_211633.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/icons/if_icon-link_211853.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions app/assets/stylesheets/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ body {
border-bottom: 3px solid $indigo;
}

.icon {
width: 20px;
height: 20px;
vertical-align: sub;
}

.icon-location,
.icon-calendar {
margin-right: .1rem;
}

.icon-link {
margin-right: .13rem;
}


// Event Map


Expand Down
27 changes: 27 additions & 0 deletions app/helpers/icons_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module IconsHelper
def location_icon
inline_svg location_icon_file, class: "icon icon-location"
end

def calendar_icon
inline_svg calendar_icon_file, class: "icon icon-calendar"
end

def link_icon
inline_svg link_icon_file, class: "icon icon-link"
end

private

def location_icon_file
"icons/if_icon-ios7-location-outline_211766"
end

def calendar_icon_file
"icons/if_icon-calendar_211633"
end

def link_icon_file
"icons/if_icon-link_211853"
end
end
1 change: 1 addition & 0 deletions app/views/events/_event.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<div class="event-box-text">
<p class="mb-0 event-box__date">
<%= calendar_icon %>
<%= event.start_date_prettyfied %>
</p>
</div>
Expand Down
26 changes: 19 additions & 7 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,37 @@

<div class="row">
<div class="col-md-12 mt-2">
<div class="row mb-2rem">

<div class="row mb-2rem">
<div class="col-md-8">

<div class="box">
<div class="event-box-big-image">
<%= image_tag(@event.image_url, class: "img-fluid") %>
</div>
<div class="event-box-big-text">
<h2 class="mb-3 font-italic"><%= @event.title %></h2>
<p>
<%= calendar_icon %>
<%= @event.start_date_prettyfied %>
<% unless same_time?(@event) %>
- <%= @event.end_date_prettyfied %>
<% end %>
</p>
<p><%= @event.full_address %></p>
<% if @event.website %>
<p><%= link_to @event.website, @event.website %></p>
<p>
<%= location_icon %>
<%= @event.full_address %>
</p>
<% if !@event.website.empty? %>
<p>
<%= link_icon %>
<%= link_to @event.website, @event.website %>
</p>
<% end %>
<p><%= sanitize @event.description %></p>
<p>
<%= sanitize @event.description %>
</p>

<% if author?(@event) %>
<p>
<%= link_to "Edit event",
Expand All @@ -34,8 +45,9 @@
method: :delete, data: { confirm: "Are you sure?"} %>
</p>
<% end %>
</div>
</div>
</div>
</div><!-- /.box -->

</div>

<div class="col-md-4">
Expand Down
5 changes: 4 additions & 1 deletion app/views/groups/_group.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
</div>

<div class="group-box-text">
<p class="mb-0"><%= group.location %></p>
<p class="mb-0">
<%= location_icon %>
<%= group.location %>
</p>
</div>

</div>
Expand Down
1 change: 1 addition & 0 deletions app/views/groups/_group_event.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
class: "font-weight-bold" %>
</h2>
<p class="event-box__date">
<%= calendar_icon %>
<%= event.start_date_prettyfied %>
</p>
<% if controller_name == "groups" %>
Expand Down
1 change: 1 addition & 0 deletions app/views/groups/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
Location
</h3>
<p>
<%= location_icon %>
<%= @group.location %>
</p>
</div>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 443b4db

Please sign in to comment.