This repository has been archived by the owner on Dec 28, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite admin import video from modal to page
- Loading branch information
1 parent
8b4deff
commit e1322e3
Showing
7 changed files
with
35 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.admin-import-video { | ||
.import-page { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,13 @@ | ||
'use strict'; | ||
|
||
angular.module('ndc') | ||
.config(function ($stateProvider) { | ||
$stateProvider.state("adminImportVideo", | ||
{ | ||
url: "/admin/videos/import", | ||
onEnter: ['$stateParams', '$state', '$modal', '$window', function ($stateParams, $state, $modal, $window) { | ||
$modal | ||
.open({ | ||
backdrop: 'static', | ||
templateUrl: 'pages/admin/videos/import/index/start.html', | ||
controller: 'AdminImportVideoCtrl' | ||
}) | ||
.result | ||
.then(function () { | ||
$state.go('administrateVideos', {}, {inherit:false}); | ||
}) | ||
.catch(function () { | ||
$state.go('administrateVideos', {}, {inherit:false}); | ||
}) | ||
}], | ||
onExit: ['$state', function ($state) { | ||
$state.go('administrateVideos'); | ||
}] | ||
}); | ||
.config(function ($stateProvider, stateFactory) { | ||
$stateProvider.state('administrateVideos.import', stateFactory('Import', { | ||
url: '/videos/import', | ||
templateUrl: 'pages/admin/videos/import/index/main-view.html', | ||
parent: 'admin' | ||
})); | ||
}) | ||
.controller('AdminImportVideoCtrl', function ($scope, $modalInstance) { | ||
$scope.closeModal = function () { | ||
$modalInstance.close(); | ||
}; | ||
.controller('ImportCtrl', function ($scope) { | ||
$scope.foo = 'bar'; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<div class="import-page container"> | ||
|
||
<div class="row"> | ||
<div class="col-lg-12"> | ||
<div class="page-header"> | ||
<h1 id="container">Container - <small>admin/videos/import</small></h1> | ||
</div> | ||
<div class="bs-example"> | ||
<div class="jumbotron"> | ||
<h1>Jumbotron {{data.message1}}</h1> | ||
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p> | ||
<p>{{data.message2}}</p> | ||
<p><a class="btn btn-primary btn-lg">Learn more</a></p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
test/unit/spec/pages/admin/videos/import/index/import-controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
'use strict'; | ||
|
||
describe('Controller(/admin/videos/import-controller): AdminImportVideoCtrl', function () { | ||
describe('Controller(/admin/videos/import): ImportCtrl', function () { | ||
|
||
var Ctrl, scope; | ||
var ImportCtrl, scope; | ||
|
||
beforeEach(function () { | ||
|
||
module('ndc'); | ||
|
||
inject(function ($controller, $rootScope) { | ||
scope = $rootScope.$new(); | ||
Ctrl = $controller('AdminImportVideoCtrl', { | ||
$scope: scope, | ||
$modal: {}, | ||
$modalInstance: {} | ||
ImportCtrl = $controller('ImportCtrl', { | ||
$scope: scope | ||
}); | ||
}); | ||
}); | ||
|
||
it('should attach init data to scope', function () { | ||
|
||
expect(scope.foo).toEqual('bar'); | ||
}); | ||
}); |