Updated Admin & Login Page design, also finally disabled mouse & touch controls for bg effect for Mrxikaiba
This commit is contained in:
1 parent
0907f0b66b
commit
f9e0eb32db
11 files changed
+88
-35
No files matched your search
@@ -11,7 +11,7 @@
|
||||
|
||||
.admin-container {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border-radius: 25px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
padding: 40px;
|
||||
width: 350px;
|
||||
@@ -25,17 +25,31 @@
|
||||
}
|
||||
|
||||
.admin-actions button {
|
||||
background-color: #4CAF50;
|
||||
background-color: #bd3948;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
margin: 10px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
border-radius: 25px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.admin-actions button:hover {
|
||||
background-color: #45a049;
|
||||
background-color: #e3485a;
|
||||
}
|
||||
|
||||
.logout button {
|
||||
background-color: #713252;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
margin: 10px;
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.logout button:hover {
|
||||
background-color: #592840;
|
||||
}
|
||||
|
||||
.articles-list {
|
||||
|
||||
@@ -5,17 +5,25 @@
|
||||
<div class="admin-actions">
|
||||
<button (click)="createArticle()">Create Article</button>
|
||||
<button (click)="viewArticles()">View Articles</button>
|
||||
<button (click)="logout()">Logout</button>
|
||||
<button (click)="editArticle()">Edit Article</button>
|
||||
<button (click)="deleteArticle()">Delete Article</button>
|
||||
</div>
|
||||
|
||||
<div *ngIf="articles && articles.length > 0">
|
||||
<h3>Articles</h3>
|
||||
<div class="articles-list">
|
||||
<div *ngFor="let article of articles" class="article">
|
||||
<h4>{{ article.title }}</h4>
|
||||
<p>{{ article.content }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="noArticles">
|
||||
<p>No articles available.</p> <!-- Show message if no articles -->
|
||||
</div>
|
||||
|
||||
<div *ngIf="!noArticles">
|
||||
<ul>
|
||||
<li *ngFor="let article of articles">
|
||||
<!-- Display article details here -->
|
||||
{{ article.title }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="logout">
|
||||
<button (click)="logout()">Logout</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -16,6 +16,7 @@ import { HttpClientModule } from '@angular/common/http';
|
||||
})
|
||||
export class AdminComponent implements OnInit {
|
||||
articles: any[] = [];
|
||||
noArticles: boolean = false;
|
||||
|
||||
constructor(private articleService: ArticleService, private router: Router) {}
|
||||
|
||||
@@ -34,6 +35,7 @@ export class AdminComponent implements OnInit {
|
||||
this.articleService.getArticles(token).subscribe(
|
||||
(data) => {
|
||||
this.articles = data;
|
||||
this.noArticles = this.articles.length === 0;
|
||||
},
|
||||
(error) => {
|
||||
console.error('Failed to load articles', error);
|
||||
@@ -45,6 +47,14 @@ export class AdminComponent implements OnInit {
|
||||
alert('Create article functionality goes here');
|
||||
}
|
||||
|
||||
editArticle() {
|
||||
alert('Delete article functionality goes here');
|
||||
}
|
||||
|
||||
deleteArticle() {
|
||||
alert('Delete article functionality goes here');
|
||||
}
|
||||
|
||||
viewArticles() {
|
||||
this.fetchArticles();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user