Skip to content

Commit

Permalink
Merge pull request #331 from geekingfrog/icon-fixes-2
Browse files Browse the repository at this point in the history
Fix some more icons
  • Loading branch information
L-e-x-o-n authored Jul 9, 2024
2 parents 68668ed + a8aa85a commit acc8b94
Show file tree
Hide file tree
Showing 30 changed files with 61 additions and 59 deletions.
2 changes: 1 addition & 1 deletion lib/central/general_test_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule Central.Helpers.GeneralTestLib do
"name" => params["name"] || "Test",
"email" => params["email"] || "email@email#{:rand.uniform(999_999_999_999)}",
"colour" => params["colour"] || "#00AA00",
"icon" => params["icon"] || "fa-regular fa-user",
"icon" => params["icon"] || "fa-solid fa-user",
"permissions" => permissions,
"password" => params["password"] || "password",
"password_confirmation" => params["password"] || "password",
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/libs/auth_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Account.AuthLib do
require Logger

@spec icon :: String.t()
def icon(), do: "fa-regular fa-address-card"
def icon(), do: "fa-solid fa-address-card"

@spec get_all_permission_sets() :: Map.t()
def get_all_permission_sets do
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/libs/smurf_key_type_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Teiserver.Account.SmurfKeyTypeLib do

# Functions
@spec icon :: String.t()
def icon, do: "fa-regular fa-???"
def icon, do: "fa-regular fa-question"

@spec colours :: atom
def colours, do: :default
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/mapping_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Game.MappingReport do
alias Teiserver.{Battle}

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-map"
def icon(), do: "fa-solid fa-map"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/account/reports/week_on_week_report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Teiserver.Account.WeekOnWeekReport do
alias Teiserver.Helper.{TimexHelper, NumberHelper}

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-calendar"
def icon(), do: "fa-solid fa-calendar"

@spec permissions() :: String.t()
def permissions(), do: "Admin"
Expand Down
10 changes: 5 additions & 5 deletions lib/teiserver/helpers/fontawesome.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ defmodule Fontawesome do

def icon_lookup(:chart), do: "fa-chart-line"

def icon_lookup(:day), do: "fa-calendar-day"
def icon_lookup(:week), do: "fa-calendar-week"
def icon_lookup(:month), do: "fa-calendar-range"
def icon_lookup(:quarter), do: "fa-calendar"
def icon_lookup(:year), do: "fa-circle-calendar"
def icon_lookup(:day), do: ""
def icon_lookup(:week), do: ""
def icon_lookup(:month), do: ""
def icon_lookup(:quarter), do: ""
def icon_lookup(:year), do: ""

def brand_icons do
~w(42-group 500px accessible-icon accusoft adn adversal affiliatetheme airbnb algolia alipay amazon-pay amazon amilia android angellist angrycreative angular apper apple-pay apple app-store-ios app-store artstation asymmetrik atlassian audible autoprefixer avianex aviato aws bandcamp battle-net behance bilibili bimobject bitbucket bitcoin bity blackberry black-tie blogger-b blogger bluetooth-b bluetooth bootstrap bots btc buffer buromobelexperte buy-n-large buysellads canadian-maple-leaf cc-amazon-pay cc-amex cc-apple-pay cc-diners-club cc-discover cc-jcb cc-mastercard cc-paypal cc-stripe cc-visa centercode centos chromecast chrome cloudflare cloudscale cloudsmith cloudversify cmplid codepen codiepie confluence connectdevelop contao cotton-bureau cpanel creative-commons-by creative-commons-nc-eu creative-commons-nc-jp creative-commons-nc creative-commons-nd creative-commons-pd-alt creative-commons-pd creative-commons-remix creative-commons-sampling-plus creative-commons-sampling creative-commons-sa creative-commons-share creative-commons creative-commons-zero critical-role css3-alt css3 cuttlefish dailymotion d-and-d-beyond d-and-d dashcube deezer delicious deploydog deskpro deviantart dev dhl diaspora digg digital-ocean discord discourse dochub docker draft2digital dribbble dropbox drupal dyalog earlybirds ebay edge-legacy edge elementor ello ember empire envira erlang ethereum etsy evernote expeditedssl facebook-f facebook-messenger facebook fantasy-flight-games fedex fedora figma firefox-browser firefox firstdraft first-order-alt first-order flickr flipboard fly font-awesome fonticons-fi fonticons fort-awesome-alt fort-awesome forumbee foursquare freebsd free-code-camp fulcrum galactic-republic galactic-senate get-pocket gg-circle gg git-alt github-alt github gitkraken gitlab git gitter glide-g glide gofore golang goodreads-g goodreads google-drive google-pay google-play google-plus-g google-plus google google-wallet gratipay grav gripfire grunt guilded gulp hacker-news hackerrank hashnode hips hire-a-helper hive hooli hornbill hotjar houzz html5 hubspot ideal imdb instagram instalod intercom internet-explorer invision ioxhost itch-io itunes-note itunes java jedi-order jenkins jira joget joomla jsfiddle js kaggle keybase keycdn kickstarter-k kickstarter korvue laravel lastfm leanpub less line linkedin-in linkedin linode linux lyft magento mailchimp mandalorian markdown mastodon maxcdn mdb medapps medium medrt meetup megaport mendeley meta microblog microsoft mixcloud mixer mix mizuni modx monero napster neos nfc-directional nfc-symbol nimblr node-js node npm ns8 nutritionix octopus-deploy odnoklassniki odysee old-republic opencart openid opera optin-monster orcid osi padlet page4 pagelines palfed patreon paypal perbyte periscope phabricator phoenix-framework phoenix-squadron php pied-piper-alt pied-piper-hat pied-piper-pp pied-piper pinterest-p pinterest pix playstation product-hunt pushed python qq quinscape quora raspberry-pi ravelry reacteurope react readme rebel reddit-alien reddit redhat red-river renren replyd researchgate resolving rev rocketchat rockrms r-project rust safari salesforce sass schlix screenpal scribd searchengin sellcast sellsy servicestack shirtsinbulk shopify shopware simplybuilt sistrix sith sitrox sketch skyatlas skype slack slideshare snapchat soundcloud sourcetree space-awesome speakap speaker-deck spotify square-behance square-dribbble square-facebook square-font-awesome-stroke square-font-awesome square-github square-gitlab square-git square-google-plus square-hacker-news square-instagram square-js square-lastfm square-odnoklassniki square-pied-piper square-pinterest square-reddit square-snapchat squarespace square-steam square-tumblr square-twitter square-viadeo square-vimeo square-whatsapp square-xing square-youtube stack-exchange stack-overflow stackpath staylinked steam steam-symbol sticker-mule strava stripe-s stripe stubber studiovinari stumbleupon-circle stumbleupon superpowers supple suse swift symfony teamspeak telegram tencent-weibo themeco themeisle the-red-yeti think-peaks tiktok trade-federation trello tumblr twitch twitter typo3 uber ubuntu uikit umbraco uncharted uniregistry unity unsplash untappd ups usb usps ussunnah vaadin viacoin viadeo viber vimeo vimeo-v vine vk vnv vuejs watchman-monitoring waze weebly weibo weixin whatsapp whmcs wikipedia-w windows wirsindhandwerk wix wizards-of-the-coast wodu wolf-pack-battalion wordpress-simple wordpress wpbeginner wpexplorer wpforms wpressr xbox xing yahoo yammer yandex-international yandex yarn y-combinator yelp yoast youtube zhihu)
Expand Down
16 changes: 9 additions & 7 deletions lib/teiserver/helpers/styling_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ defmodule Teiserver.Helper.StylingHelper do
def get_bsname(colour), do: elem(colours(colour), 2)

@spec icon(atom) :: String.t()
def icon(nil), do: nil
def icon(nil, _), do: nil
def icon(atom), do: icon(atom, "solid")

Check warning on line 57 in lib/teiserver/helpers/styling_helpers.ex

View workflow job for this annotation

GitHub Actions / Build and test

clauses with the same name should be grouped together, "def icon/1" was previously defined (lib/teiserver/helpers/styling_helpers.ex:55)

Check warning on line 57 in lib/teiserver/helpers/styling_helpers.ex

View workflow job for this annotation

GitHub Actions / mix format

clauses with the same name should be grouped together, "def icon/1" was previously defined (lib/teiserver/helpers/styling_helpers.ex:55)

Check warning on line 57 in lib/teiserver/helpers/styling_helpers.ex

View workflow job for this annotation

GitHub Actions / Dialyzer

clauses with the same name should be grouped together, "def icon/1" was previously defined (lib/teiserver/helpers/styling_helpers.ex:55)

@spec icon(atom, String.t()) :: String.t()
Expand Down Expand Up @@ -82,13 +84,13 @@ defmodule Teiserver.Helper.StylingHelper do

def icon(:summary, fa_type), do: "fa-#{fa_type} fa-clipboard-list"

def icon(:chart, fa_type), do: "fa-#{fa_type} fa-chart-line"
def icon(:chart, _fa_type), do: "fa-solid fa-chart-line"

def icon(:day, fa_type), do: "fa-#{fa_type} fa-calendar-day"
def icon(:week, fa_type), do: "fa-#{fa_type} fa-calendar-week"
def icon(:month, fa_type), do: "fa-#{fa_type} fa-calendar-range"
def icon(:quarter, fa_type), do: "fa-#{fa_type} fa-calendar"
def icon(:year, fa_type), do: "fa-#{fa_type} fa-circle-calendar"
def icon(:day, _fa_type), do: ""
def icon(:week, _fa_type), do: ""
def icon(:month, _fa_type), do: ""
def icon(:quarter, _fa_type), do: ""
def icon(:year, _fa_type), do: ""

# defp split_colour(c) do
# {r, _} = c |> String.slice(1, 2) |> Integer.parse(16)
Expand Down Expand Up @@ -224,7 +226,7 @@ defmodule Teiserver.Helper.StylingHelper do
@spec random_styling() :: Map.t()
def random_styling() do
%{
"icon" => "fa-regular fa-" <> random_icon(),
"icon" => "fa-solid fa-" <> random_icon(),
"colour" => random_colour()
}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/logging/lib/aggregate_view_log_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Teiserver.Logging.AggregateViewLogLib do
def colours(), do: :info2

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-chart-area"
def icon(), do: "fa-solid fa-chart-area"

def get_logs() do
from(logs in AggregateViewLog)
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/logging/lib/audit_log_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Teiserver.Logging.AuditLogLib do
def colours(), do: :danger2

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-archive"
def icon(), do: "fa-solid fa-archive"

@spec add_audit_types([String.t()]) :: :ok
def add_audit_types(types) do
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/logging/lib/logging_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Teiserver.Logging.LoggingLib do
def colours(), do: :default

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-bars"
def icon(), do: "fa-solid fa-bars"

@spec do_not_log(Plug.Conn.t()) :: Plug.Conn.t()
def do_not_log(conn) do
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/logging/lib/page_view_log_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Teiserver.Logging.PageViewLogLib do
def colours(), do: :info

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-chart-line"
def icon(), do: "fa-solid fa-chart-line"

alias Teiserver.Logging.PageViewLog

Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/logging/lib/server_day_log_lib.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Teiserver.Logging.ServerDayLogLib do
def colours(), do: :warning

@spec icon() :: String.t()
def icon(), do: "fa-regular fa-monitor-heart-rate"
def icon(), do: "fa-solid fa-heart-pulse"

@spec get_server_day_logs :: Ecto.Query.t()
def get_server_day_logs() do
Expand Down
10 changes: 5 additions & 5 deletions lib/teiserver_web/live/account/party/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ moderator = allow?(@current_user, "Moderator") %>
<div class="float-end">
<%= if @client do %>
<span class={"btn btn-#{bsname}"} phx-click="create_party">
<i class="fa-fw fa-regular fa-plus"></i> &nbsp;
<i class="fa-fw fa-solid fa-plus"></i> &nbsp;
Create party
</span>
<% else %>
<span class="btn btn-secondary disabled">
<i class="fa-fw fa-regular fa-wifi-exclamation"></i> &nbsp;
<i class="fa-fw fa-solid fa-wifi-exclamation"></i> &nbsp;
Connect with client to enable functionality
</span>
<% end %>
Expand Down Expand Up @@ -103,7 +103,7 @@ moderator = allow?(@current_user, "Moderator") %>
phx-value-party_id={party.id}
class="btn btn-sm btn-success btn-block"
>
<i class="fa-fw fa-regular fa-check"></i> &nbsp;
<i class="fa-fw fa-solid fa-check"></i> &nbsp;
Accept invite
</span>
</td>
Expand All @@ -113,7 +113,7 @@ moderator = allow?(@current_user, "Moderator") %>
phx-value-party_id={party.id}
class="btn btn-sm btn-warning btn-block"
>
<i class="fa-fw fa-regular fa-times"></i> &nbsp;
<i class="fa-fw fa-solid fa-times"></i> &nbsp;
Decline invite
</span>
</td>
Expand All @@ -127,7 +127,7 @@ moderator = allow?(@current_user, "Moderator") %>
href={Routes.ts_game_party_show_path(@socket, :show, party.id)}
class="btn btn-sm btn-secondary"
>
<i class="fa-fw fa-regular fa-power-off"></i> &nbsp;
<i class="fa-fw fa-solid fa-power-off"></i> &nbsp;
Show as admin
</a>
</td>
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver_web/live/queues/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accepted_app = @client == nil or @client.app_status == :accepted
href={Routes.ts_game_queue_path(@socket, :index)}
class={"btn btn-outline-#{bsname}"}
>
<i class={"fa-fw fa-regular #{Teiserver.Admin.AdminLib.icon()}"}></i> &nbsp;
<i class={"fa-fw fa-solid #{Teiserver.Admin.AdminLib.icon()}"}></i> &nbsp;
Admin view
</a>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "index",
label: "List",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: Routes.ts_admin_accolade_path(@conn, :index)
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "index",
label: "List",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: Routes.ts_admin_badge_type_path(@conn, :index)
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "index",
label: "List",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: ~p"/admin/discord_channels"
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "index",
label: "List",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: Routes.admin_lobby_policy_path(@conn, :index)
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: "list",
label: "List",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: Routes.ts_admin_match_path(@conn, :index)
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "index",
label: "List",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: ~p"/admin/text_callbacks"
) %>
Expand All @@ -14,7 +14,7 @@
name: "new",
label: "New",
active: @active,
icon: "fa-regular fa-plus",
icon: "fa-solid fa-plus",
bsname: bsname,
url: ~p"/admin/text_callbacks/new"
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
icon = if is_atom(@icon), do: Teiserver.Helper.StylingHelper.icon(@icon), else: @icon
icon =
if is_active do
if is_active && not is_nil(icon) do
icon
|> String.replace("far ", "fa-solid ")
|> String.replace("fa-regular ", "fa-solid ")
Expand All @@ -16,7 +16,7 @@ icon =
active_class = if is_active, do: "active" %>

<a href={@url} class={"btn btn-outline-#{@bsname} #{active_class}"} id={"section-menu-#{@name}"}>
<%= if @icon != "" do %>
<%= if not is_nil(@icon) && @icon != "" do %>
<%= central_component("icon", icon: icon) %> &nbsp;
<% end %>
<%= @label %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "index",
label: "List",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: Routes.ts_game_queue_path(@conn, :index)
) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class={"btn btn-outline-#{bsname}"}
id="section-menu-index"
>
<i class="fa-regular fa-bars"></i> &nbsp;
<i class="fa-solid fa-bars"></i> &nbsp;
List
</a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class={"btn btn-outline-#{bsname}"}
id="section-menu-index"
>
<i class="fa-regular fa-bars"></i> &nbsp;
<i class="fa-solid fa-bars"></i> &nbsp;
List
</a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
label: "Live dashboard",
active: @active,
url: ~p"/logging/live/dashboard",
icon: "fa-regular fa-tachometer-alt"
icon: "fa-solid fa-tachograph-digital"
) %>
<% end %>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: "day_metrics",
label: "Daily metrics",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: Routes.logging_match_log_path(@conn, :day_metrics_list)
) %>
Expand All @@ -22,7 +22,7 @@
name: "graph",
label: "Graph",
active: @active,
icon: "fa-regular fa-chart-line-up",
icon: "fa-solid fa-chart-line-up",
bsname: bsname,
url: Routes.logging_match_log_path(@conn, :day_metrics_graph)
) %>
Expand All @@ -39,7 +39,7 @@
name: "month_metrics",
label: "Monthly metrics",
active: @active,
icon: "fa-regular fa-bars",
icon: "fa-solid fa-bars",
bsname: bsname,
url: Routes.logging_match_log_path(@conn, :month_metrics_list)
) %>
Expand All @@ -57,7 +57,7 @@
name: "month_graph",
label: "Graph",
active: @active,
icon: "fa-regular fa-chart-line-up",
icon: "fa-solid fa-chart-line-up",
bsname: bsname,
url: Routes.logging_match_log_path(@conn, :month_metrics_graph)
) %>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class={"btn btn-outline-#{bsname}"}
id="section-menu-index"
>
<i class="fa-regular fa-bars"></i> &nbsp;
<i class="fa-solid fa-bars"></i> &nbsp;
List
</a>

Expand Down
Loading

0 comments on commit acc8b94

Please sign in to comment.