Skip to content

Commit

Permalink
Fixed a few errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkBrines committed Nov 14, 2024
1 parent 309afc3 commit 39ab427
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ resources/css/styles.css
resources/css/styles.css.map
public/assets
package-lock.json

public/public_apps
2 changes: 1 addition & 1 deletion app/Controllers/Http/StoreController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default class StoreController {
if (erase !== undefined)
response.redirect('/store/myapps')
else
response.redirect('/store/apps')
response.redirect('/store')

console.log('Starting folder upload')

Expand Down
5 changes: 4 additions & 1 deletion app/Middleware/SilentAuth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import { UserType } from 'App/Models/User'

/**
* Silent auth middleware can be used as a global middleware to silent check
Expand All @@ -10,12 +11,14 @@ export default class SilentAuthMiddleware {
/**
* Handle request
*/
public async handle ({ auth }: HttpContextContract, next: () => Promise<void>) {
public async handle({ auth, view }: HttpContextContract, next: () => Promise<void>) {
/**
* Check if user is logged-in or not. If yes, then `ctx.auth.user` will be
* set to the instance of the currently logged in user.
*/
await auth.check()

view.share({ admin: auth.user?.type == UserType.ADMIN, user: auth.user })
await next()
}
}
17 changes: 9 additions & 8 deletions resources/views/store/store_container.edge
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Store
<div class="row">
<div style="width: 100%;">
<div style="float:left; min-width: 200px; margin-bottom: 50px; border-color: black; border-right-width: 1px;">
<div style="width: 200px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 15px; display: inline-flex">
<div
style="width: 200px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 15px; display: inline-flex">
<div style="color: #828282; font-size: 25px;">Catégories</div>
<a href="/store/" style="color: #837979; font-size: 20px;">Toutes</a>
<a href="/store/?type=0" style="color: #382222; font-size: 20px;">Productivité</a>
Expand All @@ -24,21 +25,21 @@ Store
<a href="/store/?type=3" style="color: #382222; font-size: 20px;">Jeux</a>
<a href="/store/?type=4" style="color: #382222; font-size: 20px;">Multimédia</a>
<a href="/store/?type=5" style="color: #382222; font-size: 20px;">Autres</a>

@if (user)
<a href="/dash" style="color: #828282; font-size: 25px; margin-top: 20px;">Mon Compte</a>
<a href="/store/mypaxo" style="color: #382222; font-size: 20px;">Mon Appareil</a>
<a href="/store/myapps" style="color: #382222; font-size: 20px;">Mes Applications</a>
<a href="/dash" style="color: #828282; font-size: 25px; margin-top: 20px;">Mon Compte</a>
<!-- <a href="/store/mypaxo" style="color: #382222; font-size: 20px;">Mon Appareil</a> -->
<a href="/store/myapps" style="color: #382222; font-size: 20px;">Mes Applications</a>
@else
<a href="/auth/login" style="color: #828282; font-size: 25px; margin-top: 20px;">Connexion</a>
<a href="/auth/login" style="color: #828282; font-size: 25px; margin-top: 20px;">Connexion</a>
@end
</div>
</div>
</div>

<div style="float:left; width: calc(100% - 300px); text-align:left;">
{{{ await $slots.main() }}}
</div>
</div>
</div>
</div>
</section>
@endsection

0 comments on commit 39ab427

Please sign in to comment.