Skip to content

Commit

Permalink
Refactoring & bug-fixes (#19)
Browse files Browse the repository at this point in the history
* Renamed admin into member-client

(will also be done for user-client)

* Adopted commentControllers and service in user-client

* fixed portugese document generation

* Added German and Portuguese Project Descriptions to Review Page
Added missing Concerns to Review Page
Improved Layout

* Updated setup.js

added config.js support

* Renamed user in user-client

* Updated schema

renamed Reviews to Reviewers

* Updated queries

* Updated apiControllers

regarding renamed reviewers

* Updated templates in user-client

added „general_comment“ and „reviewer(s)“ to submission-view

* Updated schema

Added attribute „updated“ to Revisions to show the submitted timestamp
inside the user-/admin-clients

* Updated queries

* Updated templates

* Added missing fields in accountEditController

* Refactoring

- integrated navController inside mainController
- fixed promises in documentDetailsController
- fixed editDocument-template

* Changes

* Added Authorization to apiControllers

- updated apiControllers
- updated routes
- updated queries

* Bug-fixes

* Fixes

* Started admin-client implementation

* Fixed queries & apiControllers

* Added services, templates and controllers to member-client

(still in progress)

* fixed new user creation.

* added missing English translations.
refactored all text on site into languages.js

* Fixed document Creation.
Fixed infinite loading screen after User Creation.

* Changes

* Changes

* Changes

* Changes

* Changes

* Fixed registration & sign-up in user-client

* Changes

* Changes

* Updated queries and apiController

with authorization

* Updated queries and apiControllers

for filtering documents by user or course

* Implemented controllers and services in admin-client

(still in progress)

* fixed wrong symbols.

* Added missing English Translations.

* Improved Layout.

* Altered Login-Message on Member client.

* Changes

* Changes

* Changes

* Added missing translations

* Changes

* Updated schema

- Renamed „Research_Groups“ as „Working_Groups“ (for better name
convention, regarding non-research-groups, like the webteam)
- Renamed „deleted“ as „former“ in Members, Institutes, Working_Groups
- Renamed „deleted“ as „blocked“ in Users
- Set „university_id“, „institute_id“, „working_group_id“ as real
reference keys in Members and Users

* Renaming research_groups as working_groups

* Changes

* Fixed queries

* Cleaned up repository

deleted old admin-client

* Updated schema

* Fixed queries

(updating apiControllers is still in progress)

* Fixed apiControllers

* Fixed templates and controllers in user-client

* Added reviewController and updated templates in admin-client

(still in progress)

* Template improvements

* Updated queries, apiControllers and routes

* Implemented reviewController

(still in progress)

* Translations

* Implemented reviewController & apiControllers

(reviewing is finally working, but some parts are still in progress)

* Added missing controllers in admin-client & template improvements

(still in progress)

* Fixed and added missing apiControllers

(still in progress)

* Template and controller improvements

(still not finished)

* removed 'Signature of Participant' from  Statement of Researcher

* Updated dependencies

* Improvements for createCourseController and template

(adding responsibilities is still in progress)

* Code-cleaning

* Template improvements

* Fixed filtering for documents

With this fix, documents will be always filter by the institute, the
institute_id is given by the authenticated member, so that documents of
other institutes can not be seen and reviewed

* Fixed queries

* Template improvements

* Typo-fix

* Fixed Authorization for admins

* Fixed apiControllers and queries

Users, members and courses will be filtered by the institute, which the
authenticated member belongs to

* Template and controller improvements

* Fixed document in navbar

* Caching filter settings

* Code-cleaning

* Added missing controllers and templates in member-client

* Template improvements in member-client

* Template improvements in member-client

* Added Introduction to App to UC.

* fixed constraints in SQL Schema.

* Refactored group_id to working_group_id in API controller.

* Added Delete Functionality for Universities, Institutes, WorkingGroups.
- Added controllers
- Added Templates
- Activated routes
- Activated in index.html

* Template improvements

* Added warning-boxes before deleting administrative entries

* Implemented pagination for documents

* Updated languages

* Template improvements

* Fixes

* Added missing English Translations.
fixed typo in Template

* fixed typo.
Added link to User-Client on login Page of MC

* Added automatic refresh for documents

in documentListController

* Updated queries and apiControllers

for creating and editing Courses and their corresponding
Responsibilities

* Typo-fixes

* Implemented create- and editCourseController in member-client

* Updated services in member-client

* Updated translations and templates

* Typo-fixes

* Typo-fixes

* Updated queries for application-wide paginations

* Updated apiControllers

(still in progress)

* Implemented application-wide paginations

(universityDetailsController and instituteDetailsController are
temporary not fully working, will be fixed soon, after the server-side
implementation)

* Changes

* Added createUniversity Functionality.

* Fixes

* bugfixes.

* Added editUniversity Functionality.

* Fixed queries and apiControllers

* Fixed related institutes of a university

in the member-client

* Changes

* Implemented missing apiControllers

* Typo-fixes

* Updated queries and apiControllers

* Improvements for services, controllers and templates

in member- and user-client

* Typo-fix

* Typo-fixes

* Added manual

* Template improvements

* Added createInstitute Functionality.

* fixed typo.

* Added createWorkingGroup Functionality.

* added Edit Functionality for Institutes and Working Groups.
Fixed API Controller for institutes.put.

* Typo-fixes

* Updated queries and apiControllers

* Added pagination for members in user-client

* Fixed apiController

* Updated translations

* Updated languages and templates

* Changes

* Updated languages and templates

* Updated languages and templates

* Updated languages and templates

* Updated languages and templates

* Updated queries and apiControllers

* Updated apiControllers

* Template improvements

* Updated schema

* Implemented documentDeleteController in member-client

* Implemented documentFilesController in member-client

* Implemented userCreate- & userEditController in member-client

* Updated email-templates

* Added ngCloak to the user- and member-client

* Improved email-templates

(still in progress)

* Improved and added new email-templates

* Updated apiControllers

revised controllers and added email-support

* Added FAQ, Troubleshooting, Contact.

* bugfixes.

* bugfix.

* Added missing translations.

* Fixed typos.
Uncommented Test Placeholders.
Added final Submit Warning.

* Updated apiControllers & fixed queries

* Updated languages

* Improved & fixed email-templates

* Changes

* Changes

* Updated queries and apiControllers

* Implemented memberCreate- & memberEditController in member-client

(editAccountController in member-client is still in progress)

* Typo-fixes

* Implemented accountEditController in member-client

* Bug-fixes

* Implemented server-side sorting

updated queries & apiControllers

* Fixed queries and apiControllers

* Added sorting in all templates of the member-client

* Added information before overwriting a review

* Fixed queries

* Updated services

* Fixed queries

* Added sorting and pagination to detailsController in member-client

* Updated defaults.sql.sample and examples.sql.sample

* Implemented login by document in member-client

* Improved templates

- Added info-fields to document edit template in user-client
- Added info-field to document review template

* Fixes

* Implemented recovery and reset password controllers

in API and member-client

* Fixed JWTs

* Improved templates in user-client

* Template improvements

* Updated schema

Added new relation „Notes“

* Implemented apiControllers for notes

and updated queries and other apiControllers

* Implemented notes in member-client

for auto-saving working-notes

* Added missing apiController

to retrieve a course by document

* Added editSettingsController for a document in member-client

(still in progress)

* Improved templates

* Updated queries

* Updated languages

* Updated schema

Added „secret“ attribute members to setup one administrator, which can
not be deleted

* Updated queries and apiController

to filter documents also with/without a course

* Improved templates

* Updated queries and apiController

to filter all accepted by review and auto accepted documents

* Added reviseController in user-client

* Removed hard-coded port

* Typo-fixes in services

* Implemented editSettingsController in member-client

* Added server-port

* Fixed queries and apiControllers

Improved the filtering by an attribute for 3 cases: attribute is „true“
or „false“ or „both“ (=when the boolean is „undefined“)

* Fixed services and controllers

- renamed global „filter“ to „cached_filter“, as well as corresponding
functions, „getFilter“ and „setFilter“ to „getCachedFilter“,
„setCachedFilter“ to different the global filters setting from the
local filters
- fixed filtering by former/blocked attribute

* Improved templates

* Typo-fixes

* Fixed createDocumentController in user-client

* Fixed apiControllers

* Fixes for connecting a document to a course

* Fixed controllers and improved templates

* Fixed queries and apiController

* Fixed controllers and templates in member- and user-client

- Updated local filters to retrieve the correct list of
dropdown-options (without „former“, „blocked“ status in
createControllers - with „former“, „blocked“ status in editControllers)
- Fixed autocompletes in templates

* Implemented full text search for documents in member-client #15

* Cleaned up repository

* Updated services

for full text search

* Fixed queries

* Typo-fixes

* Implemented full text search for universities, institutes & workingGroups in member-client #15

* Implemented full text search for courses in member-client #15

* Implemented full text search for members in member-client #15

* Implemented full text search for users in member-client #15

* Improved templates and controllers

* Bug-fixes

Fixed bug in dropdowns, caused by options, which have been set in the
meantime to former

* Improved MC Manual.

* fixed.

* Updated queries and apiController

* Template improvements

* Implemented reviseController in user-client

(still in progress)

* Implemented reviseController in user-client

* Added translations

* Changes

* Updated README

* Update README.md

* Bug-fix in apiController

* fixed typos.
rephrased to proper English.

* - Fixed the missing translation on submit page.
- Moved the "Start Review"/"Open Review" Buttons to top of the page
- Added subtitles to Files at download (provided by fhillen)

* updated showfiles template.

* fixed typo.

* Template improvements

* Updated language.js

* Updated config.js

* Bug-fixes and refactoring

- deleted config.js and replaced it with an .env-file, following the
dotenv-guidline
- Code-cleaning
- bug-fixes in email-templates and notifications

* Bug-fixes and refactoring

- Added path variables for the member- & user-client to the .env file
- Fixed email-templates
- Updated README

* Bug-fix

* Template improvements

* Refactoring loading- & alert-messages

Updated languages.js and related controllers in user- and member-client

* Typo-fix

* Updated help in member-client
  • Loading branch information
nicho90 authored May 23, 2017
1 parent 1b4015d commit b83738c
Show file tree
Hide file tree
Showing 91 changed files with 2,666 additions and 285 deletions.
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
NODE_ENV='development'
SERVER_URL='http://localhost'
SERVER_PORT=5000
MEMBER_CLIENT_PATH='/member-client'
USER_CLIENT_PATH='/user-client'
HTTP_PORT=5000
HTTPS_PORT=5443
POSTGRES_HOST='localhost'
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ git clone https://github.com/sitcomlab/Ethics-app.git
node npm install
```

* Alternatively you can also use **yarn** for that (run the command with `sudo`, if you don't have permission):

```
yarn install
```

##### 2.4. Bower

* Install Bower via **npm** (run the command with `sudo`, if you don't have permission):
Expand Down Expand Up @@ -255,6 +261,8 @@ node server.js
* `NODE_ENV`: server environment (default: `development`, option: `production`, which uses https with a certificate)
* `SERVER_URL`: url/domain of the host-server (default: `http://ethics-app.uni-muenster.de`)
* `SERVER_PORT`: port number of the host-server (default: `80`)
* `MEMBER_CLIENT_PATH`: path to the member-client on the host-server (default: `/member-client`)
* `USER_CLIENT_PATH`: path to the user-client on the host-server (default: `/user-client`)
* `HTTP_PORT`: port number of the nodejs-server: (default: `5000`)
* `HTTPS_PORT`: secure port number of the nodejs-server: (default: `HTTP_PORT + 443`)
* `POSTGRES_HOST`: Postgres host address (default: `localhost`)
Expand Down
3 changes: 2 additions & 1 deletion controllers/documents/change_status.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ var types = require('pg').types;
types.setTypeParser(1700, 'text', parseFloat);
var _ = require('underscore');
var jwt = require('jsonwebtoken');
var jwtSecret = require('../../server.js').jwtSecret;
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var user_client_path = process.env.USER_CLIENT_PATH;
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;

Expand Down Expand Up @@ -380,6 +380,7 @@ exports.request = function(req, res) {
status_description_1: status_description_1,
status_description_2: status_description_2,
domain: domain,
user_client_path: user_client_path,
year: moment().format("YYYY")
});

Expand Down
2 changes: 2 additions & 0 deletions controllers/documents/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var uuid = require('uuid');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var user_client_path = process.env.USER_CLIENT_PATH;
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;

Expand Down Expand Up @@ -211,6 +212,7 @@ exports.request = function(req, res) {
user: user,
document: document,
domain: domain,
user_client_path: user_client_path,
year: moment().format("YYYY")
});

Expand Down
5 changes: 2 additions & 3 deletions controllers/documents/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var member_client_path = process.env.MEMBER_CLIENT_PATH;
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;

Expand Down Expand Up @@ -373,9 +374,6 @@ exports.request = function(req, res) {
concern.q13_sign = "no";
}

// Formatting
document.link = domain + "/committee/documents/" + document.document_id + "/login";

// Notify each committee member
async.eachOfSeries(members, function (member, key, callback) {

Expand All @@ -389,6 +387,7 @@ exports.request = function(req, res) {
concern: concern,
course: course,
domain: domain,
member_client_path: member_client_path,
year: moment().format("YYYY")
});

Expand Down
4 changes: 3 additions & 1 deletion controllers/members/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var member_client_path = process.env.MEMBER_CLIENT_PATH;
var jwt = require('jsonwebtoken');
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;
Expand Down Expand Up @@ -38,7 +39,7 @@ exports.request = function(req, res) {
var token = req.headers.authorization.substring(7);

// Verify token
jwt.verify(token, jwtSecret, function(err, decoded) {
jwt.verify(token, process.env.JWTSECRET, function(err, decoded) {
if(err){
callback(new Error("Authorization failed"), 401);
} else {
Expand Down Expand Up @@ -89,6 +90,7 @@ exports.request = function(req, res) {
var output = mustache.render(template_member_account_created, {
member: member,
domain: domain,
member_client_path: member_client_path,
year: moment().format("YYYY")
});

Expand Down
3 changes: 3 additions & 0 deletions controllers/members/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var member_client_path = process.env.MEMBER_CLIENT_PATH;
var jwt = require('jsonwebtoken');
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;
Expand Down Expand Up @@ -224,6 +225,7 @@ exports.request = function(req, res) {
member: member,
updated_member: updated_member,
domain: domain,
member_client_path: member_client_path,
year: moment().format("YYYY")
});
} else {
Expand All @@ -233,6 +235,7 @@ exports.request = function(req, res) {
member: member,
updated_member: updated_member,
domain: domain,
member_client_path: member_client_path,
year: moment().format("YYYY")
});
}
Expand Down
2 changes: 2 additions & 0 deletions controllers/recovery/find_member_by_email.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var member_client_path = process.env.MEMBER_CLIENT_PATH;
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;
var jwt = require('jsonwebtoken');
Expand Down Expand Up @@ -78,6 +79,7 @@ exports.request = function(req, res) {
var output = mustache.render(template_member_recovery, {
member: member,
domain: domain,
member_client_path: member_client_path,
year: moment().format("YYYY")
});

Expand Down
2 changes: 2 additions & 0 deletions controllers/recovery/find_user_by_email.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var user_client_path = process.env.USER_CLIENT_PATH;
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;

Expand Down Expand Up @@ -142,6 +143,7 @@ exports.request = function(req, res) {
amount: amount,
amount_description: amount_description,
domain: domain,
user_client_path: user_client_path,
year: moment().format("YYYY")
});

Expand Down
1 change: 1 addition & 0 deletions controllers/recovery/reset_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var member_client_path = process.env.MEMBER_CLIENT_PATH;
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;
var jwt = require('jsonwebtoken');
Expand Down
2 changes: 2 additions & 0 deletions controllers/users/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var user_client_path = process.env.USER_CLIENT_PATH;
var jwt = require('jsonwebtoken');
var pool = require('../../server.js').pool;
var transporter = require('../../server.js').transporter;
Expand Down Expand Up @@ -57,6 +58,7 @@ exports.request = function(req, res) {
var output = mustache.render(template_user_account_created, {
user: user,
domain: domain,
user_client_path: user_client_path,
year: moment().format("YYYY")
});

Expand Down
6 changes: 5 additions & 1 deletion controllers/users/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ var _ = require('underscore');
var mustache = require('mustache');
var moment = require('moment');
var domain = process.env.SERVER_URL + ":" + process.env.SERVER_PORT;
var user_client_path = process.env.USER_CLIENT_PATH;
var jwt = require('jsonwebtoken');
var pool = require('../../server.js').pool;
var jwtSecret = require('../../server.js').jwtSecret;
var transporter = require('../../server.js').transporter;

var fs = require("fs");
Expand Down Expand Up @@ -141,6 +141,8 @@ exports.request = function(req, res) {
output = mustache.render(template_user_account_blocked, {
user: user,
updated_user: updated_user,
domain: domain,
user_client_path: user_client_path,
year: moment().format("YYYY")
});
} else {
Expand All @@ -149,6 +151,8 @@ exports.request = function(req, res) {
output = mustache.render(template_user_account_reactivated, {
user: user,
updated_user: updated_user,
domain: domain,
user_client_path: user_client_path,
year: moment().format("YYYY")
});
}
Expand Down
33 changes: 19 additions & 14 deletions public/member-client/js/controllers/account/editController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var app = angular.module("ethics-app");


// Account edit controller
app.controller("accountEditController", function($scope, $rootScope, $routeParams, $filter, $translate, $location, config, $window, $authenticationService, $memberService, $universityService, $instituteService, $workingGroupService) {
app.controller("accountEditController", function($scope, $rootScope, $routeParams, $filter, $translate, $location, config, $window, $timeout, $authenticationService, $memberService, $universityService, $instituteService, $workingGroupService) {

/*************************************************
FUNCTIONS
Expand Down Expand Up @@ -82,36 +82,40 @@ app.controller("accountEditController", function($scope, $rootScope, $routeParam
// Cache token
var token = $authenticationService.getToken();

// Check if passwords are equal, if it has been changed
// Check if has been changed
if($scope.updated_member.new_password){
// Check if new passwords are equal
if($scope.updated_member.password === $scope.repeated_password){
$scope.$parent.loading = { status: true, message: $filter('translate')('SAVING_MEMBER') };
$scope.$parent.loading = { status: true, message: $filter('translate')('SAVING_ACCOUNT_SETTINGS') };

// Update member
$memberService.edit($scope.authenticated_member.member_id, $scope.updated_member)
.then(function onSuccess(response) {
var authenticated_member = response.data;
authenticated_member.token = token;
$authenticationService.set(authenticated_member);
response.data.token = token;
$authenticationService.set(response.data);

// Reset navbar
$scope.$parent.authenticated_member = $authenticationService.get();
$scope.$parent.loading = { status: false, message: "" };

// Redirect
$scope.redirect("/members/" + $scope.authenticated_member.member_id);

})
.catch(function onError(response) {
$window.alert(response.data);
});
} else {
$window.alert("Your passwords are not equal!");
$window.alert($filter('translate')('ALERT_PASSWORD_NOT_EQUAL'));
}
} else {
$scope.$parent.loading = { status: true, message: $filter('translate')('SAVING_MEMBER') };
$scope.$parent.loading = { status: true, message: $filter('translate')('SAVING_ACCOUNT_SETTINGS') };

// Update member
$memberService.edit($scope.authenticated_member.member_id, $scope.updated_member)
.then(function onSuccess(response) {
var authenticated_member = response.data;
authenticated_member.token = token;
$authenticationService.set(authenticated_member);
response.data.token = token;
$authenticationService.set(response.data);

// Reset navbar
$scope.$parent.authenticated_member = $authenticationService.get();
Expand All @@ -136,7 +140,7 @@ app.controller("accountEditController", function($scope, $rootScope, $routeParam
// Check which kind of related data needs to be requested
switch (related_data) {
case 'universities': {
$scope.$parent.loading = { status: true, message: "Loading universities" };
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_UNIVERSITIES') };

// Load universities
$universityService.list({
Expand All @@ -156,7 +160,7 @@ app.controller("accountEditController", function($scope, $rootScope, $routeParam
case 'institutes': {
if($scope.university_id){
if($scope.university_id !== null){
$scope.$parent.loading = { status: true, message: "Loading institutes" };
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_INSTITUTES') };

// Load related institutes
$instituteService.listByUniversity($scope.university_id, {
Expand Down Expand Up @@ -189,7 +193,7 @@ app.controller("accountEditController", function($scope, $rootScope, $routeParam
case 'working_groups': {
if($scope.institute_id){
if($scope.institute_id !== null){
$scope.$parent.loading = { status: true, message: "Loading working groups" };
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_WORKING_GROUPS') };

// Load related working groups
$workingGroupService.listByInstitute($scope.institute_id, {
Expand Down Expand Up @@ -225,6 +229,7 @@ app.controller("accountEditController", function($scope, $rootScope, $routeParam
/*************************************************
INIT
*************************************************/
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_ACCOUNT_SETTINGS') };
$scope.authenticated_member = $authenticationService.get();
$scope.repeated_password = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ app.controller("courseCreateController", function($scope, $rootScope, $routePara
$scope.createCourseForm.lecturer.$pristine = false;
$scope.createCourseForm.institute_id.$pristine = false;
} else {
$scope.$parent.loading = { status: true, message: "Creating new course" };
$scope.$parent.loading = { status: true, message: $filter('translate')('CREATING_NEW_COURSE') };

// Create new course
$courseService.create($scope.new_course)
Expand Down Expand Up @@ -111,7 +111,7 @@ app.controller("courseCreateController", function($scope, $rootScope, $routePara
// Check which kind of related data needs to be requested
switch (related_data) {
case 'universities': {
$scope.$parent.loading = { status: true, message: "Loading universities" };
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_UNIVERSITIES') };

// Load universities
$universityService.list({
Expand All @@ -131,7 +131,7 @@ app.controller("courseCreateController", function($scope, $rootScope, $routePara
case 'institutes': {
if($scope.university_id){
if($scope.university_id !== null){
$scope.$parent.loading = { status: true, message: "Loading institutes" };
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_INSTITUTES') };

// Load related institutes
$instituteService.listByUniversity($scope.university_id, {
Expand Down Expand Up @@ -172,7 +172,7 @@ app.controller("courseCreateController", function($scope, $rootScope, $routePara
case 'members': {
if($scope.new_course.institute_id){
if($scope.new_course.institute_id !== null){
$scope.$parent.loading = { status: true, message: "Loading members" };
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_MEMBERS') };

// Load related members
$memberService.listByInstitute($scope.new_course.institute_id, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ app.controller("courseDeleteController", function($scope, $rootScope, $routePara
* @return {[type]} [description]
*/
$scope.delete = function(){
$scope.$parent.loading = { status: true, message: "Deleting course" };
$scope.$parent.loading = { status: true, message: $filter('translate')('DELETING_COURSE') };

// Delete course
$courseService.remove($scope.course.course_id)
Expand All @@ -37,7 +37,7 @@ app.controller("courseDeleteController", function($scope, $rootScope, $routePara
/*************************************************
INIT
*************************************************/
$scope.$parent.loading = { status: true, message: "Loading course" };
$scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_COURSE') };
$scope.input = "";

// Load course
Expand Down
Loading

0 comments on commit b83738c

Please sign in to comment.