Skip to content

Commit ad4fe61

Browse files
committed
edit items and update
1 parent f3a0628 commit ad4fe61

15 files changed

+293
-24
lines changed

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "pamescan-d3c14"
4+
}
5+
}

database.rules.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"rules": {
3+
//".read": "auth != null",
4+
".read": true,
5+
".write": "auth != null"
6+
}
7+
}

firebase.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"database": {
3+
"rules": "database.rules.json"
4+
},
5+
"hosting": {
6+
"public": "build/web",
7+
"rewrites": [
8+
{
9+
"source": "**",
10+
"destination": "/index.html"
11+
}
12+
]
13+
}
14+
}

lib/app_header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<nav class="mdl-navigation">
77
<ul>
88
<li id="profile" >
9-
<img [hidden]="!showProfile"src="{{firebaseService.user?.photoURL}}" width="40" height="40" ) >
9+
<img [hidden]="!showProfile"src="{{firebaseService.user?.photoURL}}" width="40" height="40" >
1010
<p [hidden]="!showProfile"> {{firebaseService.user?.displayName}} ({{firebaseService.user?.email}})</p>
1111
<a [hidden]="!showProfile" href="#" class="mdl-button mdl-button--raised mdl-button--accent" (click)="onLogOut()">Sign Out</a>
1212
</li>

lib/app_main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<app-header></app-header>
22

3-
<main class="mdl-layout__content">
3+
<main class="center">
44
<div id="container">
55
<nav>
66
<a [routerLink]="['Index']">Index</a>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import 'package:angular2/core.dart';
2+
import 'package:pamescan/items/SimplePost.dart';
3+
import 'package:angular2_components/angular2_components.dart';
4+
5+
@Component(
6+
selector: 'card-simple-post',
7+
styleUrls: const ['card_simple_post.css'],
8+
templateUrl: 'card_simple_post.html',
9+
directives: const [materialDirectives],
10+
providers: const [],
11+
)
12+
class CardSimplePost {
13+
@Input() SimplePost post;
14+
@Output() EventEmitter<String> delete=new EventEmitter<String>();
15+
@Output() EventEmitter<String> edit=new EventEmitter<String>();
16+
17+
onClickDelete(){
18+
19+
this.delete.emit(post.key);
20+
}
21+
22+
onClickEdit(){
23+
this.edit.emit(post.key);
24+
25+
}
26+
27+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div class="card" id="post-{{post.key}}">
2+
<div class="card-image">
3+
<img class="img-responsive" src="{{post.imageUrl}}">
4+
<span class="card-title">{{post.title}}</span>
5+
</div>
6+
7+
<div class="card-content">
8+
<p>{{post.text}}</p>
9+
</div>
10+
11+
<div class="card-action">
12+
<!--<a >Link</a>
13+
<a >Link</a>
14+
<a >Link</a>-->
15+
<material-button (click)="onClickEdit()"><glyph icon="edit"></glyph></material-button>
16+
<material-button (click)="onClickDelete()"><glyph icon="delete"></glyph></material-button>
17+
<!--<a ><glyph icon="delete"></glyph></a>
18+
<a><i class="material-icons">delete</i></a>-->
19+
</div>
20+
</div>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import 'package:angular2/core.dart';
2+
import 'package:pamescan/items/SimplePost.dart';
3+
import 'package:angular2_components/angular2_components.dart';
4+
5+
@Component(
6+
selector: 'card-simple-post-edit',
7+
styleUrls: const ['card_simple_post.css'],
8+
templateUrl: 'card_simple_post_edit.html',
9+
directives: const [materialDirectives],
10+
providers: const [],
11+
)
12+
class CardSimplePostEdit {
13+
@Input() SimplePost post;
14+
@Input() bool isVisible;
15+
@Output() EventEmitter<SimplePost> onUpdate=new EventEmitter<SimplePost>();
16+
@Output() EventEmitter isVisibleChange=new EventEmitter();
17+
18+
19+
20+
onClickUpdate() {
21+
this.onUpdate.emit(post);
22+
23+
}
24+
25+
onClickCancel() {
26+
this.isVisibleChange.emit(false);
27+
}
28+
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<modal [visible]="isVisible">
2+
<material-dialog class="max-height-dialog">
3+
4+
<!--<h3 header>Edit post</h3>-->
5+
6+
7+
<div class="mdl-grid">
8+
<h2 class="mdl-cell mdl-cell--12-col">Add new awesome note</h2>
9+
<div class="mdl-cell mdl-cell--6-col mdl-cell--12-col-phone mdl-cell--12-col-tablet">
10+
<material-input floatingLabel label="Title" [(ngModel)]="post.title"></material-input><br>
11+
<material-input floatingLabel multiline rows="5" label="Content" [(ngModel)]="post.text"></material-input>
12+
</div>
13+
<div class="mdl-cell mdl-cell--6-col mdl-cell--12-col-phone mdl-cell--12-col-tablet" id="note-image">
14+
<label for="upload-image">Attach image</label><br>
15+
<material-input floatingLabel leadingGlyph="link" label="Link" [(ngModel)]="post.imageUrl"></material-input><br>
16+
<label>OR</label><br>
17+
<input type="file" id="upload-image" accept="image/*" disabled>
18+
</div>
19+
20+
</div>
21+
22+
23+
<div footer>
24+
25+
<material-button class="white" (click)="onClickUpdate()">
26+
<glyph icon="update"></glyph>
27+
Update
28+
</material-button>
29+
<material-button autoFocus (click)="onClickCancel()" class="white">
30+
<glyph icon="cancel"></glyph>
31+
Cancel
32+
</material-button>
33+
</div>
34+
35+
</material-dialog>
36+
</modal>

lib/pages/gallery/page_gallery.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
3+
body {
4+
5+
font-size: 18px
6+
}
7+
8+
9+
10+
11+
12+
.cards-row {
13+
padding-top: 40px;
14+
padding-bottom: 20px;
15+
background: #eee
16+
}
17+
18+
.thumbnail {
19+
padding: 0;
20+
border-radius: 0;
21+
border: none;
22+
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12)
23+
}
24+
25+
.thumbnail>img {
26+
width: 100%;
27+
display: block
28+
}
29+
30+
.thumbnail h3 {
31+
font-size: 26px
32+
}
33+
34+
.thumbnail h3,
35+
.card-description {
36+
margin: 0;
37+
padding: 8px 0;
38+
border-bottom: solid 1px #eee;
39+
text-align: justify
40+
}
41+
42+
.thumbnail p {
43+
padding-top: 8px;
44+
font-size: 20px
45+
}
46+
47+
.thumbnail .btn {
48+
border-radius: 0;
49+
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12);
50+
font-size: 20px
51+
}
52+

0 commit comments

Comments
 (0)