Skip to content

Commit

Permalink
Merge pull request #58 from Elthan/minor-fixes
Browse files Browse the repository at this point in the history
Several minor fixes
  • Loading branch information
torgeirl committed Aug 2, 2018
2 parents a1db2ee + bcf352f commit 225e4cb
Show file tree
Hide file tree
Showing 24 changed files with 482 additions and 308 deletions.
1 change: 0 additions & 1 deletion requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Markdown==2.6.11
pygments==2.2.0
PyYAML==3.12
cradmin-legacy==1.3.0a0
bleach==2.1.3

#-e git://github.com/appressoas/django_cradmin.git#egg=django_cradmin

Expand Down
8 changes: 7 additions & 1 deletion trix/trix_admin/cradmin.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from cradmin_legacy import crinstance
from trix.trix_admin.views import roleselect
from cradmin_legacy import crmenu

from trix.trix_admin.views import roleselect
from trix.trix_core.models import Course
from .views import assignments
from .views import permalinks
Expand Down Expand Up @@ -32,6 +33,11 @@ def get_menuitem_class(self):
return MenuItem

def build_menu(self):
self.add_menuitem(
label=_('Frontpage'),
url=reverse('trix_student_dashboard'),
extra_context_data={'icon': 'home'}
)
self.add_menuitem(
label=_('Course overview'),
url=self.cradmin_instance.roleselectview_url(),
Expand Down
1 change: 1 addition & 0 deletions trix/trix_admin/css_icon_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
'database': 'fa fa-database',
'link': 'fa fa-link',
'chart-bar': 'fa fa-chart-bar',
'home': 'fa fa-home',
'wrench': 'fa fa-wrench'})
FONT_AWESOME = css_icon_map.FONT_AWESOME
Binary file modified trix/trix_admin/locale/nb/LC_MESSAGES/django.mo
Binary file not shown.
36 changes: 20 additions & 16 deletions trix/trix_admin/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: trix_admin\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-31 15:19+0200\n"
"POT-Creation-Date: 2018-08-01 19:59+0200\n"
"PO-Revision-Date: 2015-01-08 12:35+0100\n"
"Last-Translator: Espen Angell Kristiansen <post@espenak.net>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -18,21 +18,25 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.5\n"

#: trix/trix_admin/cradmin.py:36
#: trix/trix_admin/cradmin.py:37
msgid "Frontpage"
msgstr ""

#: trix/trix_admin/cradmin.py:42
msgid "Course overview"
msgstr "Kursoversikt"

#: trix/trix_admin/cradmin.py:41
#: trix/trix_admin/cradmin.py:47
msgid "Assignments"
msgstr "Oppgaver"

#: trix/trix_admin/cradmin.py:46
#: trix/trix_admin/cradmin.py:52
msgid "Permalinks"
msgstr "Permalinker"

#: trix/trix_admin/cradmin.py:51
#: trix/trix_admin/templates/trix_admin/statistics.django.html:6
#: trix/trix_admin/templates/trix_admin/statistics.django.html:12
#: trix/trix_admin/cradmin.py:57
#: trix/trix_admin/templates/trix_admin/statistics.django.html:7
#: trix/trix_admin/templates/trix_admin/statistics.django.html:13
msgid "Statistics"
msgstr "Statistikk"

Expand Down Expand Up @@ -86,11 +90,11 @@ msgstr "Gå til superbruker panelet"
msgid "You need to ask a superuser to grant you superuser access."
msgstr "Du må be en superbruker om å gjøre deg til superbruker."

#: trix/trix_admin/templates/trix_admin/statistics.django.html:20
#: trix/trix_admin/templates/trix_admin/statistics.django.html:21
msgid "Aggregated statistics on how the assignments where solved"
msgstr "Aggregert statistikk over hvordan oppgavene ble løst"

#: trix/trix_admin/templates/trix_admin/statistics.django.html:46
#: trix/trix_admin/templates/trix_admin/statistics.django.html:45
msgid ""
"\n"
" The stats below show how many percentage of the total number "
Expand All @@ -104,34 +108,34 @@ msgstr ""
"som har løst oppgaven på egenhånd, med hjelp, eller ikke løst den.\n"
" "

#: trix/trix_admin/templates/trix_admin/statistics.django.html:53
#: trix/trix_admin/templates/trix_admin/statistics.django.html:52
msgid "Number of users:"
msgstr "Antall brukere:"

#: trix/trix_admin/templates/trix_admin/statistics.django.html:54
#: trix/trix_admin/templates/trix_admin/statistics.django.html:53
msgid "Number of assignments:"
msgstr "Antall oppgaver:"

#: trix/trix_admin/templates/trix_admin/statistics.django.html:58
#: trix/trix_admin/templates/trix_admin/statistics.django.html:57
msgid "Download csv file"
msgstr "Last ned csv fil"

#: trix/trix_admin/templates/trix_admin/statistics.django.html:93
#: trix/trix_admin/templates/trix_admin/statistics.django.html:92
#: trix/trix_admin/views/statistics.py:148
msgid "Completed by their own"
msgstr "Løst på egenhånd"

#: trix/trix_admin/templates/trix_admin/statistics.django.html:99
#: trix/trix_admin/templates/trix_admin/statistics.django.html:98
#: trix/trix_admin/views/statistics.py:155
msgid "Completed with help"
msgstr "Løst med hjelp"

#: trix/trix_admin/templates/trix_admin/statistics.django.html:105
#: trix/trix_admin/templates/trix_admin/statistics.django.html:104
#: trix/trix_admin/views/statistics.py:159
msgid "Not completed"
msgstr "Ikke løst"

#: trix/trix_admin/templates/trix_admin/statistics.django.html:111
#: trix/trix_admin/templates/trix_admin/statistics.django.html:110
msgid "There was no assignments matching the choosen tag"
msgstr "Det fantes ingen oppgaver som er merket med valgte tag"

Expand Down
Binary file modified trix/trix_core/locale/nb/LC_MESSAGES/django.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion trix/trix_core/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: trix_core\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-31 15:19+0200\n"
"POT-Creation-Date: 2018-08-01 19:59+0200\n"
"PO-Revision-Date: 2014-12-21 22:43+0100\n"
"Last-Translator: Tor Ivar Johansen <tor@appresso.no>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
Binary file modified trix/trix_student/locale/nb/LC_MESSAGES/django.mo
Binary file not shown.
48 changes: 28 additions & 20 deletions trix/trix_student/locale/nb/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: trix_student\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-31 15:19+0200\n"
"POT-Creation-Date: 2018-08-01 19:59+0200\n"
"PO-Revision-Date: 2015-01-03 17:40+0100\n"
"Last-Translator: Espen Angell Kristiansen <post@espenak.net>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -76,7 +76,7 @@ msgstr ""
"på din egen progresjon."

#: trix/trix_student/templates/trix_student/base.django.html:38
#: trix/trix_student/templates/trix_student/include/header.django.html:47
#: trix/trix_student/templates/trix_student/include/header.django.html:58
msgid "Sign in"
msgstr "Logg inn"

Expand Down Expand Up @@ -133,56 +133,65 @@ msgstr "For mer informasjon"
msgid "read the getting started guide"
msgstr "les kom igang guiden"

#: trix/trix_student/templates/trix_student/include/assignment.django.html:40
#: trix/trix_student/templates/trix_student/include/assignment.django.html:23
msgid "Hidden assignment"
msgstr "Skjult oppgave"

#: trix/trix_student/templates/trix_student/include/assignment.django.html:43
msgid "How did you solve the assignment?"
msgstr "Hvordan løste du oppgaven?"

#: trix/trix_student/templates/trix_student/include/assignment.django.html:50
#: trix/trix_student/templates/trix_student/include/assignment.django.html:53
msgid "On my own"
msgstr "På egenhånd"

#: trix/trix_student/templates/trix_student/include/assignment.django.html:59
#: trix/trix_student/templates/trix_student/include/assignment.django.html:62
msgid "With help"
msgstr "Med hjelp"

#: trix/trix_student/templates/trix_student/include/assignment.django.html:68
#: trix/trix_student/templates/trix_student/include/assignment.django.html:71
msgid "Not solved"
msgstr "Ikke løst"

#: trix/trix_student/templates/trix_student/include/assignment.django.html:74
#: trix/trix_student/templates/trix_student/include/assignment.django.html:77
msgid "Saving..."
msgstr "Lagrer..."

#: trix/trix_student/templates/trix_student/include/assignment.django.html:84
#: trix/trix_student/templates/trix_student/include/assignment.django.html:87
msgid "See solution"
msgstr "Vis løsningsforslag"

#: trix/trix_student/templates/trix_student/include/header.django.html:11
msgid "Toggle navigation"
msgstr "Vis/skjul navigering"

#: trix/trix_student/templates/trix_student/include/header.django.html:27
#: trix/trix_student/templates/trix_student/include/header.django.html:28
#: trix/trix_student/views/users.py:24
msgid "Superuser"
msgstr "Superbruker"

#: trix/trix_student/templates/trix_student/include/header.django.html:36
msgid "Administer"
msgstr "Administrer"

#: trix/trix_student/templates/trix_student/include/header.django.html:32
#: trix/trix_student/templates/trix_student/include/header.django.html:43
msgid "Profile"
msgstr ""
msgstr "Profil"

#: trix/trix_student/templates/trix_student/include/header.django.html:42
#: trix/trix_student/templates/trix_student/include/header.django.html:53
msgid "Sign out"
msgstr "Logg ut"

#: trix/trix_student/templates/trix_student/include/pager.django.html:27
#: trix/trix_student/templates/trix_student/include/pager.django.html:33
msgid "Previous"
msgstr "Forrige"

#: trix/trix_student/templates/trix_student/include/pager.django.html:31
#: trix/trix_student/templates/trix_student/include/pager.django.html:37
#, python-format
msgid "Page %(number)s of %(total)s"
msgstr "Side %(number)s av %(total)s"

#: trix/trix_student/templates/trix_student/include/pager.django.html:36
#: trix/trix_student/templates/trix_student/include/pager.django.html:46
msgid "Next"
msgstr "Neste"

Expand Down Expand Up @@ -268,14 +277,13 @@ msgstr ""
"Vennligst skriv inn en gyldig e-postaddresse og passord. Begge feltene "
"skiller mellom store og små bokstaver."

#: trix/trix_student/views/users.py:24
msgid "Superuser"
msgstr "Superbruker"

#: trix/trix_student/views/users.py:28
msgid "Administrator for "
msgstr "Administrator for"
msgstr "Administrator for "

#: trix/trix_student/views/users.py:30
msgid "Student"
msgstr "Student"

#~ msgid "Superuser panel"
#~ msgstr "Superbruker panel"
10 changes: 5 additions & 5 deletions trix/trix_student/static/trix_student/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "0.0.0",
"private": true,
"devDependencies": {
"angular": "~1.2",
"angular-mocks": "~1.2",
"angular": "1.7.2",
"angular-mocks": "^1.7.2",
"angular-cookies": "^1.7.2",
"angular-bootstrap": "^2.5.0",
"font-awesome": "^5.1.0",
"components-font-awesome": "~5.0.6",
"bootstrap": "~3.1.1",
"jsurl": "*",
"angular-bootstrap": "~0.11.0",
"pygments": "~2.1.3",
"angular-cookies": "~1.2.18"
"pygments": "~2.1.3"
}
}
6 changes: 3 additions & 3 deletions trix/trix_student/static/trix_student/dist/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -8544,9 +8544,6 @@ nav#trix_header {
border: none;
margin-bottom: 0;
}
.trix-nav-links {
float: left;
}
.page-header {
background: #f4f4f4;
margin-top: 0;
Expand Down Expand Up @@ -8705,6 +8702,9 @@ fieldset[disabled] .btn-trix-admin.active {
margin-top: 5px;
border: 1px solid #eee;
}
.trix-assignment-hidden {
background: repeating-linear-gradient(-45deg, #ccc, #ccc 1px, transparent 1px, transparent 60px);
}
#assignments-taggingbox .assignments-progressbox {
min-height: 80px;
}
Expand Down
31 changes: 18 additions & 13 deletions trix/trix_student/static/trix_student/dist/js/trix_student.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
(function() {
angular.module('trixStudent', ['ngCookies', 'ui.bootstrap', 'trixStudent.directives', 'trixStudent.assignments.controllers']).run([
angular.module('trixStudent', ['ngCookies', 'ui.bootstrap', 'trixStudent.directives', 'trixStudent.assignments.controllers']).config([
'$httpProvider',
function($httpProvider) {
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
return $httpProvider.defaults.xsrfCookieName = 'csrftoken';
}
]).run([
'$http',
'$cookies',
function($http,
Expand Down Expand Up @@ -104,10 +110,11 @@
howsolved: howsolved
};
return $http.post($scope._getApiUrl(),
data).success(function(data) {
data).then(function(response) {
$scope.saving = false;
return $scope.howsolved = data.howsolved;
}).error(function(data) {
return $scope.howsolved = response.data.howsolved;
}).catch(function(response) {
console.log(response);
return $scope._showError('An error occurred!');
});
};
Expand All @@ -119,12 +126,11 @@
};
return $scope.notSolved = function() {
$scope.saving = true;
return $http.delete($scope._getApiUrl()).success(function(data) {
return $http.delete($scope._getApiUrl()).then(function(response) {
$scope.saving = false;
return $scope.howsolved = null;
}).error(function(data,
status) {
if (status === 404) { // Handle 404 just like 200
}).catch(function(response) {
if (reponse.status === 404) { // Handle 404 just like 200
$scope.saving = false;
return $scope.howsolved = null;
} else {
Expand All @@ -147,9 +153,9 @@
apiUrl.query.progressjson = '1';
$scope._loadProgress = function() {
$scope.loading = true;
return $http.get(apiUrl.toString()).success(function(data) {
return $http.get(apiUrl.toString()).then(function(response) {
$scope.loading = false;
$scope.solvedPercentage = data.percent;
$scope.solvedPercentage = response.data.percent;
if ($scope.solvedPercentage > 1 && $scope.solvedPercentage < 20) {
return $scope.progressBarClass = 'progress-bar-danger';
} else if ($scope.solvedPercentage < 45) {
Expand All @@ -159,9 +165,9 @@
} else {
return $scope.progressBarClass = '';
}
}).error(function(data) {
}).catch(function(response) {
return console.error('Failed to load progress:',
data);
reponse.statusText);
});
};
unbindProgressChanged = $rootScope.$on('assignments.progressChanged',
Expand Down Expand Up @@ -194,7 +200,6 @@
};
updateAriaChecked();
scope.$watch(attrs.trixAriaChecked, function(newValue, oldValue) {
// console.log 'Changed!', newValue
return updateAriaChecked();
});
}
Expand Down

0 comments on commit 225e4cb

Please sign in to comment.