Edit profile - Connected correctly now (via hack)

This commit is contained in:
Alexandre Bourlier 2018-05-15 08:08:31 +02:00
parent 2029ca865d
commit 97fa85188b
12 changed files with 95 additions and 53 deletions

View File

@ -32,8 +32,10 @@
<?php require_once('src/html/edit-profile.html'); ?>
<?php require_once('src/html/projects.html'); ?>
<?php require_once('src/html/project.html'); ?>
<?php require_once('src/html/project-edition.html'); ?>
<?php require_once('src/html/channels.html'); ?>
<?php require_once('src/html/channel.html'); ?>
<?php require_once('src/html/channel-edition.html'); ?>
<?php require_once('src/html/search.html'); ?>
</main>

View File

@ -0,0 +1,7 @@
<div id="channel-edition" style="display: none">
<ldp-form
class="edit-form"
data-src="<?php echo $sdn; ?>/channels/1/"
bind-resources
></ldp-form>
</div>

View File

@ -7,17 +7,20 @@
<!--</form>-->
<div class="list-condensed">
<ldp-router>
<ldp-route name="edit-profile" id-prefix="<?php echo $sdn; ?>/members/">
<ldp-display
id="to-user-profile"
data-src="<?php echo $sdn; ?>/members/1/"
set-name="firstname, name-separator, lastname"
value-name-separator="&nbsp;"
data-fields="avatar, name"
widget-avatar="ldp-display-img"
next="edit-profile"
></ldp-display>
</ldp-route>
</ldp-router>
</div>
<script>
document.querySelector("#to-user-profile").addEventListener("click", () => {
document.getElementById("navbar-router").navigate("member");
document.getElementById("member-page-router").navigate("member-detail");
});
</script>
</div>

View File

@ -18,17 +18,16 @@
</script>
<div id="edit-profile" style="display: none">
<!--ldp-form
class="edit-form"
data-src="<?php echo $sdn; ?>/members/1/"
bind-resources
></ldp-form-->
<label for="avatar-input">
<img id="avatar-preview" src="http://cdn.hd-app.local/members/alexandre-bourlier.jpg" style="width: 100%;"/>
</label>
<input type="file" id="avatar-input" name="avatar" value="http://cdn.hd-app.local/members/alexandre-bourlier.jpg" />`;
<ldp-form
class="edit-form"
data-src="<?php echo $sdn; ?>/members/1/"
bind-resources
></ldp-form>
</div>
<div id="crop-modal">

View File

@ -1,5 +0,0 @@
<div id="home" style="display: none">
<div id="logoContainer">
<img src="./img/Logo_Happy_Dev.png" alt="Logo Happy Dev">
</div>
</div>

View File

@ -11,8 +11,13 @@
<div id="member-chat" class="chat-wrapper"></div>
<div id="member-detail" style="display: none">
<div class="section info">
<i class="fa fa-pencil" aria-hidden="true"></i>
<i class="name fa fa-pencil" aria-hidden="true"></i>
<ldp-display
id="member-info"
data-src="<?php echo $sdn; ?>/members/1/"
set-name="firstname, name-separator, lastname"
value-name-separator="&nbsp;"
data-fields="avatar, name, cell, email, number"
@ -22,8 +27,11 @@
widget-number="ldp-display-tel"
bind-resources
></ldp-display>
</div>
<h2 class="section skills">Compétences</h2>
<div class="section skills">
<i class="fa fa-pencil" aria-hidden="true"></i>
<h2>Compétences</h2>
<ldp-display
id="member-skills"
id-suffix="skills"
@ -31,3 +39,12 @@
></ldp-display>
</div>
</div>
</div>
<script>
document.querySelectorAll("#member-detail .fa-pencil").forEach((el) => {
el.addEventListener("click", (e) => {
document.getElementById('navbar-router').navigate('edit-profile');
});
});
</script>

View File

@ -17,17 +17,15 @@
<i class="fa fa-tasks" aria-hidden="true"></i>
<span class="d-none d-md-inline"> Projets</span>
</ldp-route>
<ldp-route class="nav-item d-none" name="project" id-prefix="<?php echo $sdn; ?>/projects/">
Projet
</ldp-route>
<ldp-route class="d-none" name="project" id-prefix="<?php echo $sdn; ?>/projects/"></ldp-route>
<ldp-route class="d-none" name="project-edition" id-prefix="<?php echo $sdn; ?>/channels/"></ldp-route>
<ldp-route class="nav-item pb-2 align-self-stretch text-center text-md-left" name="channels">
<i class="fa fa-comments" aria-hidden="true"></i>
<span class="d-none d-md-inline"> Channels</span>
</ldp-route>
<ldp-route class="nav-item d-none" name="channel" id-prefix="<?php echo $sdn; ?>/channels/">
channel
</ldp-route>
<ldp-route class="d-none" name="channel" id-prefix="<?php echo $sdn; ?>/channels/"></ldp-route>
<ldp-route class="d-none" name="channel-edition" id-prefix="<?php echo $sdn; ?>/channels/"></ldp-route>
</div>
<div class="col-2 col-md-1"></div>

View File

@ -0,0 +1,8 @@
<div id="project-edition" style="display: none">
<ldp-form
class="edit-form"
data-src="<?php echo $sdn; ?>/projects/1/"
bind-resources
></ldp-form>
</div>

View File

@ -2,7 +2,6 @@
#channels-list {
display: flex;
flex-direction: column;
margin-top: 40px;
ldp-display {
@extend %td;

View File

@ -1,6 +1,5 @@
#dashboard {
#search-help {
font-style: italic;
padding-left: 5px;
#to-user-profile {
cursor: pointer;
}
}

View File

@ -61,9 +61,25 @@
}
.section {
position: relative;
i {
position: absolute;
display: block;
top: 5px;
right: 10px;
cursor: pointer;
&.name {
top: 290px;
}
}
h2 {
@extend %detail-section;
margin-top: 40px;
}
}
#member-skills {
display: flex;

View File

@ -2,7 +2,6 @@
#projects-list {
display: flex;
flex-direction: column;
margin-top: 40px;
ldp-display {
@extend %td;