Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Patient documents #575

Merged
merged 5 commits into from
Jul 15, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/src/js/components/bhFindDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ angular.module('bhima.components')
enableOptionBar : '<', // bind boolean (true|false) : Enable option for add, display list or display thumbnail in a bar
enableSearch : '<', // bind boolean (true|false) : Enable search bar option
display : '@', // bind (list|thumbnail) : Display either in list or thumbnail mode
height : '@', // bind the height of list of contents
patientUuid : '<' // Required patient uuid
}
});
Expand All @@ -31,6 +32,7 @@ function FindDocumentComponent(Patient, Modal, Document, Notify, User, $translat
enableOptionBar : Boolean(this.enableOptionBar),
enableSearch : Boolean(this.enableSearch),
display : this.display,
height : this.height,
showAction : false
};

Expand Down
109 changes: 63 additions & 46 deletions client/src/partials/patients/documents/documents.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
/* ============================ Generic Style ============================= */
.document-section {
display: block;
margin: 7px auto;
}
/* =========================== End Generic Style ========================== */


/* ============================ Document style ============================= */
.document {
border: 1px solid #ddd;
cursor: pointer;
padding: 5px;
margin-bottom: 15px;
cursor: pointer;
border: 1px solid #ddd;
}
.document:hover {
background-color: #eee;
}
.document h4 {
margin: 2px;
}
.document-actions {
text-align: center;
width: 100%;
margin: auto;
margin-top: 5px;
/* ========================== End Document style ========================== */


/* ==================== Document thumbnails style ========================= */
.document-thumbnail {
display: inline-block;
}
.document .crop {
.document-thumbnail > .crop {
width: 100%;
height: 150px;
overflow: hidden;
}
.document .crop img.document-thumbnail {
.document-thumbnail > .crop > .image {
text-align: center;
font-size: 10rem;
color: #337ab7;
}
.document-thumbnail > .crop > .image > img {
display: block;
width: 100%;
margin: auto;
Expand All @@ -32,57 +44,62 @@
-webkit-transition: margin-top 1s;
transition: margin-top 1s;
}
.document:hover .crop img.document-thumbnail {
.document-thumbnail:hover > .crop > .image > img {
-webkit-filter: grayscale(0%);
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
filter: grayscale(0%);
margin-top: -25px;
}
.document .crop .document-icon {
text-align: center;
font-size: 10rem;
color: #337ab7;
}
.patient-document .pd-patient {
padding: 7px;
margin-bottom: 5px;
border: 1px solid green;
color: green;
background-color: #e4f9ec;
/* ==================== End Document thumbnails style ====================== */

/* ========================== New Bh-Panel style =========================== */
.bh-panel.bh-panel-default {
border: 1px solid #ddd;
}
.patient-document .pd-search {
margin-bottom: 5px;
.bh-panel.bh-panel-default > .bh-panel-header {
background-color: #f5f5f5;
color: #333;
border-bottom: 1px solid #ddd;
}

/* patient document heading */
.patient-document .pd-documents .heading {
.bh-panel > .bh-panel-header {
padding: 5px;
display: flex;
justify-content: space-between;
background-color: #337ab7;
color: #fff;
padding: 5px;
margin-bottom: 5px;
}
.patient-document .pd-documents .heading > .left {
margin: 5px 10px;
.bh-panel > .bh-panel-header > .icon {
padding-top: 5px;
padding-left: 7px;
}
.bh-panel > .bh-panel-body {
padding: 5px;
overflow: auto;
}
/* ========================== End New Bh-Panel style ======================= */

/* patient list thumbanil */
.patient-document .display-thumbnail {
display: flex;
align-items: flex-start;
align-content: flex-start;
justify-content: flex-start;
flex-wrap: wrap;

/* ========================== Avatar thumbnail ============================= */
.avatar-thumbnail {
text-align: center;
border : 1px solid #ccc;
}
.patient-document .display-thumbnail > .document {
width: 50%;
.avatar-thumbnail > .crop > img {
width: 100%;
height: 200px;
overflow: hidden;
}
.avatar-thumbnail > .crop > .glyphicon {
font-size : 3em;
color : #ccc;
padding-top: 70px;
}
/* ========================== End Avatar thumbnail ========================== */


/* document upload thumbnail */
.document-upload-thumbnail {
/* ============================= Upload thumbnail =========================== */
.upload-thumbnail {
width: 100%;
height: 300px;
overflow: hidden;
}
/* ========================== End Upload thumbnail ========================== */
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- thumbnail -->
<img
ng-if="$ctrl.file"
class="document-upload-thumbnail"
class="upload-thumbnail"
ngf-thumbnail="{{ '$ctrl.thumbnail' }}">

<!-- progress bar -->
Expand Down
15 changes: 8 additions & 7 deletions client/src/partials/patients/record/patient_record.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
</div>

<div class="col-sm-4">
<div style="border : 1px solid #ccc; height : 200px;">
<div ng-if="!PatientRecordCtrl.patient.avatar" style="text-align : center;">
<span style="font-size : 3em; color : #ccc; padding-top: 70px;" class="glyphicon glyphicon-picture"></span>
<div class="avatar-thumbnail">
<div class="crop" ng-if="!PatientRecordCtrl.patient.avatar">
<span class="glyphicon glyphicon-picture"></span>
</div>
<div ng-if="PatientRecordCtrl.patient.avatar" style="text-align : center;">
<img ng-src="{{ PatientRecordCtrl.patient.avatar }}" style="width: 100%; height: 200px; overflow: hidden;">
<div class="crop" ng-if="PatientRecordCtrl.patient.avatar">
<img ng-src="{{ PatientRecordCtrl.patient.avatar }}">
</div>
</div>

Expand Down Expand Up @@ -99,14 +99,15 @@

<div class="row">

<div class="col-sm-6" style="height : 250px; overflow: auto;">
<div class="col-sm-6">
<!-- find document -->
<bh-find-document
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads really nicely. The component API looks fantastic. Well done!

patient-uuid="PatientRecordCtrl.patient.uuid"
enable-patient-details="false"
enable-search="false"
enable-option-bar="true"
display="default">
display="default"
height="250px">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. Hardcoded styles are not a great idea. Is there anyway to make this component take up 100% height?

This won't block the PR, as it may require CSS changes beyond this component.

</bh-find-document>
<!-- end find document -->
</div>
Expand Down
Loading