Projects page setup
This commit is contained in:
parent
717542a812
commit
e7d65b024b
@ -30,31 +30,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function (event) {
|
||||
var projectsListElt = document.querySelector('#projectsList');
|
||||
var projectsTableElt = document.querySelector('#projectsTable');
|
||||
var projectDivElt = document.querySelector('#projectDiv');
|
||||
var projectDetailElt = document.querySelector('#projectDetail');
|
||||
var projectTitleElt = document.querySelector('#projectTitle');
|
||||
var projectsListTitleElt = document.querySelector('#projectsListTitle');
|
||||
projectsListElt.addEventListener('select', function (event) {
|
||||
projectsTableElt.style.display = 'none';
|
||||
projectsListTitleElt.style.display = 'none';
|
||||
projectDivElt.style.display = 'block';
|
||||
projectTitleElt.style.display ='block';
|
||||
projectDetailElt.setAttribute("data-src", event.detail.resource['@id']);
|
||||
projectTitleElt.setAttribute("data-src", event.detail.resource['@id']);
|
||||
});
|
||||
projectDivElt.addEventListener('click', function (event) {
|
||||
if (event.target.id == "projectDivBackButton") {
|
||||
projectDivElt.style.display = 'none';
|
||||
projectTitleElt.style.display = 'none';
|
||||
projectsTableElt.style.display = 'block';
|
||||
projectsListTitleElt.style.display = 'block';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
@ -1,10 +1,8 @@
|
||||
<div id="projects" style="display: none">
|
||||
<ldp-display
|
||||
id="projectsList"
|
||||
id="projects-list"
|
||||
data-src="http://localhost:8000/projects/"
|
||||
set-label="number, label-separator, name"
|
||||
value-label-separator=" - "
|
||||
data-fields="label"
|
||||
data-fields="number, name"
|
||||
search-fields="number, name"
|
||||
next="project"
|
||||
></ldp-display>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 250 KiB |
Binary file not shown.
Before Width: | Height: | Size: 79 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 59 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB |
@ -34,6 +34,7 @@ class Project(models.Model):
|
||||
class Client(models.Model):
|
||||
name = models.CharField(max_length=255, default='')
|
||||
address = models.CharField(max_length=255, default='')
|
||||
logo = models.URLField()
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
@ -1,3 +1,4 @@
|
||||
// Bootstrap classes
|
||||
%btn {
|
||||
display: inline-block;
|
||||
font-weight: 400;
|
||||
@ -53,6 +54,13 @@
|
||||
border-radius: .2rem;
|
||||
}
|
||||
|
||||
%td {
|
||||
padding: .75rem;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
// Custom mixins
|
||||
%self-clear {
|
||||
&::after {
|
||||
content: "";
|
||||
|
19
src/scss/_projects-list.scss
Normal file
19
src/scss/_projects-list.scss
Normal file
@ -0,0 +1,19 @@
|
||||
#projects {
|
||||
#projects-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
ldp-display {
|
||||
@extend %td;
|
||||
display: flex;
|
||||
|
||||
ldp-display-div[name="number"] {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
ldp-display-div[name="name"] {
|
||||
width: 150px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
/* For smaller overall projects list */
|
||||
#projectsTable {
|
||||
max-width: 1222px;
|
||||
}
|
||||
|
||||
#projectsTable ol, #projectsList>ldp-display {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
border-width: 0px 2px 2px 2px; /* no border-top, except for "ol" */
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
}
|
||||
|
||||
#projectsTable ol {
|
||||
border-width: 2px;
|
||||
background-color: darkgrey;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
#projectsTable ol li , #projectsList>ldp-display>ldp-display-div {
|
||||
display: flex;
|
||||
border-right: 2px solid black;
|
||||
/* border-left: 1px solid red; */
|
||||
}
|
||||
|
||||
#projectsList .income-div {
|
||||
border-right: 2px solid black;
|
||||
}
|
||||
|
||||
#projectsList ldp-display>.income-div>ldp-display-div {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Acceptable, mais j'aimerais écrire autrement les sélecteurs. écrire en une fois les 2 "projectList..." */
|
||||
#projectsTable ol li, #projectsList ldp-display>ldp-display-div, #projectsList ldp-display>.income-div {
|
||||
padding-left: 0.5vw;
|
||||
}
|
||||
|
||||
#projectsTable #categorieNumber, #projectsTable #categorieNumberAlt, #projectsList .number {
|
||||
width: 10%;
|
||||
}
|
||||
#projectsTable #categorieTitle, #projectsList .title {
|
||||
width: 40%;
|
||||
}
|
||||
#projectsTable #categorieAssociate, #projectsList .associate {
|
||||
width: 20%;
|
||||
}
|
||||
#projectsTable #categorieIncome, #projectsList .income-div {
|
||||
width: 15%;
|
||||
}
|
||||
#projectsTable #categorieState, #projectsList .state {
|
||||
width: 15%;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
/* Interaction et tout */
|
||||
|
||||
#projectsList>ldp-display:nth-child(odd) {
|
||||
background-color: aliceblue;
|
||||
}
|
||||
|
||||
#projectsList>ldp-display:hover {
|
||||
cursor: pointer;
|
||||
/* background-color: #0080FF; */
|
||||
background-color: #FFF700;
|
||||
}
|
||||
|
||||
#projectsList>ldp-display {
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
#projectsTable [id*="Alt"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 767px) {
|
||||
#projectsTable #categorieNumber {
|
||||
display: none;
|
||||
}
|
||||
#projectsTable #categorieNumberAlt {
|
||||
display: flex;
|
||||
}
|
||||
}
|
@ -12,5 +12,5 @@
|
||||
@import "member";
|
||||
@import "groupsList";
|
||||
@import "project";
|
||||
@import "projectsList";
|
||||
@import "projects-list";
|
||||
@import "dashboard";
|
||||
|
Loading…
Reference in New Issue
Block a user