diff --git a/static/.editorconfig b/static/.editorconfig
new file mode 100644
index 00000000..6e87a003
--- /dev/null
+++ b/static/.editorconfig
@@ -0,0 +1,13 @@
+# Editor configuration, see http://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+max_line_length = off
+trim_trailing_whitespace = false
diff --git a/static/src/components/boards/boards-list.component.html b/static/src/components/boards/boards-list.component.html
index 78a2d381..d49644ea 100644
--- a/static/src/components/boards/boards-list.component.html
+++ b/static/src/components/boards/boards-list.component.html
@@ -81,7 +81,7 @@
New Board
-
+
diff --git a/static/src/components/boards/boards-list.component.ts b/static/src/components/boards/boards-list.component.ts
index 12456b6f..5fdc436e 100644
--- a/static/src/components/boards/boards-list.component.ts
+++ b/static/src/components/boards/boards-list.component.ts
@@ -31,7 +31,7 @@ export class BoardsListComponent implements OnInit {
public addForm = new FormGroup({
name: new FormControl('', Validators.required),
description: new FormControl('', Validators.required),
- seed: new FormControl('', Validators.required),
+ seed: new FormControl({ value: '', disabled: true }, Validators.required),
addresses: new FormControl(''),
});
public tmpBoard: Board = null;
@@ -52,7 +52,7 @@ export class BoardsListComponent implements OnInit {
}
setSort() {
- this.sort = this.sort === 'desc' ? 'esc' : 'desc';
+ this.sort = this.sort === 'desc' ? 'asc' : 'desc';
}
getBoards() {
@@ -123,24 +123,29 @@ export class BoardsListComponent implements OnInit {
openAdd(content) {
this.addForm.reset();
- this.modal.open(content).result.then((result) => {
- if (result === true) {
- if (!this.addForm.valid) {
- this.common.showErrorAlert('Parameter error');
- return;
+ this.api.generateSeed().subscribe(seed => {
+ this.addForm.patchValue({ seed: seed });
+ this.modal.open(content).result.then((result) => {
+ if (result === true) {
+ if (!this.addForm.valid) {
+ this.common.showErrorAlert('Parameter error');
+ return;
+ }
+ const data = new FormData();
+ data.append('name', this.addForm.get('name').value);
+ data.append('description', this.addForm.get('description').value);
+ data.append('seed', this.addForm.get('seed').value);
+ data.append('submission_addresses', this.addForm.get('addresses').value);
+ this.api.addBoard(data).subscribe(res => {
+ this.getBoards();
+ this.common.showSucceedAlert('Added Successfully');
+ });
}
- const data = new FormData();
- data.append('name', this.addForm.get('name').value);
- data.append('description', this.addForm.get('description').value);
- data.append('seed', this.addForm.get('seed').value);
- data.append('submission_addresses', this.addForm.get('addresses').value);
- this.api.addBoard(data).subscribe(res => {
- this.getBoards();
- this.common.showSucceedAlert('Added Successfully');
- });
- }
+ }, err => {
+ });
}, err => {
- });
+ this.common.showErrorAlert('Unable to create,Please try again later');
+ })
}
delAddress(ev: Event, key: string, address: string) {
diff --git a/static/src/components/fixed-button/fixed-button.component.html b/static/src/components/fixed-button/fixed-button.component.html
index ae180b2e..d097dca0 100644
--- a/static/src/components/fixed-button/fixed-button.component.html
+++ b/static/src/components/fixed-button/fixed-button.component.html
@@ -1 +1 @@
-
+
diff --git a/static/src/components/fixed-button/fixed-button.component.scss b/static/src/components/fixed-button/fixed-button.component.scss
index 980124f6..44b96500 100644
--- a/static/src/components/fixed-button/fixed-button.component.scss
+++ b/static/src/components/fixed-button/fixed-button.component.scss
@@ -2,7 +2,7 @@ app-fixed-button {
position: fixed;
display: flex;
cursor: pointer;
- bottom: 10%;
+ bottom: 15%;
right: 5%;
width: 60px;
height: 60px;
@@ -17,4 +17,4 @@ app-fixed-button {
font-size: 1.5em;
color: #fff;
}
-}
\ No newline at end of file
+}
diff --git a/static/src/components/thread-page/threadPage.component.scss b/static/src/components/thread-page/threadPage.component.scss
index 278d43d7..e6391cbc 100644
--- a/static/src/components/thread-page/threadPage.component.scss
+++ b/static/src/components/thread-page/threadPage.component.scss
@@ -3,7 +3,7 @@ app-threadpage {
display: inline-block;
background-repeat: no-repeat;
width: 1rem;
- height: 1rem;
+ height: 1rem;
min-width: 20px;
min-height: 20px;
}
@@ -141,6 +141,7 @@ app-threadpage {
bottom: 0;
left: 0;
right: 0;
+ z-index: 9999;
background-color: transparent;
}
.author-menu {
diff --git a/static/src/components/thread-page/threadPage.component.ts b/static/src/components/thread-page/threadPage.component.ts
index 9fa266f5..767ac76e 100644
--- a/static/src/components/thread-page/threadPage.component.ts
+++ b/static/src/components/thread-page/threadPage.component.ts
@@ -81,19 +81,17 @@ export class ThreadPageComponent implements OnInit, OnDestroy {
this.threadKey = res['thread'];
this.open(this.boardKey, this.threadKey);
});
- setTimeout(() => {
- this.common.fb.display = 'flex';
- this.common.fb.handle = () => {
- this.openReply(this.replyBox);
- }
- }, 2000);
+ this.common.fb.display = 'flex';
+ this.common.fb.handle = () => {
+ this.openReply(this.replyBox);
+ }
}
ngOnDestroy() {
this.common.fb.display = 'none';
this.common.fb.handle = null;
}
public setSort() {
- this.sort = this.sort === 'desc' ? 'esc' : 'desc';
+ this.sort = this.sort === 'desc' ? 'asc' : 'desc';
}
addThreadVote(mode: string, thread: Thread, ev: Event) {
ev.stopImmediatePropagation();
diff --git a/static/src/pipes/orderBy/order-by.pipe.ts b/static/src/pipes/orderBy/order-by.pipe.ts
index 45e42d48..31926950 100644
--- a/static/src/pipes/orderBy/order-by.pipe.ts
+++ b/static/src/pipes/orderBy/order-by.pipe.ts
@@ -24,7 +24,7 @@ export class OrderByPipe implements PipeTransform {
return 0;
});
break;
- case 'esc':
+ case 'asc':
values.sort((a, b) => {
if (a.created > b.created) {
return -1;