Skip to content

Commit

Permalink
Merge 04a4ee8 into c365d7a
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmiller committed Oct 24, 2018
2 parents c365d7a + 04a4ee8 commit 1ea9b79
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 34 deletions.
2 changes: 1 addition & 1 deletion doc/docs/guides/flow.md
Expand Up @@ -64,6 +64,6 @@ that acts differently for deceased patients might look as follows
}
return {
'controller': 'DischargeEpisodeCtrl',
'template' : '/templates/modals/discharge_episode.html/'
'template' : '/templates/discharge_episode_modal.html'
}
}
2 changes: 1 addition & 1 deletion opal/scaffolding/scaffold/app/static/js/app/flow.js
Expand Up @@ -19,7 +19,7 @@ angular.module('opal.services').factory('AppFlow', function($routeParams){
exit: function(){
return {
'controller': 'DischargeEpisodeCtrl',
'template' : '/templates/modals/discharge_episode.html/'
'template' : '/templates/discharge_episode_modal.html'
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions opal/static/js/opal/controllers/edit_item.js
Expand Up @@ -80,7 +80,7 @@ angular.module('opal.controllers').controller(
$scope.delete = function(result){
$modalInstance.close(result);
var modal = $modal.open({
templateUrl: '/templates/modals/delete_item_confirmation.html/',
templateUrl: '/templates/delete_item_confirmation_modal.html',
controller: 'DeleteItemConfirmationCtrl',
resolve: {
item: function() {
Expand Down Expand Up @@ -122,7 +122,7 @@ angular.module('opal.controllers').controller(

$scope.undischarge = function() {
undischargeMoadal = $modal.open({
templateUrl: '/templates/modals/undischarge.html/',
templateUrl: '/templates/undischarge_modal.html',
controller: 'UndischargeCtrl',
resolve: {episode: function(){ return episode } }
}
Expand Down
2 changes: 1 addition & 1 deletion opal/static/js/opal/services/flow.js
Expand Up @@ -19,7 +19,7 @@ angular.module(
exit: function(){
return {
'controller': 'DischargeEpisodeCtrl',
'template' : '/templates/modals/discharge_episode.html/'
'template' : '/templates/discharge_episode_modal.html'
};
}
};
Expand Down
2 changes: 1 addition & 1 deletion opal/static/js/opal/services/record_editor.js
Expand Up @@ -24,7 +24,7 @@ angular.module('opal.services').factory('RecordEditor', function(
}

var modal = $modal.open({
templateUrl: '/templates/modals/delete_item_confirmation.html/',
templateUrl: '/templates/delete_item_confirmation_modal.html',
controller: 'DeleteItemConfirmationCtrl',
resolve: {
item: function() { return item; },
Expand Down
2 changes: 1 addition & 1 deletion opal/static/js/test/edit_item.controller.test.js
Expand Up @@ -162,7 +162,7 @@ describe('EditItemCtrl', function (){
$scope.delete();
expect($modal.open).toHaveBeenCalled()
var args = $modal.open.calls.mostRecent().args[0];
expect(args.templateUrl).toEqual('/templates/modals/delete_item_confirmation.html/');
expect(args.templateUrl).toEqual('/templates/delete_item_confirmation_modal.html');
expect(args.controller).toEqual('DeleteItemConfirmationCtrl');
expect(args.resolve.item()).toEqual(item)
});
Expand Down
4 changes: 2 additions & 2 deletions opal/static/js/test/flow.service.test.js
Expand Up @@ -52,7 +52,7 @@ describe('Flow ', function(){
Flow.exit('episode', {current_tags: {}}, {some: "context"});
var args = $modal.open.calls.mostRecent().args;
expect(args[0].controller).toEqual('DischargeEpisodeCtrl');
expect(args[0].templateUrl).toEqual('/templates/modals/discharge_episode.html/');
expect(args[0].templateUrl).toEqual('/templates/discharge_episode_modal.html');
var resolves = args[0].resolve;
expect(resolves.tags()).toEqual({});
expect(resolves.episode()).toEqual('episode');
Expand Down Expand Up @@ -94,7 +94,7 @@ describe('Flow ', function(){
exit: jasmine.createSpy().and.returnValue(
{
'controller': 'DischargeEpisodeCtrl',
'template' : '/templates/modals/discharge_episode.html/'
'template' : '/templates/discharge_episode_modal.html'
}
)
};
Expand Down
2 changes: 1 addition & 1 deletion opal/static/js/test/record_editor_test.js
Expand Up @@ -216,7 +216,7 @@ describe('RecordEditor', function(){
expect(callArgs.length).toBe(1);
expect(callArgs[0].controller).toBe('DeleteItemConfirmationCtrl');
expect(callArgs[0].templateUrl).toBe(
'/templates/modals/delete_item_confirmation.html/'
'/templates/delete_item_confirmation_modal.html'
);
var resolves = callArgs[0].resolve;
expect(resolves.item()).toEqual(episode.recordEditor.getItem('diagnosis', 0));
Expand Down
1 change: 0 additions & 1 deletion opal/tests/test_views.py
Expand Up @@ -57,7 +57,6 @@ def get_urls(self):
reverse("patient_list_template_view", kwargs=dict(slug="eater-herbivore")),
reverse("patient_detail"),
reverse("episode_detail", kwargs=dict(pk=self.episode.id)),
reverse("undischarge_tempate_view"),
reverse("raw_template_view", kwargs=dict(template_name="not_a_real_template.html")),
]

Expand Down
11 changes: 0 additions & 11 deletions opal/urls.py
Expand Up @@ -43,17 +43,6 @@
url(r'^templates/episode_detail.html/(?P<pk>\d+)/?$',
views.EpisodeDetailTemplateView.as_view(), name="episode_detail"),

url(r'^templates/modals/undischarge.html/?$',
views.UndischargeTemplateView.as_view(),
name="undischarge_tempate_view"
),

url(r'^templates/modals/discharge_episode.html/?$',
views.DischargeEpisodeTemplateView.as_view()),

url(r'^templates/modals/delete_item_confirmation.html/?$',
views.DeleteItemConfirmationView.as_view()),

# New Public facing API urls
url(r'api/v0.1/', include(api.router.urls)),

Expand Down
12 changes: 0 additions & 12 deletions opal/views.py
Expand Up @@ -224,18 +224,6 @@ def get_context_data(self, *a, **k):
return data


class UndischargeTemplateView(LoginRequiredMixin, TemplateView):
template_name = 'undischarge_modal.html'


class DischargeEpisodeTemplateView(LoginRequiredMixin, TemplateView):
template_name = 'discharge_episode_modal.html'


class DeleteItemConfirmationView(LoginRequiredMixin, TemplateView):
template_name = 'delete_item_confirmation_modal.html'


class RawTemplateView(LoginRequiredMixin, TemplateView):
"""
Failover view for templates - just look for this path in Django!
Expand Down

0 comments on commit 1ea9b79

Please sign in to comment.