wip private

This commit is contained in:
simplonco
2023-01-13 01:07:39 +01:00
parent 27bbb6346f
commit 23d1810226
3 changed files with 20 additions and 20 deletions

View File

@@ -8,7 +8,7 @@ export class roomDto
@IsString()
@IsNotEmpty()
@IsIn(["public", "protected", "private", "direct", "user"])
@IsIn(["public", "private", "direct", "user"])
type: string;
@IsString()

View File

@@ -18,7 +18,7 @@ export class Chatroom
@Column()
@IsString()
@IsNotEmpty()
@IsIn(["public", "protected", "private", "direct", "user"])
@IsIn(["public", "private", "direct", "user"])
type: string;
@Column()

View File

@@ -20,6 +20,7 @@
let room_name: string;
let room_type: string;
let is_protected = false;
let room_password: string;
let response = {
status: 0,
@@ -82,21 +83,19 @@
<input id="chat_public" bind:group={room_type} type="radio" name="room_type" value="public" required>
</label>
<!-- [ ] private -->
<label for="chat_private" class="_radio hide">
<label for="chat_private" class="_radio">
<p>private</p>
<input id="chat_private" bind:group={room_type} type="radio" name="room_type" value="private" required>
</label>
<!-- [ ] protected -->
<label for="chat_protected" class="_radio hide">
<label for="chat_protected" class="_checkbox">
<p>protected</p>
<input id="chat_protected" bind:group={room_type} type="radio" name="room_type" value="protected" required>
<input id="chat_protected" bind:checked={is_protected} type="checkbox" name="room_type" value="protected">
</label>
<!-- [x] protected -->
{#if room_type === 'protected'}
<div>
<label for="chat_pswd"><p>choose a password :</p></label>
<input id="chat_pswd" bind:value={room_password} type="password" placeholder="minimum 8 characters" minlength="8" name="password" required>
</div>
{#if is_protected === true}
<label for="chat_pswd">choose a password :</label>
<input id="chat_pswd" bind:value={room_password} type="password" placeholder="minimum 8 characters" minlength="8" name="password" required>
{/if}
<input type="submit" value="&#x2BA1">
</form>
@@ -119,24 +118,25 @@
/ auto 1fr auto ;
}
/* temp
*/
.hide {
display: none !important;
}
/* radio elements style check
*/
.panel label._radio {
.panel label {
display: inline;
margin: 10px 0px 0px auto;
padding-right: 10px;
cursor: pointer;
padding-right: 10px;
margin: 10px 0px 10px auto;
}
.panel label._radio * {
.panel label._radio {
margin-bottom: 0px;
}
.panel label._checkbox {
margin-top: 20px;
}
.panel label * {
display: inline;
}
.panel label._radio p {
.panel label p {
margin-top: 0px;
margin-bottom: 0px;
}