Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

App nav redesign phase 1 #108

Merged
merged 54 commits into from
Jul 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b692727
add new color
May 28, 2015
1227b10
derp correct that vertical alignment mixin
May 28, 2015
6eee80c
improve loading notice design
May 28, 2015
d3fcebc
svg cleanup
May 28, 2015
ce69ffc
add cross icon for sidebar nav
May 28, 2015
0f00afb
shoutout @tobiasahlin
May 28, 2015
ad74243
add moar colors :art:
May 28, 2015
9ece88d
spike out move of header nav to sidebar
May 28, 2015
d941833
restyle search form for sidebar context
May 28, 2015
b01b673
readjust markup for syncStatus
May 29, 2015
0be4493
linting, :fire: unused styles, & split up for maintainability
May 29, 2015
5e5db9b
tweak sign in styles :wrench:
May 29, 2015
92f200f
fix up loading notice styles
May 29, 2015
d611918
style search form placeholder text
May 29, 2015
7c35816
start moving nav categories into sidebar
May 29, 2015
1607198
move into partials
May 29, 2015
7dbc977
move patients nav into sidebar
May 29, 2015
6a42c5e
move to navigation controller
May 29, 2015
27c87cb
maybe important? (on other views)
May 29, 2015
a93f140
style first two sidebar items
May 30, 2015
8461d38
:art: tweaks
May 30, 2015
16d98db
move over appointments and labs sections
May 30, 2015
c6b1705
:fire: line break
May 30, 2015
a2b0b87
add scrollable region for sidebar
May 30, 2015
5c172c2
:fire: sections from dash
May 30, 2015
453929b
move remaining sections to sidebar
May 30, 2015
7bf43d7
rename appropriately
May 30, 2015
18c40f7
tweak bg colors, etc
May 30, 2015
96b7d67
use appropriate octicon for billing
May 30, 2015
02916c4
add actions to toggle subnav
Jun 1, 2015
1bba1a1
add action for settings nav
Jun 1, 2015
e462a61
style work on view panel heading
Jun 1, 2015
9db76fe
update loading notice colors for light bg
Jun 1, 2015
749e0ab
add active class to settings
Jun 1, 2015
300eeb3
moar view heading style tweaks
Jun 1, 2015
a62a087
:fire: styles from old index/dashboard nav
Jun 1, 2015
dee9291
:fire: redundant heading styles
Jun 1, 2015
aa55816
more tweaks to heading styles
Jun 1, 2015
b7cd5a9
view subnav styles
Jun 1, 2015
0a4af2c
update error screen markup/styles
Jun 7, 2015
7fc28e0
sidebar font-size tweak
Jun 10, 2015
ad8954d
update package
Jun 10, 2015
f4d48bf
extract to partial
Jun 21, 2015
176e29f
colorzzzz
Jun 21, 2015
92c5466
moar colors yo
Jun 21, 2015
36f55b5
style dat empty set
Jun 21, 2015
76b6f9e
Don't render the navigation on login
tangollama Jun 24, 2015
c0da9d2
add alert styling to error message
Jun 24, 2015
136fdf6
resolve merge conflict in app/templates/index.hbs
Jul 6, 2015
6fb7431
nav-menu component
tangollama Jul 7, 2015
617e77a
more changes for nav-menu
tangollama Jul 7, 2015
d8ef551
As requested on slack
tangollama Jul 8, 2015
7c63ad0
ok... that kind of fixes the issue @jglovier?
tangollama Jul 8, 2015
84b91ac
revert markup order; style by active class
Jul 8, 2015
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
34 changes: 34 additions & 0 deletions app/components/nav-menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Ember from 'ember';
import UserSession from "hospitalrun/mixins/user-session";

export default Ember.Component.extend(UserSession, {
tagName: "div",
classNames: ["primary-nav-item"],
nav: null,

show: function() {
return this.currentUserCan(this.get("nav").capability);
}.property("nav"),

isShowing: false,

_setup: function() {
let nav = this.get("nav");
nav.closeSubnav = function() {
this.set('isShowing', false);
}.bind(this);
nav.subnav.forEach(function(item) {
item.show = this.currentUserCan(item.capability);
}.bind(this));
}.on('init'),

callNavAction: "navAction",

actions: {
toggleContent: function() {
//debugger;
this.set('isShowing', !this.get('isShowing'));
this.sendAction('callNavAction', this.nav);
}
}
});
31 changes: 17 additions & 14 deletions app/controllers/navigation.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
import Ember from "ember";
import ProgressDialog from "hospitalrun/mixins/progress-dialog";
import UserSession from "hospitalrun/mixins/user-session";
export default Ember.Controller.extend(ProgressDialog, UserSession,{
import Navigation from "hospitalrun/mixins/navigation";
export default Ember.Controller.extend(ProgressDialog, UserSession, Navigation, {

needs: 'application',
allowSearch: false,
currentSearchText: null,
currentRouteName: Ember.computed.alias('controllers.application.currentRouteName'),
progressTitle: 'Searching',
searchRoute: null,
syncStatus: '',
currentOpenNav: null,

showInventory: function() {
return this.currentUserCan('inventory');
}.property('session.isAuthenticated'),

showPatients: function() {
return this.currentUserCan('patients');
}.property('session.isAuthenticated'),

showUsers: function() {
return this.currentUserCan('users');
}.property('session.isAuthenticated'),

actions: {
search: function() {
if (this.allowSearch && this.searchRoute) {
var currentRouteName = this.get('currentRouteName'),
currentSearchText = this.get('currentSearchText'),
textToFind = this.get('searchText');
if (currentSearchText !== textToFind || currentRouteName.indexOf('.search') === -1) {
this.set('searchText','');
this.set('searchText','');
this.set('progressMessage','Searching for '+textToFind+'. Please wait...');
this.showProgressModal();
this.transitionToRoute(this.searchRoute+"/"+textToFind);
}
}
},

navAction: function(nav) {
if (this.currentOpenNav) {
this.currentOpenNav.closeSubnav();
}
this.currentOpenNav = nav;
this.transitionToRoute(nav.route);
},

toggleSettings: function() {
this.toggleProperty('isShowingSettings');
}
}
});
6 changes: 3 additions & 3 deletions app/imaging/completed/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<th>Patient</th>
<th>Imaging Type</th>
<th>Results</th>
<th>Notes</th>
<th>Notes</th>
</tr>
{{#each}}
<tr>
Expand All @@ -17,10 +17,10 @@
<td>{{result}}</td>
<td>{{notes}}</td>
</tr>
{{/each}}
{{/each}}
</table>
{{else}}
<div class="alert alert-info">
<em>No completed items found.</em>
<p>No completed items found.</p>
</div>
{{/if}}
6 changes: 1 addition & 5 deletions app/imaging/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
</table>
{{else}}
<div class="alert alert-info">
<em>No items found.</em>
{{#if canAdd}}
<em>Create a new record?</em>
<button class="btn btn-primary" {{action 'newItem'}}>New Imaging</button>
{{/if}}
<p>No items found. {{#if canAdd}} <a href="#" {{action 'newItem'}}>Create a new record?</a>{{/if}}</p>
</div>
{{/if}}
38 changes: 10 additions & 28 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,18 @@
{{content-for 'head-footer'}}
</head>
<body>
<div class="jumbotron" id="apploading">
<div class="alert alert-warning" role="alert">
<h1><span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>HospitalRun is Initializing... </h1>
<p>Did You Know: <span id="apploadingmsg"></span></p>
<div class="loading-notice apploading" id="apploading" role="alert">
<div class="wrapper">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
<p class="loading-text">Loading</p>
</div>
</div>
<script>
var messages = [
'The Brimstone butterfly (Gonepteryx rhamni) has the longest lifetime of the adult butterflies: 9-10 months.',
'Apples are more efficient than caffeine in keeping people awake in the mornings.',
'The human heart creates enough pressure when it pumps out to the body to squirt blood 30 feet.',
'Starfish have no brains.',
'A dinomaniac is someone with the compulsive urge to dance.',
'There is no leading cause of death for people who live past the age of 100.',
'Nepal is the only country that doesn’t have a rectangular flag.',
'The international telephone dialing code for Antarctica is 672.',
'Camels chew in a figure 8 pattern.',
'A shark is the only fish that can blink with both eyes.'
]
function randomMsg() {
var apploading = document.getElementById('apploading');
if (apploading) {
var idx = Math.floor(Math.random()*10),
message = document.getElementById('apploadingmsg');
message.innerHTML = messages[idx];
setTimeout(randomMsg, 300);
}
}
randomMsg();
</script>
<script>
window.addEventListener('load',function(e){window.applicationCache.addEventListener('updateready', function(e){if (window.applicationCache.status==window.applicationCache.UPDATEREADY){window.applicationCache.swapCache();window.location.reload();}},false);},false);
</script>
Expand Down
6 changes: 1 addition & 5 deletions app/inventory/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
</table>
{{else}}
<div class="alert alert-info">
<em>No requests found.</em>
{{#if canAdd}}
<em>Create a new request?</em>
<button class="btn btn-primary" {{action 'newRequest'}}>New Request</button>
{{/if}}
<p>No requests found. {{#if canAdd}}<a href="#" {{action 'newRequest'}}>Create a new request?</a>{{/if}}</p>
</div>
{{/if}}
6 changes: 1 addition & 5 deletions app/inventory/listing/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
</table>
{{else}}
<div class="alert alert-info">
<em>No items found.</em>
{{#if canAddItem}}
<em>Create a new record?</em>
<button class="btn btn-primary" {{action 'newItem'}}>New Item</button>
{{/if}}
<p>No items found. {{#if canAddItem}} <a href="#" {{action 'newItem'}}>Create a new record?</a>{{/if}}</p>
</div>
{{/if}}
8 changes: 4 additions & 4 deletions app/invoices/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<th>Status</th>
<th>Patient</th>
<th>Total</th>
<th>Balance Due</th>
<th>Balance Due</th>
{{#if showActions}}
<th>Actions</th>
{{/if}}
Expand All @@ -20,7 +20,7 @@
<td>{{total}}</td>
<td>{{remainingBalance}}</td>
<td>
{{#if showActions}}
{{#if showActions}}
{{#if parentController.canAddPayment}}
<button class="btn btn-default neutral" {{action 'showAddPayment' this bubbles=false }}>
<span class="octicon octicon-plus"></span> Add Payment
Expand All @@ -34,11 +34,11 @@
{{/if}}
{{/if}}
</td>
</tr>
</tr>
{{/each}}
</table>
{{else}}
<div class="alert alert-info">
<em>No invoices found. Create an invoice?</em> <button class="btn btn-primary" {{action 'newItem'}}>New Invoice</button>
<p>No invoices found. <a href="#" {{action 'newItem'}}>Create an invoice?</a></p>
</div>
{{/if}}
6 changes: 3 additions & 3 deletions app/labs/completed/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<th>Patient</th>
<th>Lab Type</th>
<th>Results</th>
<th>Notes</th>
<th>Notes</th>
</tr>
{{#each}}
<tr>
Expand All @@ -17,10 +17,10 @@
<td>{{result}}</td>
<td>{{notes}}</td>
</tr>
{{/each}}
{{/each}}
</table>
{{else}}
<div class="alert alert-info">
<em>No completed items found.</em>
<p>No completed items found.</p>
</div>
{{/if}}
6 changes: 1 addition & 5 deletions app/labs/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
</table>
{{else}}
<div class="alert alert-info">
<em>No labs found.</em>
{{#if canAdd}}
<em>Create a new record?</em>
<button class="btn btn-primary" {{action 'newItem'}}>New Lab</button>
{{/if}}
<p>No labs found. {{#if canAdd}}<a href="#" {{action 'newItem'}}>Create a new record?</a>{{/if}}</p>
</div>
{{/if}}
8 changes: 2 additions & 6 deletions app/medication/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<th>Date</th>
<th>Patient</th>
<th>Medication</th>
<th>Quantity</th>
<th>Quantity</th>
<th>Status</th>
{{#if showActions}}
<th>Actions</th>
Expand All @@ -29,10 +29,6 @@
</table>
{{else}}
<div class="alert alert-info">
<em>No items found.</em>
{{#if canAdd}}
<em>Create a new medication request?</em>
<button class="btn btn-primary" {{action 'newItem'}}>New Medication Request</button>
{{/if}}
<p>No items found. {{#if canAdd}}<a href="#" {{action 'newItem'}}>Create a new medication request?</a>{{/if}}</p>
</div>
{{/if}}
Loading