Skip to content

Commit fa8d986

Browse files
author
Ervin
committed
update
1 parent 0005388 commit fa8d986

File tree

8 files changed

+582
-15
lines changed

8 files changed

+582
-15
lines changed

App/auth/Auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function getUserId() {
7777
}
7878

7979
export async function getUserToken() {
80-
return await AsyncStorage.getItem("token")
80+
return await AsyncStorage.getItem("token")
8181
}
8282

8383
export const onSignOut = () => AsyncStorage.removeItem("token");

Web/public/css/user.css

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
body {
2+
color: #566787;
3+
background: #2C5077;
4+
font-family: 'Varela Round', sans-serif;
5+
font-size: 13px;
6+
}
7+
.table-wrapper {
8+
background: #fff;
9+
padding: 20px 25px;
10+
margin: 60px 0 30px 0;
11+
border-radius: 3px;
12+
box-shadow: 0 1px 1px rgba(0,0,0,.05);
13+
}
14+
.table-title {
15+
padding-bottom: 15px;
16+
/*background: #435d7d;*/
17+
/*color: #fff;*/
18+
padding: 16px 30px;
19+
margin: -20px -25px 10px;
20+
border-radius: 3px 3px 0 0;
21+
}
22+
.table-title h2 {
23+
margin: 5px 0 0;
24+
font-size: 24px;
25+
}
26+
.table-title .btn-group {
27+
float: right;
28+
}
29+
.table-title .btn {
30+
color: #fff;
31+
float: right;
32+
font-size: 13px;
33+
border: none;
34+
min-width: 50px;
35+
border-radius: 2px;
36+
border: none;
37+
outline: none !important;
38+
margin-left: 10px;
39+
}
40+
.table-title .btn i {
41+
float: left;
42+
font-size: 21px;
43+
margin-right: 5px;
44+
}
45+
.table-title .btn span {
46+
float: left;
47+
margin-top: 2px;
48+
}
49+
table.table tr th, table.table tr td {
50+
border-color: #e9e9e9;
51+
padding: 12px 15px;
52+
vertical-align: middle;
53+
}
54+
table.table tr th:first-child {
55+
width: 60px;
56+
}
57+
table.table tr th:last-child {
58+
width: 100px;
59+
}
60+
table.table-striped tbody tr:nth-of-type(odd) {
61+
background-color: #fcfcfc;
62+
}
63+
table.table-striped.table-hover tbody tr:hover {
64+
background: #f5f5f5;
65+
}
66+
table.table th i {
67+
font-size: 13px;
68+
margin: 0 5px;
69+
cursor: pointer;
70+
}
71+
table.table td:last-child i {
72+
opacity: 0.9;
73+
font-size: 22px;
74+
margin: 0 5px;
75+
}
76+
table.table td a {
77+
font-weight: bold;
78+
color: #566787;
79+
display: inline-block;
80+
text-decoration: none;
81+
outline: none !important;
82+
}
83+
table.table td a:hover {
84+
color: #2196F3;
85+
}
86+
table.table td a.edit {
87+
color: #FFC107;
88+
}
89+
table.table td a.delete {
90+
color: #F44336;
91+
}
92+
table.table td i {
93+
font-size: 19px;
94+
}
95+
table.table .avatar {
96+
border-radius: 50%;
97+
vertical-align: middle;
98+
margin-right: 10px;
99+
}
100+
.pagination {
101+
float: right;
102+
margin: 0 0 5px;
103+
}
104+
.pagination li a {
105+
border: none;
106+
font-size: 13px;
107+
min-width: 30px;
108+
min-height: 30px;
109+
color: #999;
110+
margin: 0 2px;
111+
line-height: 30px;
112+
border-radius: 2px !important;
113+
text-align: center;
114+
padding: 0 6px;
115+
}
116+
.pagination li a:hover {
117+
color: #666;
118+
}
119+
.pagination li.active a, .pagination li.active a.page-link {
120+
background: #03A9F4;
121+
}
122+
.pagination li.active a:hover {
123+
background: #0397d6;
124+
}
125+
.pagination li.disabled i {
126+
color: #ccc;
127+
}
128+
.pagination li i {
129+
font-size: 16px;
130+
padding-top: 6px
131+
}
132+
.hint-text {
133+
float: left;
134+
margin-top: 10px;
135+
font-size: 13px;
136+
}
137+
/* Custom checkbox */
138+
.custom-checkbox {
139+
position: relative;
140+
}
141+
.custom-checkbox input[type="checkbox"] {
142+
opacity: 0;
143+
position: absolute;
144+
margin: 5px 0 0 3px;
145+
z-index: 9;
146+
}
147+
.custom-checkbox label:before{
148+
width: 18px;
149+
height: 18px;
150+
}
151+
.custom-checkbox label:before {
152+
content: '';
153+
margin-right: 10px;
154+
display: inline-block;
155+
vertical-align: text-top;
156+
background: white;
157+
border: 1px solid #bbb;
158+
border-radius: 2px;
159+
box-sizing: border-box;
160+
z-index: 2;
161+
}
162+
.custom-checkbox input[type="checkbox"]:checked + label:after {
163+
content: '';
164+
position: absolute;
165+
left: 6px;
166+
top: 3px;
167+
width: 6px;
168+
height: 11px;
169+
border: solid #000;
170+
border-width: 0 3px 3px 0;
171+
transform: inherit;
172+
z-index: 3;
173+
transform: rotateZ(45deg);
174+
}
175+
.custom-checkbox input[type="checkbox"]:checked + label:before {
176+
border-color: #03A9F4;
177+
background: #03A9F4;
178+
}
179+
.custom-checkbox input[type="checkbox"]:checked + label:after {
180+
border-color: #fff;
181+
}
182+
.custom-checkbox input[type="checkbox"]:disabled + label:before {
183+
color: #b8b8b8;
184+
cursor: auto;
185+
box-shadow: none;
186+
background: #ddd;
187+
}
188+
/* Modal styles */
189+
.modal .modal-dialog {
190+
max-width: 400px;
191+
}
192+
.modal .modal-header, .modal .modal-body, .modal .modal-footer {
193+
padding: 20px 30px;
194+
}
195+
.modal .modal-content {
196+
border-radius: 3px;
197+
}
198+
.modal .modal-footer {
199+
background: #ecf0f1;
200+
border-radius: 0 0 3px 3px;
201+
}
202+
.modal .modal-title {
203+
display: inline-block;
204+
}
205+
.modal .form-control {
206+
border-radius: 2px;
207+
box-shadow: none;
208+
border-color: #dddddd;
209+
}
210+
.modal textarea.form-control {
211+
resize: vertical;
212+
}
213+
.modal .btn {
214+
border-radius: 2px;
215+
min-width: 100px;
216+
}
217+
.modal form label {
218+
font-weight: normal;
219+
}

Web/src/Controller/SecurityController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ public function login(AuthenticationUtils $authenticationUtils): Response
7474
return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
7575
}
7676

77+
/**
78+
* @Route("/user", name="user")
79+
*/
80+
public function user()
81+
{
82+
return $this->render('user/index.html.twig');
83+
}
84+
7785
/**
7886
* @Route("/logout", name="app_logout")
7987
*/

Web/src/Entity/Course.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class Course
4949
*/
5050
private $createdAt;
5151

52+
5253
/**
5354
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="courses")
5455
* @ORM\JoinColumn(nullable=false)
@@ -108,7 +109,7 @@ public function setTime(\DateTimeInterface $time): self
108109
return $this;
109110
}
110111

111-
public function getCoordinates(): ?string
112+
public function getCoordinates(): ?array
112113
{
113114
return $this->coordinates;
114115
}
@@ -131,4 +132,14 @@ public function setUser(?User $user): self
131132

132133
return $this;
133134
}
135+
136+
public function getCreatedAt(): ?\DateTime
137+
{
138+
return $this->createdAt;
139+
}
140+
141+
public function setCreatedAt(\DateTime $createdAt): self
142+
{
143+
$this->createdAt = $createdAt;
144+
}
134145
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20200329160445 extends AbstractMigration
14+
{
15+
public function getDescription() : string
16+
{
17+
return '';
18+
}
19+
20+
public function up(Schema $schema) : void
21+
{
22+
// this up() migration is auto-generated, please modify it to your needs
23+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
24+
25+
$this->addSql('ALTER TABLE course CHANGE created_at created_at DATETIME DEFAULT NULL');
26+
}
27+
28+
public function down(Schema $schema) : void
29+
{
30+
// this down() migration is auto-generated, please modify it to your needs
31+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
32+
33+
$this->addSql('ALTER TABLE course CHANGE created_at created_at DATETIME NOT NULL');
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20200329161816 extends AbstractMigration
14+
{
15+
public function getDescription() : string
16+
{
17+
return '';
18+
}
19+
20+
public function up(Schema $schema) : void
21+
{
22+
// this up() migration is auto-generated, please modify it to your needs
23+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
24+
25+
$this->addSql('ALTER TABLE course CHANGE created_at created_at DATETIME NOT NULL');
26+
}
27+
28+
public function down(Schema $schema) : void
29+
{
30+
// this down() migration is auto-generated, please modify it to your needs
31+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
32+
33+
$this->addSql('ALTER TABLE course CHANGE created_at created_at DATETIME DEFAULT NULL');
34+
}
35+
}

Web/templates/base.html.twig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@
1313

1414
<body>
1515

16+
<nav class="navbar navbar-expand-lg navbar-light bg-light">
17+
<a class="navbar-brand" href="#">Navbar</a>
18+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
19+
<span class="navbar-toggler-icon"></span>
20+
</button>
21+
<div class="collapse navbar-collapse" id="navbarNav">
22+
<ul class="navbar-nav">
23+
<li class="nav-item active">
24+
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
25+
</li>
26+
<li class="nav-item">
27+
<a class="nav-link" href="#">Features</a>
28+
</li>
29+
<li class="nav-item">
30+
<a class="nav-link" href="#">Pricing</a>
31+
</li>
32+
<li class="nav-item">
33+
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
34+
</li>
35+
</ul>
36+
</div>
37+
</nav>
38+
1639
<div class="container-fluid">
1740
{% block body %}{% endblock %}
1841
</div>

0 commit comments

Comments
 (0)