Skip to content
This repository has been archived by the owner on Dec 28, 2017. It is now read-only.

Commit

Permalink
rewrite admin import video from modal to page
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethlynne committed Mar 15, 2014
1 parent 8b4deff commit e1322e3
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 41 deletions.
2 changes: 1 addition & 1 deletion app/pages/admin/videos/import/index/_import-page.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.admin-import-video {
.import-page {

}
35 changes: 8 additions & 27 deletions app/pages/admin/videos/import/index/import-controller.js
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';
});
19 changes: 19 additions & 0 deletions app/pages/admin/videos/import/index/main-view.html
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>
5 changes: 0 additions & 5 deletions app/pages/admin/videos/import/index/start.html

This file was deleted.

2 changes: 1 addition & 1 deletion app/pages/admin/videos/index/admin-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2>Add videos from Vimeo</h2>
<td><span class="hidden-on-large">Name: </span>In The Open: Ellie Goulding - Guns And Horses</td> <!-- Video name -->
<td><span class="hidden-on-large">Length: </span>11:36</td> <!-- Video length -->
<td><span class="hidden-on-large">Actions: </span> <!-- Actions -->
<button ui-sref="adminImportVideo">Import and edit</button>
<button ui-sref="administrateVideos.import">Import and edit</button>
</td>
</tr>
</tbody>
Expand Down
1 change: 1 addition & 0 deletions app/styles/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
@import '../pages/admin/index/admin-page';
@import '../pages/admin/users/index/users-page';
@import '../pages/admin/videos/index/videos-page';
@import '../pages/admin/videos/import/index/import-page';
@import '../pages/admin/videos/import/index/import-page';
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');
});
});

0 comments on commit e1322e3

Please sign in to comment.