Skip to content
Commits on Source (2)
@import "~bootstrap/scss/bootstrap";
@import "~@fortawesome/fontawesome-free/scss/fontawesome";
@import '~@fortawesome/fontawesome-free/scss/solid';
@import "gaulle/gaulle-iconset.css";
@import "roundabout/roundabout-iconset.css";
body {
background-color: lightgray;
......
@font-face {
font-family: "gaulle-iconset";
src: url("./gaulle-iconset.eot?859250aae5dcc4558d70278703af414a?#iefix") format("embedded-opentype"),
url("./gaulle-iconset.woff2?859250aae5dcc4558d70278703af414a") format("woff2"),
url("./gaulle-iconset.woff?859250aae5dcc4558d70278703af414a") format("woff"),
url("./gaulle-iconset.ttf?859250aae5dcc4558d70278703af414a") format("truetype"),
url("./gaulle-iconset.svg?859250aae5dcc4558d70278703af414a#gaulle-iconset") format("svg");
}
i[class^="gl-"]:before, i[class*=" gl-"]:before {
font-family: gaulle-iconset !important;
font-style: normal;
font-weight: normal !important;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.gl-audio-mute:before {
content: "\f101";
}
.gl-audio:before {
content: "\f102";
}
.gl-chat:before {
content: "\f103";
}
.gl-collapse-arrow:before {
content: "\f104";
}
.gl-collapse:before {
content: "\f105";
}
.gl-compress:before {
content: "\f106";
}
.gl-context-menu:before {
content: "\f107";
}
.gl-expand-arrow:before {
content: "\f108";
}
.gl-expand:before {
content: "\f109";
}
.gl-gaulle:before {
content: "\f10a";
}
.gl-profil:before {
content: "\f10b";
}
.gl-screen:before {
content: "\f10c";
}
.gl-settings:before {
content: "\f10d";
}
.gl-smiley:before {
content: "\f10e";
}
.gl-sound-mute:before {
content: "\f10f";
}
.gl-sound:before {
content: "\f110";
}
.gl-user-group:before {
content: "\f111";
}
.gl-user:before {
content: "\f112";
}
.gl-video:before {
content: "\f113";
}
{
"audio-mute": "\\f101",
"audio": "\\f102",
"chat": "\\f103",
"collapse-arrow": "\\f104",
"collapse": "\\f105",
"compress": "\\f106",
"context-menu": "\\f107",
"expand-arrow": "\\f108",
"expand": "\\f109",
"gaulle": "\\f10a",
"profil": "\\f10b",
"screen": "\\f10c",
"settings": "\\f10d",
"smiley": "\\f10e",
"sound-mute": "\\f10f",
"sound": "\\f110",
"user-group": "\\f111",
"user": "\\f112",
"video": "\\f113"
}
\ No newline at end of file
This diff is collapsed.
@font-face {
font-family: "roundabout-iconset";
src: url("./roundabout-iconset.eot?33ad2a0ee1b566522600fe38f21d7ede?#iefix") format("embedded-opentype"),
url("./roundabout-iconset.woff2?33ad2a0ee1b566522600fe38f21d7ede") format("woff2"),
url("./roundabout-iconset.woff?33ad2a0ee1b566522600fe38f21d7ede") format("woff"),
url("./roundabout-iconset.ttf?33ad2a0ee1b566522600fe38f21d7ede") format("truetype"),
url("./roundabout-iconset.svg?33ad2a0ee1b566522600fe38f21d7ede#roundabout-iconset") format("svg");
}
i[class^="ra-"]:before, i[class*=" ra-"]:before {
font-family: roundabout-iconset !important;
font-style: normal;
font-weight: normal !important;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.ra-check:before {
content: "\f101";
}
.ra-exclamation :before {
content: "\f102";
}
.ra-happy:before {
content: "\f103";
}
.ra-lightning:before {
content: "\f104";
}
.ra-sad:before {
content: "\f105";
}
.ra-thumbsup:before {
content: "\f106";
}
.ra-times:before {
content: "\f107";
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>roundabout-iconset</title>
<link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.6/build/styles/default.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.4/build/css/alertify.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.7/assets/css/emojione.min.css" />
<style>
body {
font-family: sans-serif;
margin: 0;
padding: 0;
font-family: 'PT Sans'; sans-serif;
}
h1 {
color: #C40005;
font-size: 48px;
line-height: 150%;
font-weight: 300;
}
h2 {
font-size: 40px;
line-height: 150%;
font-weight: 300;
border-left: 5px solid #C40005;
padding: 0 0 0 1rem;
}
h4 {
font-size: 28px;
line-height: 150%;
font-weight: 300;
}
p {
font-size: 16px;
line-height: 150%;
}
.container {
display: flex;
}
.main {
flex-grow: 1;
padding: 0 20px;
}
.sidebar {
padding: 0 20px;
width: 250px;
background-color: #888888;
height: calc(100vh% - 20px);
}
.preview-container {
text-align: center;
}
.preview {
width: 100px;
display: inline-block;
margin: 10px;
cursor: pointer;
}
.preview .inner {
display: inline-block;
width: 100%;
text-align: center;
background: #f5f5f5;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
}
.preview .inner i {
line-height: 85px;
font-size: 40px;
color: #333;
}
.label {
display: inline-block;
width: 100%;
box-sizing: border-box;
padding: 5px;
font-size: 16px;
color: #C40005;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
}
a,
a:active,
a:focus {
color: #C40005;
}
a:hover: {
color: #333F44;
}
pre code.hljs {
display: block;
}
code.hljs-subst {
display: inline;
color: #C40005
}
footer {
padding: 40px 30px;
background-color: #000;
color: #fff;
text-align: center;
}
</style>
<link rel="stylesheet" type="text/css" href="roundabout-iconset.css" />
</head>
<body>
<div class="container">
<div class="main">
<h1>Icon Font: "roundabout-iconset"</h1>
<h2>Preview</h2>
<div class="preview-container">
<div class="preview" data-name="check">
<span class="inner">
<i class=" ra-check"></i>
</span>
<br>
<span class='label'>check</span>
</div>
<div class="preview" data-name="exclamation ">
<span class="inner">
<i class=" ra-exclamation "></i>
</span>
<br>
<span class='label'>exclamation </span>
</div>
<div class="preview" data-name="happy">
<span class="inner">
<i class=" ra-happy"></i>
</span>
<br>
<span class='label'>happy</span>
</div>
<div class="preview" data-name="lightning">
<span class="inner">
<i class=" ra-lightning"></i>
</span>
<br>
<span class='label'>lightning</span>
</div>
<div class="preview" data-name="sad">
<span class="inner">
<i class=" ra-sad"></i>
</span>
<br>
<span class='label'>sad</span>
</div>
<div class="preview" data-name="thumbsup">
<span class="inner">
<i class=" ra-thumbsup"></i>
</span>
<br>
<span class='label'>thumbsup</span>
</div>
<div class="preview" data-name="times">
<span class="inner">
<i class=" ra-times"></i>
</span>
<br>
<span class='label'>times</span>
</div>
</div>
<h2>Download Files</h2>
<ul>
<li><a href="./roundabout-iconset.css" download>roundabout-iconset.css</a></li>
<li><a href="./roundabout-iconset.json" download>roundabout-iconset.json</a></li>
<li><a href="./roundabout-iconset.ttf" download>roundabout-iconset.ttf</a></li>
<li><a href="./roundabout-iconset.woff" download>roundabout-iconset.woff</a></li>
<li><a href="./roundabout-iconset.woff2" download>roundabout-iconset.woff2</a></li>
<li><a href="./roundabout-iconset.eot" download>roundabout-iconset.eot</a></li>
</ul>
<h2>CSS</h3>
<div class="style">
<pre><code class="css">@font-face {
font-family: &quot;roundabout-iconset&quot;;
src: url(&quot;./roundabout-iconset.eot?5249784332d81dd85c5d181d63af1e67?#iefix&quot;) format(&quot;embedded-opentype&quot;),
url(&quot;./roundabout-iconset.woff2?5249784332d81dd85c5d181d63af1e67&quot;) format(&quot;woff2&quot;),
url(&quot;./roundabout-iconset.woff?5249784332d81dd85c5d181d63af1e67&quot;) format(&quot;woff&quot;),
url(&quot;./roundabout-iconset.ttf?5249784332d81dd85c5d181d63af1e67&quot;) format(&quot;truetype&quot;),
url(&quot;./roundabout-iconset.svg?5249784332d81dd85c5d181d63af1e67#roundabout-iconset&quot;) format(&quot;svg&quot;);
}
i[class^&#x3D;&quot;ra-&quot;]:before, i[class*&#x3D;&quot; ra-&quot;]:before {
font-family: roundabout-iconset !important;
font-style: normal;
font-weight: normal !important;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.ra-check:before {
content: &quot;\f101&quot;;
}
.ra-exclamation :before {
content: &quot;\f102&quot;;
}
.ra-happy:before {
content: &quot;\f103&quot;;
}
.ra-lightning:before {
content: &quot;\f104&quot;;
}
.ra-sad:before {
content: &quot;\f105&quot;;
}
.ra-thumbsup:before {
content: &quot;\f106&quot;;
}
.ra-times:before {
content: &quot;\f107&quot;;
}
</code></pre>
</div>
</div>
<div class="sidebar">
<h4>Getting started</h2>
<p><code class="hljs-subst bash">Links-Klick</code> auf ein Icon, um css-Klasse zu kopieren anzuzeigen</p>
<p><code class="hljs-subst bash">Rechts-Klick</code> auf Icon, um HTML Icon Tag zu kopieren</p>
</div>
</div>
<footer>
Designed with <span class="emojione">:heart:</span> by Kelly and <span class="emojione">:muscle:</span> by Thomas
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/emojione/2.2.7/lib/js/emojione.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/alertifyjs@1.11.4/build/alertify.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.6/build/highlight.min.js"></script>
<script>
const classPrefix = "ra-";
hljs.initHighlightingOnLoad();
const previews = document.getElementsByClassName('preview')
alertify.set('notifier','position', 'top-center');
for(const preview of previews) {
preview.addEventListener('click', function() {
copyValue(classPrefix + this.getAttribute('data-name'), 'Copied icon classname');
})
preview.addEventListener('contextmenu', function(event) {
event.preventDefault()
const element = '<i class="'+classPrefix + this.getAttribute('data-name')+'"></i>';
copyValue(element, 'Copied icon tag');
})
}
function copyValue(value, type) {
const el = document.createElement('textarea');
el.value = value;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
alertify.success(type);
}
(function() {
const emojies = document.getElementsByClassName('emojione')
for(const emoji of emojies) {
emoji.innerHTML = emojione.toImage(emoji.textContent);
}
})();
</script>
</body>
</html>
\ No newline at end of file
{
"check": "\\f101",
"exclamation ": "\\f102",
"happy": "\\f103",
"lightning": "\\f104",
"sad": "\\f105",
"thumbsup": "\\f106",
"times": "\\f107"
}
\ No newline at end of file
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<font id="roundabout-iconset" horiz-adv-x="500">
<font-face font-family="roundabout-iconset"
units-per-em="500" ascent="500"
descent="0" />
<missing-glyph horiz-adv-x="0" />
<glyph glyph-name="check"
unicode="&#xF101;"
horiz-adv-x="500" d=" M409.18 401.19L184.42 182L90.86 273.4700000000001A38.74 38.74 0 0 1 36.7 273.4700000000001L36.7 273.4700000000001A38.74 38.74 0 0 1 36.7 218.05L159.6 97.93A35.58 35.58 0 0 1 209.33 97.93L463.34 345.77A38.74 38.74 0 0 1 463.34 401.17H463.34A38.74 38.74 0 0 1 409.18 401.19z" />
<glyph glyph-name="exclamation "
unicode="&#xF102;"
horiz-adv-x="500" d=" M197.11 71.07C189.79 113.89 228.76 151.16 270.9500000000001 140.79C296.8300000000001 134.43 313.1700000000001 112.12 313.7200000000001 82.85C313.7200000000001 48.6899999999999 290.7200000000001 23.0699999999999 255.2500000000001 23.0699999999999C224 23.07 201.91 43 197.11 71.07zM217.35 184.54L203.21 463A9.55 9.55 0 0 0 212.74 473H297.13A9.54 9.54 0 0 0 306.66 463L293.14 184.5A9.55 9.55 0 0 0 283.6 175.42H226.88A9.54 9.54 0 0 0 217.35 184.54z" />
<glyph glyph-name="happy"
unicode="&#xF103;"
horiz-adv-x="500" d=" M250 455.42C135.75 455.42 43.19 362.85 43.19 248.61S135.75 41.8 250 41.8S456.81 134.36 456.81 248.61S364.25 455.42 250 455.42zM250 86.61C160.66 86.61 88 159.26 88 248.61S160.66 410.61 250 410.61S412 337.9500000000001 412 248.61S339.34 86.61 250 86.61zM338.06 208.0800000000001C316.46 201.16 284.36 197.15 250 197.15S183.62 201.15 161.94 208.0800000000001A11.46 11.46 0 0 1 147.18 195.3200000000001C153.77 156 206.64 128.61 250 128.61S346.15 156 352.82 195.32A11.49 11.49 0 0 1 338.06 208.08z M164.8 307.99C164.8 293.9288302693081 176.198830269308 282.53 190.26 282.53C204.321169730692 282.53 215.72 293.9288302693081 215.72 307.99C215.72 322.051169730692 204.321169730692 333.4500000000001 190.26 333.4500000000001C176.198830269308 333.4500000000001 164.8 322.051169730692 164.8 307.99z M284.2800000000001 307.99C284.2800000000001 293.9288302693081 295.678830269308 282.53 309.74 282.53C323.8011697306921 282.53 335.2 293.9288302693081 335.2 307.99C335.2 322.051169730692 323.8011697306921 333.4500000000001 309.74 333.4500000000001C295.678830269308 333.4500000000001 284.2800000000001 322.051169730692 284.2800000000001 307.99z" />
<glyph glyph-name="lightning"
unicode="&#xF104;"
horiz-adv-x="500" d=" M179.53 434.4L147.33 214.4A5 5 0 0 1 152.33 208.62H232.5L211.43 36.82A3.1699999999999995 3.1699999999999995 0 0 1 217.37 34.82L334.11 263.7200000000001A5 5 0 0 1 329.6500000000001 271.13H296.34L359.39 432.13A5.05 5.05 0 0 1 354.68 439L184.51 438.7200000000001A5 5 0 0 1 179.53 434.4z" />
<glyph glyph-name="sad"
unicode="&#xF105;"
horiz-adv-x="500" d=" M186.73 146.27A23.5 23.5 0 0 0 169 184.74C170.48 186.53 205.87 228.6600000000001 256.57 229.52C287.73 230.07 316.69 215.52 342.57 186.23A23.5 23.5 0 0 0 307.38 155.0699999999999C291 173.5799999999999 274.15 182.8199999999999 257.38 182.5299999999999C228.53 182.0399999999999 205.45 155.0699999999999 205.23 154.7999999999999A23.44 23.44 0 0 0 186.73 146.27z M250 455.42C135.75 455.42 43.19 362.85 43.19 248.61S135.75 41.8 250 41.8S456.81 134.36 456.81 248.61S364.25 455.42 250 455.42zM250 86.61C160.66 86.61 88 159.26 88 248.61S160.66 410.61 250 410.61S412 337.9500000000001 412 248.61S339.34 86.61 250 86.61z M164.8 307.99C164.8 293.9288302693081 176.198830269308 282.53 190.26 282.53C204.321169730692 282.53 215.72 293.9288302693081 215.72 307.99C215.72 322.051169730692 204.321169730692 333.4500000000001 190.26 333.4500000000001C176.198830269308 333.4500000000001 164.8 322.051169730692 164.8 307.99z M284.2800000000001 307.99C284.2800000000001 293.9288302693081 295.678830269308 282.53 309.74 282.53C323.8011697306921 282.53 335.2 293.9288302693081 335.2 307.99C335.2 322.051169730692 323.8011697306921 333.4500000000001 309.74 333.4500000000001C295.678830269308 333.4500000000001 284.2800000000001 322.051169730692 284.2800000000001 307.99z" />
<glyph glyph-name="thumbsup"
unicode="&#xF106;"
horiz-adv-x="500" d=" M382.92 164.1C393.2100000000001 146.8 388.05 125.1 372.99 116C370.23 114.33 369.17 110.67 369.6600000000001 107.48C375.79 68.03 352.75 51.61 321.8300000000001 51.61H287.37C226.19 51.61 185.23 81.88 140.11 85.68A9.94 9.94 0 0 0 130.99 95.59V245.74A10 10 0 0 0 140.94 255.69H140.94C166.78 255.69 202.88 320.27 227.07 344.48C250.79 368.2000000000001 245.48 406.48 257.78 425.88A9.93 9.93 0 0 0 266.78 430.4600000000001C304.63 428.1 304.63 399.6500000000001 304.63 378.93C304.63 347.51 284.63 331.36 279.81 304.4400000000001A10 10 0 0 1 289.62 292.79H373.5C392.74 292.79 407.88 275.5700000000001 407.96 258.3400000000001C408.02 245.9600000000001 401.96 233.5800000000001 395.35 227.5900000000001C392.07 224.59 390.78 219.7600000000001 393.05 215.96C401.64 201.5000000000001 407.39 180.24 381.92 165.5000000000001z" />
<glyph glyph-name="times"
unicode="&#xF107;"
horiz-adv-x="500" d=" M300.9100000000001 250L450.46 399.54A36 36 0 0 1 399.54 450.46L250 300.91L100.46 450.46A36 36 0 0 1 49.54 399.54L199.09 250L49.54 100.46A36 36 0 0 1 100.46 49.54L250 199.09L399.54 49.54A36 36 0 0 1 450.46 100.46z" />
</font>
</defs>
</svg>
......@@ -53,7 +53,7 @@ class InventoryController extends AbstractController
$link = $importForm->get('link')->getData();
$json = $importForm->get('json')->getData();
$png = $importForm->get('png')->getData();
$this->importService->importLink();
$this->importService->importLink($link);
}
......
......@@ -61,9 +61,9 @@ class Recipient
$this->email = $email;
}
public function getHash() : array
public function getHash(string $salt = null) : array
{
$salt = bin2hex(random_bytes(16));
$salt = $salt ?? bin2hex(random_bytes(16));
$hash = 'sha256$' . hash('sha256', $this->getEmail() . $salt);
return [$salt, $hash];
......
......@@ -29,7 +29,7 @@ class CreationService
$this->jsonService = $jsonService;
}
public function unsetAllEmptyStrings(array $data)
public function unsetAllEmptyStrings(array $data) : array
{
return array_filter($data, static function (&$element) {
return $element !== '';
......@@ -123,6 +123,9 @@ class CreationService
if (!$this->jsonService->isRequestValid('issuer', $data)) {
return null;
}
if(!isset($data['owner'])) {
$data['owner'] = $data['email'];
}
// required
$owner = !filter_var($data['owner'], FILTER_VALIDATE_EMAIL)
? $this->registry->getRepository(Recipient::class)->find($data['owner'])
......@@ -147,6 +150,7 @@ class CreationService
$issuer->setDescription($description);
$issuer->setUrl($url);
$issuer->setTelephone($telephone);
$issuer->setImage($image);
$recipientRepo = $this->registry->getRepository(Recipient::class);
foreach ($employees as $employee) {
......@@ -176,7 +180,8 @@ class CreationService
$object = $this->{$createFunction}($data);
} elseif (filter_var($data, FILTER_VALIDATE_URL)) {
$json = file_get_contents($data);
$object = $this->{$createFunction}($json);
$jsonArray = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
$object = $this->{$createFunction}($jsonArray);
} else {
$object = $this->registry->getRepository("App\\Entity\\" . ucfirst($resource))->find($data);
}
......@@ -251,7 +256,11 @@ class CreationService
&& filter_var($data['image'], FILTER_VALIDATE_URL)
&& (str_ends_with($data['image'], '.png') || str_ends_with($data['image'], '.svg'))
? $data['image'] : null;
$issuedOn = $data['issuedOn'] ?? new \DateTimeImmutable('NOW');
if(isset($data['issuedOn'])) {
$issuedOn = is_string($data['issuedOn']) ? new \DateTimeImmutable($data['issuedOn']): $data['issuedOn'];
} else {
$issuedOn = new \DateTimeImmutable('NOW');
}
$expiresAt = $data['expiresAt'] ?? null;
$revoked = $data['revoked'] ?? false;
$narrative = $data['narrative'] ?? null;
......
......@@ -3,18 +3,35 @@
namespace App\Services;
use Doctrine\Persistence\ManagerRegistry;
use App\Entity\User;
use Exception;
class ImportService
{
private ManagerRegistry $registry;
private CreationService $creationService;
public function __construct(ManagerRegistry $registry)
{
public function __construct(
ManagerRegistry $registry,
CreationService $creationService,
ResourceIdentifierService $resourceIdentifierService
) {
$this->registry = $registry;
$this->creationService = $creationService;
$this->resourceIdentifierService = $resourceIdentifierService;
}
public function importLink() : void
public function importLink(string $link) : void
{
echo $this->registry->getName();
if (filter_var($link, FILTER_VALIDATE_URL)) {
$json = file_get_contents($link);
$assignment = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
$recipient = $this->resourceIdentifierService->identifyEmail($assignment['recipient']);
if(!$recipient) {
throw new Exception('You donnt own this Bagde');
}
$assignment['email'] = $recipient->getEmail();
$this->creationService->createAssignment($assignment);
}
}
}
\ No newline at end of file