Skip to content

Commit 2c7f426

Browse files
committed
let specify the full 'path' for FontAwesome fonts
1 parent bfb7a28 commit 2c7f426

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ Widgets have shared options:
247247
- `:order` (optional) is the displaying order of the widget. Widgets are display in order based on this value. The default value is 999.
248248
- `:width` (optional) is the width the widget should occupy on the page. Valid values are 1 to 12. The default for tidbits is 3 and the others 6.
249249
- `:percentage` (required for progress widgets) is the percentage value for the progress. This must be an integer.
250-
- `:icon` (optional for tidbit widgets) is the icon displayed next to the tidbit's `content`. Any FontAwesome-valid icon is valid here. For example: `thumbs-up`.
250+
- `:full_icon` (optional for tidbit widgets) is the icon displayed next to the tidbit's `content`. You have to specify the full name given by FontAwesome like `fas fa-thumbs-up`.
251+
- `:icon` (optional for tidbit widgets) is the icon displayed next to the tidbit's `content`. Any FontAwesome-valid icon is valid here. For example: `thumbs-up`. But it's limited to the `fas` group. For full defintion see `:full_icon`.
251252

252253
When defining a chart widget, the content must be a map with the following required keys:
253254

lib/kaffy_web/templates/home/_card.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="card bg-<%= @widget.type %> card-img-holder text-white">
33
<div class="card-body">
44
<img src="<%= Kaffy.Utils.static_asset_path(@conn, "/kaffy/assets/images/dashboard/circle.svg") %>" class="card-img-absolute" alt="circle-image" />
5-
<h4 class="font-weight-normal mb-3"><%= @widget.title %> <i class="fas fa-<%= @widget.icon %> float-right"></i></h4>
5+
<h4 class="font-weight-normal mb-3"><%= @widget.title %> <i class="<%= if @widget[:full_icon] do %><%= @widget.full_icon %><% else %>fas fa-<%= @widget.icon %><% end %> float-right"></i></h4>
66
<h2 class="mb-5"><%= @widget.content %></h2>
77
<h6 class="card-text"><%= @widget.subcontent %></h6>
88
</div>

lib/kaffy_web/templates/home/_tidbit.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="col-md-<%= @widget.width %> grid-margin stretch-card">
22
<div class="card shadow border-left-success">
33
<div class="card-body">
4-
<p class="font-weight-normal mb-1 text-success"><strong><%= @widget.title %></strong> <i class="fa fa-<%= @widget.icon %> float-right"></i></p>
4+
<p class="font-weight-normal mb-1 text-success"><strong><%= @widget.title %></strong> <i class="<%= if @widget[:full_icon] do %><%= @widget.full_icon %><% else %>fas fa-<%= @widget.icon %><% end %> float-right"></i></p>
55
<h2 class="mt-1"><%= @widget.content %></h2>
66
</div>
77
</div>

lib/kaffy_web/templates/layout/app.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<li class="nav-item">
6666
<%= link to: custom_link.url, method: custom_link.method, class: "nav-link", target: custom_link.target do %>
6767
<span class="menu-title"><%= custom_link.name %></span>
68-
<i class="fas fa-<%= custom_link.icon %> menu-icon"></i>
68+
<i class="<%= if custom_link.full_icon do %><%= custom_link[:full_icon] %><% else %>fas fa-<%= custom_link.icon %><% end %> menu-icon"></i>
6969
<% end %>
7070
</li>
7171
<% end %>

0 commit comments

Comments
 (0)