Skip to content
This repository has been archived by the owner on Oct 21, 2018. It is now read-only.

add missing endpoints #225

Open
wants to merge 1 commit into
base: grades_redux
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions static_files/app/gradebook/gradebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ angular.module('gradeBookApp', [
controller: 'gradeBookCtrl',
templateUrl: staticURL('app/gradebook/modules/gradebook/gradebook.html')
})
//.when('/gradebook/',{
// controller: 'coursesCtrl',
// templateUrl: 'courses/courses.html'
//})
.when('/gradebook/sections/:sectionId',{
controller: 'singleSectionCtrl',
templateUrl: staticURL('app/gradebook/modules/singleSection/singleSection.html')
Expand Down
75 changes: 39 additions & 36 deletions static_files/app/gradebook/modules/gradebook/gradebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,11 @@ <h2>Gradebook</h2>
</ul>
</li>

<li>Math 101
<ul class="nav">
<li>
<a href="">Group A</a>
</li>
<li>
<a href="">Group B</a>
</li>
<li>
<a href="">Gruop C</a>
</li>
</ul>
</li>
<li>Math 102
<ul class="nav">
<li>
<a href="">Group A</a>
</li>
<li>
<a href="">Group B</a>
</li>
</ul>
</li>
</ul>
</div>

<div class="col-sm-9 col-sm-offset-3">
<h2>Math 101: Group A</h2>
<div class="col-sm-9 col-sm-offset-3" data-ng-if="activeSection">
<h2>{{section.course.fullname}} : {{section.name}}</h2>

<div class="col-xs-12">
<div class="pull-left">
Expand Down Expand Up @@ -92,7 +69,7 @@ <h2>Math 101: Group A</h2>
</div>
</div>

<div class="col-xs-3 right-settings" data-ng-class="{'hidden':!assignmentVisible}">
<div class="col-xs-3 right-settings" data-ng-if="activeSection" data-ng-class="{'hidden':!assignmentVisible}">
<h2 data-ng-if="!readOnly">
<span data-ng-if="!multipleAssignments">Add Assignment</span>
<span data-ng-if="multipleAssignments">Add Assignments</span>
Expand All @@ -113,12 +90,17 @@ <h2 data-ng-if="readOnly">View Assignment</h2>

<div class="form-group">
<label for="name">Name</label>
<input id="name" class="form-control" type="text" data-ng-if="!readOnly" data-ng-model="newAssignment.name">
<input id="name"
class="form-control"
type="text"
data-ng-if="!readOnly"
data-ng-model="newAssignment.name">
<p data-ng-if="readOnly">Super long assignment</p>
</div>
<div class="form-group">
<label for="date">Date</label>
<input id="date" class="form-control" type="date" data-ng-if="!readOnly" data-ng-model="newAssignment.date">
<input id="date" class="form-control" type="text" data-ng-if="!readOnly" data-ng-model="newAssignment.date"
placeholder="YYYY-MM-DD">
<p data-ng-if="readOnly">1/1/15</p>
</div>
<div class="form-group">
Expand All @@ -128,23 +110,44 @@ <h2 data-ng-if="readOnly">View Assignment</h2>
</div>
<div class="form-group">
<label for="assignmentCategory">Category</label>
<select id="assignmentCategory" class="form-control" data-ng-if="!readOnly" data-ng-model="newAssignment.category"></select>
<select id="assignmentCategory"
class="form-control"
data-ng-if="!readOnly"
data-ng-model="newAssignment.category"
data-ng-options="category.id as category.name for category in assignmentCategories">
<option value="">Select category</option>
</select>
<p data-ng-if="readOnly">Category 1</p>
</div>
<div class="form-group">
<label for="assignmentType">Assignment Type</label>
<select id="assignmentType" class="form-control" data-ng-if="!readOnly" data-ng-model="newAssignment.assignment_type"></select>
<select id="assignmentType"
class="form-control"
data-ng-if="!readOnly"
data-ng-model="newAssignment.assignment_type"
data-ng-options="type.id as type.name for type in assignmentTypes">
<option value="">Select type</option>
</select>
<p data-ng-if="readOnly">Homework</p>
</div>
<div class="form-group">
<label for="markingPeriod">Marking Period</label>
<select id="markingPeriod" class="form-control" data-ng-if="!readOnly" data-ng-model="newAssignment.marking_period" data-ng-options="period.id as period.name for period in markingPeriodSet">
<select id="markingPeriod"
class="form-control"
data-ng-if="!readOnly"
data-ng-model="newAssignment.marking_period"
data-ng-options="period.id as period.name for period in markingPeriodSet">
<option value="">Select period</option>
</select>
<p data-ng-if="readOnly">MAth101: Group A</p>
</div>
<div class="form-group">
<label for="standard">Standard</label>
<select id="standard" class="form-control" data-ng-if="!readOnly"></select>
<select id="standard" class="form-control" data-ng-if="!readOnly"
data-ng-model="newAssignment.benchmark"
data-ng-options="benchmark.id as benchmark.name for benchmark in benchmarkList">
<option value="">Select standard</option>
</select>
<p data-ng-if="readOnly">Normal</p>
</div>
<div class="form-group">
Expand All @@ -158,7 +161,7 @@ <h2 data-ng-if="readOnly">View Assignment</h2>
</form>
</div>

<div class="col-xs-3 right-settings" data-ng-class="{'hidden':!filtersVisible}">
<div class="col-xs-3 right-settings" data-ng-if="activeSection" data-ng-class="{'hidden':!filtersVisible}">
<h2>Filters</h2>

<form>
Expand Down Expand Up @@ -207,7 +210,7 @@ <h2>Filters</h2>

</div>

<div class="col-xs-3 right-settings" data-ng-class="{'hidden':!settingsVisible}">
<div class="col-xs-3 right-settings" data-ng-if="activeSection" data-ng-class="{'hidden':!settingsVisible}">
<h2>Settings</h2>

<div class="form-group clearfix" data-ng-init="settings.position = 'left'">
Expand Down Expand Up @@ -401,7 +404,7 @@ <h2>Settings</h2>
<button class="btn btn-primary" data-ng-click="cancel()">Close</button>
</div>

<div class="col-xs-3 right-settings" data-ng-class="{'hidden': !colorGuideVisible}">
<div class="col-xs-3 right-settings" data-ng-if="activeSection" data-ng-class="{'hidden': !colorGuideVisible}">
<h2>Icon/Color Guide</h2>

<dl class="dl-horizontal">
Expand All @@ -422,7 +425,7 @@ <h2>Icon/Color Guide</h2>
<button class="btn btn-primary" data-ng-click="cancel()">Close</button>
</div>

<div class="col-xs-3 right-settings" data-ng-class="{'hidden': !notificationVisible}">
<div class="col-xs-3 right-settings" data-ng-if="activeSection" data-ng-class="{'hidden': !notificationVisible}">
<div data-ng-if="notificationType === 'saving'">
<h2><i class="fa fa-spinner"></i> Data is saving</h2>
<p>sda dasd asdadadasd asdasdasd asdasdad asdada</p>
Expand Down
69 changes: 67 additions & 2 deletions static_files/app/gradebook/modules/gradebook/gradebookCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ angular.module('gradeBookApp.controllers')
[
'$scope',
'courseFactory',
'assignmentCategoryFactory',
'assignmentFactory',
'assignmentTypeFactory',
'benchmarkFactory',
'schoolYearFactory',
'sectionFactory',
'$log',
function ($scope, courseFactory, assignmentFactory, schoolYearFactory, sectionFactory, $log) {
function ($scope, courseFactory, assignmentCategoryFactory, assignmentFactory, assignmentTypeFactory, benchmarkFactory, schoolYearFactory, sectionFactory, $log) {

/***
* GET LIST OF COURSES
*/
var getCourses = function () {
courseFactory.get().$promise.then(
function (result) {
Expand All @@ -18,6 +24,40 @@ angular.module('gradeBookApp.controllers')
)
};

/***
* GET LIST OF CATEGORIES
*/
var getCategoryList = function () {
assignmentCategoryFactory.get().$promise.then(
function (result) {
$scope.assignmentCategories = result;
}
)
};


/***
* GET LIST OF ASSIGNMENT TYPES
*/
var getAssignmentTypeList = function () {
assignmentTypeFactory.get().$promise.then(
function (result) {
$scope.assignmentTypes = result;
}
)
};

/***
* GET BENCHMARK LIST
*/
var getBenchmarkList = function () {
benchmarkFactory.get().$promise.then(
function (result) {
$scope.benchmarkList = result;
}
)
}

var hideRightColumn = function () {
$scope.filtersVisible = false;
$scope.settingsVisible = false;
Expand All @@ -27,6 +67,9 @@ angular.module('gradeBookApp.controllers')
$scope.notificationType = null;
};

/***
* GET ACTIVE MARKING PERIOD
*/
var getActiveMarkingPeriod = function () {
schoolYearFactory.get().$promise.then(
function (result){
Expand All @@ -40,8 +83,20 @@ angular.module('gradeBookApp.controllers')
)
};

var dateToYMD = function (date) {
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getFullYear();
return '' + y + '-' + (m<=9 ? '0' + m : m) + '-' + (d <= 9 ? '0' + d : d);
};

/***
* GET SECTION BY SECTION ID
* @param sectionId
*/
$scope.getSection = function (sectionId) {
$scope.activeSection = sectionId;

$scope.activeSection = sectionId;
sectionFactory.get({sectionId: sectionId}).$promise.then(
function (result) {
$scope.sectionSelected = true;
Expand All @@ -63,10 +118,17 @@ angular.module('gradeBookApp.controllers')

$scope.markingPeriodSet = [];

/***
* SAVE ASSIGNMENT
*/
$scope.saveAssignment = function () {

$scope.newAssignment.course_section = $scope.activeSection;

assignmentFactory.create($scope.newAssignment).$promise.then(
function (result) {
console.log(result);
$scope.newAssignment = {};
hideRightColumn();
}
)
Expand Down Expand Up @@ -139,6 +201,9 @@ angular.module('gradeBookApp.controllers')


getCourses();
getCategoryList();
getAssignmentTypeList();
getBenchmarkList();
getActiveMarkingPeriod();

}
Expand Down
94 changes: 88 additions & 6 deletions static_files/app/gradebook/scss/gradebook-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
cursor:pointer;
}

nav > li.active > a {
text-decoration: none;
background-color: #eeeeee;
}

h2{
font-size: 2.625rem;
font-weight: normal;
Expand Down Expand Up @@ -147,16 +152,93 @@
}
}

.handsontable tr:first-child th,
.handsontable tr:first-child td{
//.handsontable tr:first-child th,
//.handsontable tr:first-child td{
// border-top:0;
//}
//
//
//table tbody tr td,
//table tbody tr th ,
//table tbody tr td:first-child,
//table tbody tr th:first-child{
// vertical-align: top
//}


.handsontableInput{
box-sizing: content-box;
}
h2{
font-size: 2.625rem;
font-weight: normal;
line-height: 4rem;
}

h3{
font-size: 1.8rem;
font-weight: normal;
line-height: 3rem;
}

p{
font-weight: 400;
font-size: 16px;
font-size: 1rem;
margin-bottom: 13px;
line-height: 1.625em;
}

label.year-teacher{
line-height:36px;
}
a{
font-family: Arial, sans-serif;
}

.button{
margin-left: 5px;
margin-right: 10px;

}

.handsontable tr:first-child th, .handsontable tr:first-child td{
border-top:0;
}
.handsontable thead th{
text-transform: uppercase;
}
.handsontable th, .handsontable td{
height: 30px;
line-height: 30px;
}

.handsontable th{
color: #888;
white-space: nowrap;
border-left: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgi…pZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
background-size: 100%;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee),color-stop(100%, #e0e0e0));
background-image: -moz-linear-gradient(#eeeeee,#e0e0e0);
background-image: -webkit-linear-gradient(#eeeeee,#e0e0e0);
background-image: linear-gradient(#eeeeee,#e0e0e0);
}

table tbody tr td,
table tbody tr th ,
table tbody tr td:first-child,
table tbody tr th:first-child{
table tbody tr td,table tbody tr th ,
table tbody tr td:first-child, table tbody tr th:first-child{
// border-bottom: 1px solid #e0e0e0;
// border-left: 1px solid #e4e4e4 !important;
vertical-align: top
}

.modal{
background: rgba(255,255,255,.6);
}
.modal > .content{
border: 1px solid #e4e4e4;
border-radius: 4px;
}


Loading