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() @IsString()
@IsNotEmpty() @IsNotEmpty()
@IsIn(["public", "protected", "private", "direct", "user"]) @IsIn(["public", "private", "direct", "user"])
type: string; type: string;
@IsString() @IsString()

View File

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

View File

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