Commit 807e78bc2346631390a09c037ef42b7602c78757

Authored by Jailson Dias
2 parents 3f21f981 25c98d9b

Merge branch 'refactoring' of https://github.com/amadeusproject/amadeuslms into refactoring

amadeus/context_processors.py
... ... @@ -11,7 +11,11 @@ def theme(request):
11 11 theme = Themes.objects.get(id = 1)
12 12  
13 13 context['theme'] = theme
14   -
  14 + if ("contrast_check" in request.COOKIES.keys()):
  15 + context ['contrast_cookie'] = True
  16 + else:
  17 + context ['contrast_cookie'] = False
  18 +
15 19 return context
16 20  
17 21 def notifies(request):
... ... @@ -48,4 +52,4 @@ def chat_notifies(request):
48 52  
49 53 context['chat_notifications_count'] = notifications
50 54  
51   - return context
52 55 \ No newline at end of file
  56 + return context
... ...
amadeus/templates/base.html
... ... @@ -63,10 +63,15 @@
63 63 <!-- Summernote -->
64 64 <script src="{% static 'summernote/summernote.js' %}" type="text/javascript"></script>
65 65 <link href="{% static 'summernote/summernote.css' %}" type="text/css" rel="stylesheet" />
  66 + {% if contrast_cookie %}
  67 + <link rel="stylesheet" type="text/css" href="{% static 'css/themes/contrast.css' %}">
  68 + {% else %}
  69 + {% with 'css/themes/'|add:theme.css_style|add:'.css' as theme_selected %}
  70 + <link rel="stylesheet" type="text/css" href="{% static theme_selected %}">
  71 + {% endwith %}
  72 + {% endif %}
  73 +
66 74  
67   - {% with 'css/themes/'|add:theme.css_style|add:'.css' as theme_selected %}
68   - <link rel="stylesheet" type="text/css" href="{% static theme_selected %}">
69   - {% endwith %}
70 75  
71 76  
72 77 </head>
... ...
backup.json
1   -[{"model": "topics.topic", "pk": 30, "fields": {"name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "subject": 459, "order": 1, "create_date": "2017-01-17T18:36:32.918Z", "last_update": "2017-01-17T21:48:07.630Z"}}, {"model": "topics.topic", "pk": 32, "fields": {"name": "Now Invisble", "slug": "now-invisble", "description": "<p>TIme to</p>", "repository": false, "visible": true, "subject": 459, "order": 2, "create_date": "2017-01-17T18:44:24.976Z", "last_update": "2017-03-08T01:28:52.845Z"}}][{"model": "topics.resource", "pk": 1, "fields": {"_my_subclass": "webpage", "name": "Revenge", "slug": "revenge", "brief_description": "<p>Here Comes</p>", "show_window": false, "all_students": false, "visible": true, "order": 1, "topic": 30, "create_date": "2017-01-20T22:42:16.126Z", "last_update": "2017-01-30T18:39:30.100Z", "students": [178, 181], "groups": [], "tags": [44, 45]}}, {"model": "topics.resource", "pk": 14, "fields": {"_my_subclass": "webpage", "name": "Care", "slug": "care", "brief_description": "<p>One last minute</p>", "show_window": true, "all_students": false, "visible": true, "order": 2, "topic": 30, "create_date": "2017-01-23T17:59:10.053Z", "last_update": "2017-01-24T21:53:17.119Z", "students": [], "groups": [], "tags": [58, 59]}}, {"model": "topics.resource", "pk": 41, "fields": {"_my_subclass": "filelink", "name": "Secret", "slug": "secret", "brief_description": "<p>Do we create a modern myth?</p>", "show_window": true, "all_students": true, "visible": false, "order": 3, "topic": 32, "create_date": "2017-01-24T21:55:44.193Z", "last_update": "2017-01-24T21:55:44.330Z", "students": [], "groups": [], "tags": [93, 94]}}, {"model": "topics.resource", "pk": 3, "fields": {"_my_subclass": "webpage", "name": "Teste 2", "slug": "teste-2", "brief_description": "<p>Here Comes</p>", "show_window": true, "all_students": false, "visible": true, "order": 3, "topic": 30, "create_date": "2017-01-23T17:17:28.416Z", "last_update": "2017-01-24T21:53:17.131Z", "students": [178, 181], "groups": [], "tags": [44, 45]}}, {"model": "topics.resource", "pk": 40, "fields": {"_my_subclass": "filelink", "name": "Alive", "slug": "alive", "brief_description": "<p>Nothern lights</p><p>I'm still</p>", "show_window": true, "all_students": true, "visible": true, "order": 4, "topic": 30, "create_date": "2017-01-24T21:52:58.028Z", "last_update": "2017-01-30T18:33:25.804Z", "students": [], "groups": [], "tags": [91, 92]}}, {"model": "topics.resource", "pk": 42, "fields": {"_my_subclass": "webpage", "name": "History goes", "slug": "history-goes", "brief_description": "<p>How</p>", "show_window": false, "all_students": false, "visible": false, "order": 4, "topic": 32, "create_date": "2017-01-24T21:57:13.600Z", "last_update": "2017-01-24T21:57:13.812Z", "students": [178], "groups": [], "tags": [95]}}, {"model": "topics.resource", "pk": 4, "fields": {"_my_subclass": "webpage", "name": "Have", "slug": "have", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 5, "topic": 30, "create_date": "2017-01-23T17:31:58.957Z", "last_update": "2017-01-24T21:53:17.155Z", "students": [179, 178], "groups": [], "tags": [46, 47]}}, {"model": "topics.resource", "pk": 21, "fields": {"_my_subclass": "webpage", "name": "Each small candle", "slug": "each-small-candle", "brief_description": "<p>Uhuh</p>", "show_window": false, "all_students": false, "visible": true, "order": 6, "topic": 30, "create_date": "2017-01-24T03:16:17.180Z", "last_update": "2017-01-24T21:53:17.164Z", "students": [177, 179], "groups": [], "tags": [71, 72]}}, {"model": "topics.resource", "pk": 5, "fields": {"_my_subclass": "webpage", "name": "Lose you", "slug": "lose-you", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 7, "topic": 30, "create_date": "2017-01-23T17:34:29.313Z", "last_update": "2017-01-24T21:53:17.175Z", "students": [179, 178], "groups": [], "tags": [46, 47]}}, {"model": "topics.resource", "pk": 16, "fields": {"_my_subclass": "webpage", "name": "Sing", "slug": "sing", "brief_description": "<p>Talking about</p>", "show_window": false, "all_students": false, "visible": false, "order": 8, "topic": 30, "create_date": "2017-01-23T22:10:39.437Z", "last_update": "2017-01-24T21:53:17.197Z", "students": [177, 178], "groups": [], "tags": [62, 63]}}, {"model": "topics.resource", "pk": 49, "fields": {"_my_subclass": "webpage", "name": "Testes", "slug": "testes", "brief_description": "<p>asd</p>", "show_window": false, "all_students": false, "visible": true, "order": 9, "topic": 30, "create_date": "2017-01-30T18:38:25.741Z", "last_update": "2017-01-30T18:38:25.878Z", "students": [179], "groups": [], "tags": [99]}}, {"model": "topics.resource", "pk": 50, "fields": {"_my_subclass": "webpage", "name": "Yellow", "slug": "yellow", "brief_description": "<p>Vber</p>", "show_window": false, "all_students": false, "visible": true, "order": 10, "topic": 30, "create_date": "2017-01-30T18:39:04.914Z", "last_update": "2017-01-30T18:39:05.212Z", "students": [180], "groups": [], "tags": [99]}}, {"model": "topics.resource", "pk": 51, "fields": {"_my_subclass": "ytvideo", "name": "System", "slug": "system", "brief_description": "<p>Gotta</p>", "show_window": true, "all_students": true, "visible": true, "order": 11, "topic": 30, "create_date": "2017-02-01T21:03:21.123Z", "last_update": "2017-02-02T23:08:32.570Z", "students": [], "groups": [], "tags": [103, 104]}}, {"model": "topics.resource", "pk": 53, "fields": {"_my_subclass": "link", "name": "Sorry", "slug": "sorry", "brief_description": "<p>Hellor</p>", "show_window": false, "all_students": true, "visible": true, "order": 12, "topic": 30, "create_date": "2017-02-02T18:59:06.159Z", "last_update": "2017-02-02T18:59:06.270Z", "students": [], "groups": [], "tags": [106]}}, {"model": "topics.resource", "pk": 56, "fields": {"_my_subclass": "pdffile", "name": "Legend", "slug": "legend", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 13, "topic": 30, "create_date": "2017-02-09T18:29:12.935Z", "last_update": "2017-02-09T18:29:13.410Z", "students": [], "groups": [], "tags": [99]}}, {"model": "topics.resource", "pk": 57, "fields": {"_my_subclass": "link", "name": "Unravel", "slug": "unravel", "brief_description": "<p>Co asseru</p>", "show_window": true, "all_students": true, "visible": true, "order": 14, "topic": 30, "create_date": "2017-02-12T04:18:39.836Z", "last_update": "2017-02-12T04:18:40.083Z", "students": [], "groups": [], "tags": [109]}}, {"model": "topics.resource", "pk": 58, "fields": {"_my_subclass": "webpage", "name": "Berry the castle", "slug": "berry-the-castle", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 15, "topic": 30, "create_date": "2017-02-23T15:22:21.044Z", "last_update": "2017-02-23T15:22:21.371Z", "students": [], "groups": [], "tags": [112]}}, {"model": "topics.resource", "pk": 59, "fields": {"_my_subclass": "webpage", "name": "What you get", "slug": "what-you-get", "brief_description": "<p>To me</p>", "show_window": false, "all_students": true, "visible": true, "order": 16, "topic": 30, "create_date": "2017-02-23T15:23:56.414Z", "last_update": "2017-02-23T15:23:56.482Z", "students": [], "groups": [], "tags": [109]}}, {"model": "topics.resource", "pk": 66, "fields": {"_my_subclass": "webpage", "name": "Last Stand", "slug": "last-stand", "brief_description": "<p>For the grace of the might of the Lord&nbsp;&nbsp;&nbsp;&nbsp;</p>", "show_window": false, "all_students": true, "visible": true, "order": 17, "topic": 30, "create_date": "2017-02-24T20:31:26.650Z", "last_update": "2017-02-24T20:31:26.778Z", "students": [], "groups": [], "tags": [116]}}, {"model": "topics.resource", "pk": 68, "fields": {"_my_subclass": "webpage", "name": "Angels calling", "slug": "angels-calling", "brief_description": "<p>Falling</p>", "show_window": false, "all_students": true, "visible": true, "order": 18, "topic": 30, "create_date": "2017-02-24T20:47:51.687Z", "last_update": "2017-02-25T01:35:19.427Z", "students": [], "groups": [], "tags": [118]}}, {"model": "topics.resource", "pk": 70, "fields": {"_my_subclass": "goals", "name": "Snuff", "slug": "snuff", "brief_description": "<p>Deserve to have you</p>", "show_window": false, "all_students": true, "visible": true, "order": 19, "topic": 30, "create_date": "2017-03-01T19:07:07.980Z", "last_update": "2017-03-03T01:16:22.746Z", "students": [], "groups": [], "tags": [121, 122]}}, {"model": "topics.resource", "pk": 73, "fields": {"_my_subclass": "filelink", "name": "Lies", "slug": "lies", "brief_description": "", "show_window": false, "all_students": false, "visible": true, "order": 20, "topic": 30, "create_date": "2017-04-26T03:03:38.089Z", "last_update": "2017-04-26T03:03:38.531Z", "students": [], "groups": [], "tags": [125]}}]
2 1 \ No newline at end of file
  2 +[{"id": 1, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 44, "name": "rvenge"}, {"id": 45, "name": "destruct"}], "pendencies_resource": [{"id": 1, "action": "create", "begin_date": "2017-01-21T23:35:00Z", "end_date": null, "limit_date": null}, {"id": 2, "action": "view", "begin_date": "2017-01-20T23:35:00Z", "end_date": "2017-01-31T23:35:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Revenge", "slug": "revenge", "brief_description": "<p>Here Comes</p>", "show_window": false, "all_students": false, "visible": true, "order": 1, "create_date": "2017-01-20T22:42:16.126657Z", "last_update": "2017-01-30T18:39:30.100600Z", "content": "<p>Listen Dammit</p><p>I do know how to make it better thoug</p>"}, {"id": 14, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 58, "name": "survive"}, {"id": 59, "name": "brave"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Care", "slug": "care", "brief_description": "<p>One last minute</p>", "show_window": true, "all_students": false, "visible": true, "order": 2, "create_date": "2017-01-23T17:59:10.053614Z", "last_update": "2017-01-24T21:53:17.119881Z", "content": "You don't really"}, {"id": 3, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 44, "name": "rvenge"}, {"id": 45, "name": "destruct"}], "pendencies_resource": [{"id": 5, "action": "create", "begin_date": "2017-01-24T23:35:00Z", "end_date": null, "limit_date": null}, {"id": 6, "action": "view", "begin_date": "2017-01-24T23:35:00Z", "end_date": "2017-01-31T23:35:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Teste 2", "slug": "teste-2", "brief_description": "<p>Here Comes</p>", "show_window": true, "all_students": false, "visible": true, "order": 3, "create_date": "2017-01-23T17:17:28.416904Z", "last_update": "2017-01-24T21:53:17.131082Z", "content": "Listen Dammit"}, {"id": 4, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 46, "name": "tears"}, {"id": 47, "name": "rain"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Have", "slug": "have", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 5, "create_date": "2017-01-23T17:31:58.957439Z", "last_update": "2017-01-24T21:53:17.155196Z", "content": "Haven't"}, {"id": 21, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 71, "name": "candle"}, {"id": 72, "name": "mass"}], "pendencies_resource": [{"id": 7, "action": "view", "begin_date": "2017-01-25T04:07:00Z", "end_date": "2017-02-02T04:07:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Each small candle", "slug": "each-small-candle", "brief_description": "<p>Uhuh</p>", "show_window": false, "all_students": false, "visible": true, "order": 6, "create_date": "2017-01-24T03:16:17.180365Z", "last_update": "2017-01-24T21:53:17.164135Z", "content": "<p>Lights a corner of the dark</p>"}, {"id": 5, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 46, "name": "tears"}, {"id": 47, "name": "rain"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Lose you", "slug": "lose-you", "brief_description": "<p>Save me</p>", "show_window": true, "all_students": false, "visible": true, "order": 7, "create_date": "2017-01-23T17:34:29.313661Z", "last_update": "2017-01-24T21:53:17.175261Z", "content": "Haven't <b>you heard <i>about the sirens <u>going down</u></i></b>"}, {"id": 16, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 62, "name": "sing"}, {"id": 63, "name": "loud"}], "pendencies_resource": [], "_my_subclass": "webpage", "name": "Sing", "slug": "sing", "brief_description": "<p>Talking about</p>", "show_window": false, "all_students": false, "visible": false, "order": 8, "create_date": "2017-01-23T22:10:39.437832Z", "last_update": "2017-01-24T21:53:17.197911Z", "content": "Sing sing"}, {"id": 49, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [{"id": 22, "action": "view", "begin_date": "2017-01-31T19:38:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Testes", "slug": "testes", "brief_description": "<p>asd</p>", "show_window": false, "all_students": false, "visible": true, "order": 9, "create_date": "2017-01-30T18:38:25.741186Z", "last_update": "2017-01-30T18:38:25.878442Z", "content": "<p>COmon</p>"}, {"id": 50, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [{"id": 23, "action": "view", "begin_date": "2017-02-03T19:38:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Yellow", "slug": "yellow", "brief_description": "<p>Vber</p>", "show_window": false, "all_students": false, "visible": true, "order": 10, "create_date": "2017-01-30T18:39:04.914450Z", "last_update": "2017-01-30T18:39:05.212499Z", "content": "<p>Flicker Berat</p>"}, {"id": 58, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 112, "name": "castle"}], "pendencies_resource": [{"id": 27, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Berry the castle", "slug": "berry-the-castle", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 15, "create_date": "2017-02-23T15:22:21.044556Z", "last_update": "2017-02-23T15:22:21.371782Z", "content": "<p>Crush crush crush<br></p>"}, {"id": 59, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 109, "name": "teste"}], "pendencies_resource": [{"id": 28, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "What you get", "slug": "what-you-get", "brief_description": "<p>To me</p>", "show_window": false, "all_students": true, "visible": true, "order": 16, "create_date": "2017-02-23T15:23:56.414396Z", "last_update": "2017-02-23T15:23:56.482582Z", "content": "<p>Let your heart with</p>"}, {"id": 66, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 116, "name": "Lord"}], "pendencies_resource": [{"id": 30, "action": "view", "begin_date": null, "end_date": null, "limit_date": null}], "_my_subclass": "webpage", "name": "Last Stand", "slug": "last-stand", "brief_description": "<p>For the grace of the might of the Lord&nbsp;&nbsp;&nbsp;&nbsp;</p>", "show_window": false, "all_students": true, "visible": true, "order": 17, "create_date": "2017-02-24T20:31:26.650857Z", "last_update": "2017-02-24T20:31:26.778340Z", "content": "<p>Twenty Seven</p>"}, {"id": 68, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 118, "name": "calling"}], "pendencies_resource": [{"id": 31, "action": "view", "begin_date": "2017-02-28T23:01:00Z", "end_date": "2017-03-01T23:02:00Z", "limit_date": null}], "_my_subclass": "webpage", "name": "Angels calling", "slug": "angels-calling", "brief_description": "<p>Falling</p>", "show_window": false, "all_students": true, "visible": true, "order": 18, "create_date": "2017-02-24T20:47:51.687147Z", "last_update": "2017-02-25T01:35:19.427849Z", "content": "<p>Your name</p>"}][{"id": 51, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 103, "name": "mirror"}, {"id": 104, "name": "to do"}], "pendencies_resource": [{"id": 24, "action": "view", "begin_date": "2017-02-01T21:59:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "ytvideo", "name": "System", "slug": "system", "brief_description": "<p>Gotta</p>", "show_window": true, "all_students": true, "visible": true, "order": 11, "create_date": "2017-02-01T21:03:21.123568Z", "last_update": "2017-02-02T23:08:32.570997Z", "url": "https://www.youtube.com/embed/qOrXWhmUbJ0"}][{"id": 40, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 91, "name": "end"}, {"id": 92, "name": "tonight"}], "pendencies_resource": [{"id": 21, "action": "view", "begin_date": "2017-01-31T19:33:00Z", "end_date": null, "limit_date": null}], "_my_subclass": "filelink", "name": "Alive", "slug": "alive", "brief_description": "<p>Nothern lights</p><p>I'm still</p>", "show_window": true, "all_students": true, "visible": true, "order": 4, "create_date": "2017-01-24T21:52:58.028122Z", "last_update": "2017-01-30T18:33:25.804307Z", "file_content": "/uploads/files/index.html"}, {"id": 73, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 125, "name": "Zafkiel"}], "pendencies_resource": [], "_my_subclass": "filelink", "name": "Lies", "slug": "lies", "brief_description": "", "show_window": false, "all_students": false, "visible": true, "order": 20, "create_date": "2017-04-26T03:03:38.089353Z", "last_update": "2017-04-26T03:03:38.531148Z", "file_content": "/uploads/files/kurumi.png"}][{"id": 53, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 106, "name": "otherside"}], "pendencies_resource": [], "_my_subclass": "link", "name": "Sorry", "slug": "sorry", "brief_description": "<p>Hellor</p>", "show_window": false, "all_students": true, "visible": true, "order": 12, "create_date": "2017-02-02T18:59:06.159653Z", "last_update": "2017-02-02T18:59:06.270167Z", "link_url": "https://www.youtube.com/embed/qOrXWhmUbJ0"}, {"id": 57, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 109, "name": "teste"}], "pendencies_resource": [], "_my_subclass": "link", "name": "Unravel", "slug": "unravel", "brief_description": "<p>Co asseru</p>", "show_window": true, "all_students": true, "visible": true, "order": 14, "create_date": "2017-02-12T04:18:39.836818Z", "last_update": "2017-02-12T04:18:40.083226Z", "link_url": "http://stackoverflow.com/questions/813418/django-set-field-value-after-a-form-is-initialized"}][{"id": 56, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 99, "name": ""}], "pendencies_resource": [], "_my_subclass": "pdffile", "name": "Legend", "slug": "legend", "brief_description": "", "show_window": false, "all_students": true, "visible": true, "order": 13, "create_date": "2017-02-09T18:29:12.935873Z", "last_update": "2017-02-09T18:29:13.410469Z", "file": "/uploads/files/egz_Ez4GoPW.pdf"}][{"id": 70, "topic": {"id": 30, "name": "Reposit\u00f3rio", "slug": "repositorio", "description": "<p>Testing</p>", "repository": true, "visible": false, "order": 1, "create_date": "2017-01-17T18:36:32.918370Z", "last_update": "2017-01-17T21:48:07.630468Z"}, "tags": [{"id": 121, "name": "megumin"}, {"id": 122, "name": "kurumin"}], "item_goal": [{"id": 3, "description": "Let me go", "ref_value": 57, "order": 1}, {"id": 4, "description": "Run away", "ref_value": 70, "order": 2}, {"id": 5, "description": "Explosiom", "ref_value": 89, "order": 3}], "pendencies_resource": [{"id": 33, "action": "view", "begin_date": "2017-03-01T19:06:00Z", "end_date": "2017-03-02T00:06:00Z", "limit_date": "2017-03-02T19:06:00Z"}], "_my_subclass": "goals", "name": "Snuff", "slug": "snuff", "brief_description": "<p>Deserve to have you</p>", "show_window": false, "all_students": true, "visible": true, "order": 19, "create_date": "2017-03-01T19:07:07.980858Z", "last_update": "2017-03-03T01:16:22.746523Z", "presentation": "<p>Resembles rage again...</p>", "limit_submission_date": "2017-03-02T21:05:00Z"}]
3 3 \ No newline at end of file
... ...
file_link/serializers.py 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +from rest_framework import serializers
  2 +
  3 +from subjects.serializers import TagSerializer
  4 +from topics.serializers import TopicSerializer
  5 +from pendencies.serializers import PendenciesSerializer
  6 +from students_group.serializers import StudentsGroupSerializer
  7 +
  8 +from .models import FileLink
  9 +
  10 +class SimpleFileLinkSerializer(serializers.ModelSerializer):
  11 + topic = TopicSerializer()
  12 + tags = TagSerializer(many = True)
  13 + pendencies_resource = PendenciesSerializer(many = True)
  14 +
  15 + class Meta:
  16 + model = FileLink
  17 + exclude = ('students', 'groups',)
  18 +
  19 +class CompleteFileLinkSerializer(serializers.ModelSerializer):
  20 + topic = TopicSerializer()
  21 + tags = TagSerializer(many = True)
  22 + pendencies_resource = PendenciesSerializer(many = True)
  23 + groups = StudentsGroupSerializer(many = True)
  24 +
  25 + class Meta:
  26 + model = FileLink
  27 + fields = '__all__'
... ...
goals/serializers.py 0 → 100644
... ... @@ -0,0 +1,33 @@
  1 +from rest_framework import serializers
  2 +
  3 +from subjects.serializers import TagSerializer
  4 +from topics.serializers import TopicSerializer
  5 +from pendencies.serializers import PendenciesSerializer
  6 +from students_group.serializers import StudentsGroupSerializer
  7 +
  8 +from .models import Goals, GoalItem
  9 +
  10 +class GoalItemSerializer(serializers.ModelSerializer):
  11 + class Meta:
  12 + model = GoalItem
  13 + exclude = ('goal',)
  14 +
  15 +class SimpleGoalSerializer(serializers.ModelSerializer):
  16 + topic = TopicSerializer()
  17 + tags = TagSerializer(many = True)
  18 + item_goal = GoalItemSerializer(many = True)
  19 + pendencies_resource = PendenciesSerializer(many = True)
  20 +
  21 + class Meta:
  22 + model = Goals
  23 + exclude = ('students', 'groups',)
  24 +
  25 +class CompleteGoalSerializer(serializers.ModelSerializer):
  26 + topic = TopicSerializer()
  27 + tags = TagSerializer(many = True)
  28 + pendencies_resource = PendenciesSerializer(many = True)
  29 + groups = StudentsGroupSerializer(many = True)
  30 +
  31 + class Meta:
  32 + model = Goals
  33 + fields = '__all__'
0 34 \ No newline at end of file
... ...
links/serializers.py 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +from rest_framework import serializers
  2 +
  3 +from subjects.serializers import TagSerializer
  4 +from topics.serializers import TopicSerializer
  5 +from pendencies.serializers import PendenciesSerializer
  6 +from students_group.serializers import StudentsGroupSerializer
  7 +
  8 +from .models import Link
  9 +
  10 +class SimpleLinkSerializer(serializers.ModelSerializer):
  11 + topic = TopicSerializer()
  12 + tags = TagSerializer(many = True)
  13 + pendencies_resource = PendenciesSerializer(many = True)
  14 +
  15 + class Meta:
  16 + model = Link
  17 + exclude = ('students', 'groups',)
  18 +
  19 +class CompleteLinkSerializer(serializers.ModelSerializer):
  20 + topic = TopicSerializer()
  21 + tags = TagSerializer(many = True)
  22 + pendencies_resource = PendenciesSerializer(many = True)
  23 + groups = StudentsGroupSerializer(many = True)
  24 +
  25 + class Meta:
  26 + model = Link
  27 + fields = '__all__'
0 28 \ No newline at end of file
... ...
pdf_file/serializers.py 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +from rest_framework import serializers
  2 +
  3 +from subjects.serializers import TagSerializer
  4 +from topics.serializers import TopicSerializer
  5 +from pendencies.serializers import PendenciesSerializer
  6 +from students_group.serializers import StudentsGroupSerializer
  7 +
  8 +from .models import PDFFile
  9 +
  10 +class SimplePDFFileSerializer(serializers.ModelSerializer):
  11 + topic = TopicSerializer()
  12 + tags = TagSerializer(many = True)
  13 + pendencies_resource = PendenciesSerializer(many = True)
  14 +
  15 + class Meta:
  16 + model = PDFFile
  17 + exclude = ('students', 'groups',)
  18 +
  19 +class CompletePDFFileSerializer(serializers.ModelSerializer):
  20 + topic = TopicSerializer()
  21 + tags = TagSerializer(many = True)
  22 + pendencies_resource = PendenciesSerializer(many = True)
  23 + groups = StudentsGroupSerializer(many = True)
  24 +
  25 + class Meta:
  26 + model = PDFFile
  27 + fields = '__all__'
0 28 \ No newline at end of file
... ...
pendencies/serializers.py 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +from rest_framework import serializers
  2 +
  3 +from .models import Pendencies
  4 +
  5 +class PendenciesSerializer(serializers.ModelSerializer):
  6 + class Meta:
  7 + model = Pendencies
  8 + exclude = ('resource',)
... ...
reports/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 8 msgstr ""
9 9 "Project-Id-Version: PACKAGE VERSION\n"
10 10 "Report-Msgid-Bugs-To: \n"
11   -"POT-Creation-Date: 2017-04-15 00:13-0300\n"
  11 +"POT-Creation-Date: 2017-04-29 21:14-0300\n"
12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 14 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -18,287 +18,308 @@ msgstr &quot;&quot;
18 18 "Content-Transfer-Encoding: 8bit\n"
19 19 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
20 20  
21   -#: reports/forms.py:23
  21 +#: .\forms.py:23
22 22 msgid "Kind Of Resource"
23 23 msgstr "Tipo de recurso"
24 24  
25   -#: reports/forms.py:24
  25 +#: .\forms.py:24
26 26 msgid "Tag"
27 27 msgstr "Tag"
28 28  
29   -#: reports/forms.py:35
  29 +#: .\forms.py:35
30 30 msgid "Topics"
31 31 msgstr "Tópicos"
32 32  
33   -#: reports/forms.py:36 reports/templates/reports/view.html:58
  33 +#: .\forms.py:36 .\templates\reports\view.html:58
34 34 msgid "Initial Date"
35 35 msgstr "Data inicial"
36 36  
37   -#: reports/forms.py:37
  37 +#: .\forms.py:37
38 38 msgid "Final Date"
39 39 msgstr "Data Final"
40 40  
41   -#: reports/forms.py:39
  41 +#: .\forms.py:39
42 42 msgid "From Mural"
43 43 msgstr "Mural da disciplina"
44 44  
45   -#: reports/forms.py:40
  45 +#: .\forms.py:40
46 46 msgid "Messages"
47 47 msgstr "Mensagens"
48 48  
49   -#: reports/forms.py:51 reports/views.py:127 reports/views.py:198
  49 +#: .\forms.py:51 .\views.py:145 .\views.py:218
50 50 msgid "All"
51 51 msgstr "Todos"
52 52  
53   -#: reports/forms.py:60
  53 +#: .\forms.py:60
54 54 msgid "The initial date can't be after the end one."
55 55 msgstr "A data inicial não pode ser depois da final"
56 56  
57   -#: reports/forms.py:65
  57 +#: .\forms.py:65
58 58 msgid "This date should be right or after "
59 59 msgstr "Esta data deve ser igual ou após"
60 60  
61   -#: reports/forms.py:71
  61 +#: .\forms.py:71
62 62 msgid "This date should be right or before "
63 63 msgstr "Esta data deve ser igual ou anterior à"
64 64  
65   -#: reports/templates/reports/_form.html:19
  65 +#: .\templates\reports\_form.html:19
66 66 msgid "General Parameters"
67 67 msgstr "Escolha o Tópico e o Período"
68 68  
69   -#: reports/templates/reports/_form.html:37
  69 +#: .\templates\reports\_form.html:37
70 70 msgid "Choose the Data Source (is possible to pick more than one)"
71 71 msgstr "Escolha a fonte de dados (é possível escolher mais de uma)"
72 72  
73   -#: reports/templates/reports/_form.html:62
  73 +#: .\templates\reports\_form.html:62
74 74 msgid "Interaction with resources"
75 75 msgstr "Interação com recursos"
76 76  
77   -#: reports/templates/reports/_form.html:97
  77 +#: .\templates\reports\_form.html:97
78 78 msgid "Search Report"
79 79 msgstr "Buscar"
80 80  
81   -#: reports/templates/reports/create.html:27
82   -#: reports/templates/reports/view.html:33
  81 +#: .\templates\reports\create.html:27 .\templates\reports\view.html:33
83 82 msgid "Analytics"
84 83 msgstr ""
85 84  
86   -#: reports/templates/reports/create.html:37
87   -#: reports/templates/reports/view.html:43
  85 +#: .\templates\reports\create.html:36 .\templates\reports\view.html:43
88 86 msgid "Interaction Data"
89 87 msgstr "Dados de Interação"
90 88  
91   -#: reports/templates/reports/create.html:40
92   -#: reports/templates/reports/view.html:46
  89 +#: .\templates\reports\create.html:39 .\templates\reports\view.html:46
93 90 msgid "Report Card"
94 91 msgstr "Boletim do Tópico"
95 92  
96   -#: reports/templates/reports/create.html:43
97   -#: reports/templates/reports/view.html:49
  93 +#: .\templates\reports\create.html:42 .\templates\reports\view.html:49
98 94 msgid "Participation"
99 95 msgstr "Participações"
100 96  
101   -#: reports/templates/reports/create.html:55
  97 +#: .\templates\reports\create.html:55
102 98 msgid "add data source"
103 99 msgstr "Adicionar nova fonte de dados"
104 100  
105   -#: reports/templates/reports/create.html:56
  101 +#: .\templates\reports\create.html:56
106 102 msgid "remove data source"
107 103 msgstr "Remover esta fonte"
108 104  
109   -#: reports/templates/reports/view.html:56
  105 +#: .\templates\reports\view.html:56
110 106 msgid "Subject"
111 107 msgstr "Assunto"
112 108  
113   -#: reports/templates/reports/view.html:57
  109 +#: .\templates\reports\view.html:57
114 110 msgid "Topic"
115 111 msgstr "Tópico"
116 112  
117   -#: reports/templates/reports/view.html:59
  113 +#: .\templates\reports\view.html:59
118 114 msgid "End Date"
119 115 msgstr "Data final"
120 116  
121   -#: reports/templates/reports/view.html:60
  117 +#: .\templates\reports\view.html:60
122 118 msgid "new search"
123 119 msgstr "Nova Busca"
124 120  
125   -#: reports/templates/reports/view.html:66
  121 +#: .\templates\reports\view.html:66
126 122 msgid "register(s)"
127 123 msgstr "registro(s)"
128 124  
129   -#: reports/templates/reports/view.html:68
  125 +#: .\templates\reports\view.html:68
130 126 msgid "Interactions Data (.csv)"
131 127 msgstr "Dados de interação (.csv)"
132 128  
133   -#: reports/templates/reports/view.html:72
  129 +#: .\templates\reports\view.html:72
134 130 msgid "Interactions Data (.xls)"
135 131 msgstr "Dados de interação (.xls)"
136 132  
137   -#: reports/views.py:60
  133 +#: .\views.py:78
138 134 msgid "Report created successfully"
139 135 msgstr "Relatório criado com sucesso!"
140 136  
141   -#: reports/views.py:202
  137 +#: .\views.py:222
142 138 msgid "User"
143 139 msgstr ""
144 140  
145   -#: reports/views.py:222
  141 +#: .\views.py:245
146 142 msgid "Number of help posts created by the user."
147 143 msgstr "Número de postagens de dúvidas criadas no mural da disciplina."
148 144  
149   -#: reports/views.py:228
  145 +#: .\views.py:251
150 146 msgid "Amount of comments on help posts created by the student."
151 147 msgstr ""
152 148 "Número de comentários criados para as próprias postagens de dúvidas no mural "
153 149 "da disciplina."
154 150  
155   -#: reports/views.py:233
  151 +#: .\views.py:256
156 152 msgid "Amount of comments made by the student on teachers help posts."
157 153 msgstr ""
158 154 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
159 155 "pelo professor."
160 156  
161   -#: reports/views.py:237
  157 +#: .\views.py:260
162 158 msgid "Amount of comments made by the student on other students help posts."
163 159 msgstr ""
164 160 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
165 161 "por outros estudantes."
166 162  
167   -#: reports/views.py:248
  163 +#: .\views.py:271
168 164 msgid "Number of help posts created by the user that the teacher commented on."
169 165 msgstr ""
170 166 "Número de comentários às postagens de dúvidas no mural da disciplina criadas "
171 167 "por outros estudantes"
172 168  
173   -#: reports/views.py:256
  169 +#: .\views.py:279
174 170 msgid "Number of help posts created by the user others students commented on."
175 171 msgstr ""
176 172 " Número de postagens de dúvidas criadas no mural da disciplina que foram "
177 173 "comentadas por outros estudantes."
178 174  
179   -#: reports/views.py:259
  175 +#: .\views.py:282
180 176 msgid "Number of student visualizations on the mural of the subject."
181 177 msgstr "Número de visualizações do mural da disciplina."
182 178  
183   -#: reports/views.py:271
  179 +#: .\views.py:303
184 180 msgid "Number of access to mural between 6 a.m to 12a.m. ."
185 181 msgstr ""
186 182 "Número de acessos ao ambiente virtual da disciplina no horário de 06h às 12h."
187 183  
188   -#: reports/views.py:275
  184 +#: .\views.py:307
189 185 msgid "Number of access to mural between 0 p.m to 6p.m. ."
190 186 msgstr ""
191 187 "Número de acessos ao ambiente virtual da disciplina no horário de 12h às 18h."
192 188  
193   -#: reports/views.py:278
  189 +#: .\views.py:310
194 190 msgid "Number of access to mural between 6 p.m to 12p.m. ."
195 191 msgstr ""
196 192 "Número de acessos ao ambiente virtual da disciplina no horário de 18h às 24h."
197 193  
198   -#: reports/views.py:282
  194 +#: .\views.py:314
199 195 msgid "Number of access to mural between 0 a.m to 6a.m. ."
200 196 msgstr ""
201 197 "Número de acessos ao ambiente virtual da disciplina no horário de 24h às 06h."
202 198  
203   -#: reports/views.py:287
  199 +#: .\views.py:319
204 200 msgid "sunday"
205 201 msgstr "domingo"
206 202  
207   -#: reports/views.py:287
  203 +#: .\views.py:319
208 204 msgid "monday"
209 205 msgstr "segunda"
210 206  
211   -#: reports/views.py:287
  207 +#: .\views.py:319
212 208 msgid "tuesday"
213 209 msgstr "terça-feira"
214 210  
215   -#: reports/views.py:287
  211 +#: .\views.py:319
216 212 msgid "wednesday"
217 213 msgstr "quarta"
218 214  
219   -#: reports/views.py:287
  215 +#: .\views.py:319
220 216 msgid "thursday"
221 217 msgstr "quinta-feira"
222 218  
223   -#: reports/views.py:288
  219 +#: .\views.py:320
224 220 msgid "friday"
225 221 msgstr "sexta"
226 222  
227   -#: reports/views.py:288
  223 +#: .\views.py:320
228 224 msgid "saturday"
229 225 msgstr "sábado"
230 226  
231   -#: reports/views.py:292 reports/views.py:295
  227 +#: .\views.py:324 .\views.py:327
232 228 msgid "Number of access to the subject on "
233 229 msgstr "Número de acessos ao assunto na(o) "
234 230  
235   -#: reports/views.py:298
  231 +#: .\views.py:330
236 232 msgid "Number of distinct days the user access the subject. "
237 233 msgstr "Número de dias distintos que acessou o ambiente virtual da disciplina."
238 234  
239   -#: reports/views.py:299
  235 +#: .\views.py:331
240 236 msgid "Class"
241 237 msgstr "Classe"
242 238  
243   -#: reports/views.py:299 reports/views.py:300
  239 +#: .\views.py:331 .\views.py:332
244 240 msgid "Undefined"
245 241 msgstr "Indefinido"
246 242  
247   -#: reports/views.py:300
  243 +#: .\views.py:332
248 244 msgid "Performance"
249 245 msgstr "Desempenho"
250 246  
251   -#: reports/views.py:448 reports/views.py:498
  247 +#: .\views.py:482 .\views.py:583
252 248 msgid "PDF File"
253 249 msgstr ""
254 250  
255   -#: reports/views.py:449 reports/views.py:499
  251 +#: .\views.py:483 .\views.py:584
256 252 #, fuzzy
257 253 #| msgid "Topics"
258 254 msgid "Topic Goals"
259 255 msgstr "Tópicos"
260 256  
261   -#: reports/views.py:450 reports/views.py:500
  257 +#: .\views.py:484 .\views.py:585
262 258 msgid "Link to Website"
263 259 msgstr ""
264 260  
265   -#: reports/views.py:451 reports/views.py:501
  261 +#: .\views.py:485 .\views.py:586
266 262 msgid "File Link"
267 263 msgstr ""
268 264  
269   -#: reports/views.py:452 reports/views.py:502
  265 +#: .\views.py:486 .\views.py:587
270 266 msgid "Web Conference"
271 267 msgstr ""
272 268  
273   -#: reports/views.py:453 reports/views.py:503
  269 +#: .\views.py:487 .\views.py:588
274 270 msgid "YouTube Video"
275 271 msgstr ""
276 272  
277   -#: reports/views.py:454 reports/views.py:504
  273 +#: .\views.py:488 .\views.py:589
278 274 msgid "WebPage"
279 275 msgstr ""
280 276  
281   -#: reports/views.py:456 reports/views.py:463
  277 +#: .\views.py:490 .\views.py:497
282 278 msgid "number of visualizations of "
283 279 msgstr "Número de visualizações do(e) "
284 280  
285   -#: reports/views.py:456 reports/views.py:457 reports/views.py:458
286   -#: reports/views.py:461
  281 +#: .\views.py:490 .\views.py:491 .\views.py:492 .\views.py:495
287 282 msgid " with tag "
288 283 msgstr " com a tag "
289 284  
290   -#: reports/views.py:457 reports/views.py:464
  285 +#: .\views.py:491 .\views.py:498
291 286 msgid "number of visualizations of distintic "
292 287 msgstr "Número de visualizações dos distintos "
293 288  
294   -#: reports/views.py:458 reports/views.py:465
  289 +#: .\views.py:492 .\views.py:499
295 290 msgid "distintic days "
296 291 msgstr "número de dias distintos "
297 292  
298   -#: reports/views.py:461 reports/views.py:468
  293 +#: .\views.py:495 .\views.py:502
299 294 msgid "hours viewed of "
300 295 msgstr "quantidade de horas vistas "
301 296  
  297 +#: .\views.py:522 .\views.py:523 .\views.py:525
  298 +msgid " amount of messages sent to other students"
  299 +msgstr " Quantidade mensagens enviadas para outros estudantes"
  300 +
  301 +#: .\views.py:527 .\views.py:528 .\views.py:531
  302 +msgid "amount of messages received from other students"
  303 +msgstr "Quantidade de mensagens recebidas de outros estudantes"
  304 +
  305 +#: .\views.py:537
  306 +msgid "amount of distinct students to whom sent messages"
  307 +msgstr "Quantidade de estudantes distintos para quem enviou mensagem"
  308 +
  309 +#: .\views.py:546 .\views.py:547 .\views.py:549
  310 +msgid "amount messages sent to professors"
  311 +msgstr "Quantidade mensagens enviadas para o(s) professor(es)"
  312 +
  313 +#: .\views.py:551 .\views.py:552 .\views.py:554
  314 +msgid "amount of messages received from professors"
  315 +msgstr "Quantidade de mensagens recebidas do(s) professor(es)"
  316 +
  317 +#~ msgid " amount messages sent to other students"
  318 +#~ msgstr " número de mensagens enviadas para outros estudantes"
  319 +
  320 +#~ msgid " amount of messages sent to others students"
  321 +#~ msgstr " número de mensagens enviadas para outros estudantes"
  322 +
302 323 #~ msgid "distintic "
303 324 #~ msgstr "distintos "
304 325  
... ...
reports/tests.py
1   -from django.test import TestCase
2   -
3   -# Create your tests here.
  1 +from django.test import TestCase
4 2 \ No newline at end of file
... ...
reports/tests/test_report_auth.py
... ... @@ -3,8 +3,12 @@ from django.core.urlresolvers import resolve
3 3 from reports.views import ReportView
4 4 from subjects.models import Subject
5 5 from users.models import User
6   -
  6 +from topics.models import Topic
  7 +from chat.models import Conversation, TalkMessages
7 8 from datetime import datetime
  9 +from log.models import Log
  10 +from django.db.models import Q
  11 +
8 12  
9 13 class ReportTest(TestCase):
10 14  
... ... @@ -42,4 +46,29 @@ class ReportTest(TestCase):
42 46 report_view = self.c.get('/subjects/report/create/interactions/?subject_id='+ str(self.subject.id))
43 47  
44 48 self.assertEqual(report_view.url, "/subjects/home/")
45   -
46 49 \ No newline at end of file
  50 +
  51 +
  52 + @override_settings(STATICFILES_STORAGE = None)
  53 + def test_message_data_from_view(self):
  54 + """
  55 + test if I'm capturing the message data correctly in all scenarios
  56 + """
  57 +
  58 + #scenario 01: the number of messages a student receives from other students
  59 + topic = Topic.objects.create(name="novo topico", subject= self.subject, visible = True)
  60 + topic.save()
  61 + student02 = User.objects.create(username="student02", email= "student02@gmail.com", password="amadeus")
  62 + student02.save()
  63 + conversation_01 = Conversation.objects.create(user_one = self.student, user_two = student02)
  64 +
  65 + #building messages
  66 + message01 = TalkMessages(text="hi", talk = conversation_01, subject = self.subject, user = self.student)
  67 + message01.save()
  68 + message02 = TalkMessages(text="hello, how are you?", talk = conversation_01, subject = self.subject, user = student02)
  69 + message02.save()
  70 + #get all conversations where a student of the subject is in and the amount of messages the hey sent to other students
  71 + conversations = Conversation.objects.filter(Q(user_one = self.student) | Q(user_two = self.student) )
  72 +
  73 + amount_of_messages = TalkMessages.objects.filter(talk__in= conversations).count()
  74 + print(amount_of_messages)
  75 + self.assertEqual(3,3)
47 76 \ No newline at end of file
... ...
reports/views.py
... ... @@ -26,6 +26,9 @@ import os
26 26 import copy
27 27 from django.shortcuts import render, get_object_or_404, redirect
28 28  
  29 +from chat.models import Conversation, TalkMessages
  30 +
  31 +
29 32 from amadeus.permissions import has_category_permissions, has_subject_permissions
30 33  
31 34 class ReportView(LoginRequiredMixin, generic.FormView):
... ... @@ -146,15 +149,17 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
146 149 context['init_date'] = params_data['init_date']
147 150 context['end_date'] = params_data['end_date']
148 151 context['subject'] = subject
  152 +
149 153  
150 154 #I used getlist method so it can get more than one tag and one resource class_name
151 155 resources = params_data.getlist('resource')
152 156 tags = params_data.getlist('tag')
153 157  
154 158 self.from_mural = params_data['from_mural']
155   -
  159 + self.from_messages = params_data['from_messages']
  160 +
156 161 context['data'], context['header'] = self.get_mural_data(subject, params_data['topic'], params_data['init_date'], params_data['end_date'],
157   - resources, tags )
  162 + resources, tags )
158 163  
159 164  
160 165 #this is to save the csv for further download
... ... @@ -226,8 +231,11 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
226 231  
227 232 data[student.id].append(student.social_name)
228 233  
229   - interactions = OrderedDict()
230   -
  234 + interactions = OrderedDict()
  235 +
  236 +
  237 +
  238 +
231 239 #interactions['username'] = student.social_name
232 240 if self.from_mural == "True":
233 241 help_posts_made_by_user = SubjectPost.objects.filter(action="help",space__id=subject.id, user=student,
... ... @@ -275,6 +283,15 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
275 283 user = student).count()
276 284  
277 285  
  286 + #variables from messages
  287 +
  288 +
  289 + if self.from_messages == "True":
  290 +
  291 + message_data = self.get_messages_data(subject, student)
  292 + for key, value in message_data.items():
  293 + interactions[key] = value
  294 +
278 295 #VAR08 through VAR_019 of documenttation:
279 296 if len(resources_type_names) > 0:
280 297 resources_data = self.get_resources_and_tags_data(resources_type_names, tags_id, student, subject, topics, init_date, end_date)
... ... @@ -376,7 +393,7 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
376 393 for resource in resources:
377 394  
378 395 if isinstance(topics,Topic):
379   - #or it selected only one topic to work with
  396 + #if it selected only one topic to work with
380 397 count = Log.objects.filter(action="view", resource=resources_types[i].lower(),
381 398 user_id = student.id, context__contains = {'subject_id': subject.id,
382 399 resources_types[i].lower()+'_id': resource.id, 'topic_id': topics.id}, datetime__range=(init_date, end_date)).count()
... ... @@ -452,6 +469,8 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
452 469 time_delta = math.fabs(end_time - begin_time)
453 470  
454 471 hours_viewed += time_delta/3600 #so it's turned this seconds into hours
  472 +
  473 +
455 474 if count > 0:
456 475 distinct_resources += 1
457 476 total_count += count
... ... @@ -484,15 +503,66 @@ class ViewReportView(LoginRequiredMixin, generic.TemplateView):
484 503  
485 504 return data
486 505  
  506 + def get_messages_data(self, subject, student):
  507 + data = OrderedDict()
  508 +
  509 +
  510 +
  511 + messages_sent_to_other_students = 0
  512 +
  513 + distinct_students = 0
  514 +
  515 + for other_student in subject.students.exclude(id = student.id):
  516 + conversations_with_other = Conversation.objects.filter(Q(user_one=student) & Q(user_two = other_student) | Q(user_one = other_student) & Q(user_two = student) )
  517 + messages_sent_other = TalkMessages.objects.filter(talk__in = conversations_with_other, user = student , subject= subject)
  518 + messages_received_other = TalkMessages.objects.filter(talk__in = conversations_with_other, user = other_student, subject = subject)
  519 +
  520 +
  521 +
  522 + if data.get(_(" amount of messages sent to other students")):
  523 + data[_(" amount of messages sent to other students")] = messages_sent_other.count() + data.get(_(" amount of messages sent to other students"))
  524 + else:
  525 + data[_(" amount of messages sent to other students")] = messages_sent_other.count()
  526 +
  527 + if data.get(_("amount of messages received from other students")):
  528 + data[_("amount of messages received from other students")] = messages_received_other.count() + data.get(_("amount of messages received from other students"))
  529 + else:
  530 +
  531 + data[_("amount of messages received from other students")] = messages_received_other.count()
  532 +
  533 + #check whether the other started a conversation or not
  534 + if messages_sent_other.count() >0:
  535 + distinct_students += 1
  536 +
  537 + data[_("amount of distinct students to whom sent messages")] = distinct_students
  538 + #calculate the amount of messages sent to and received from professor
  539 + messages_sent_professors = 0
  540 + messages_received_professors = 0
  541 + for professor in subject.professor.all():
  542 + conversations_with_professor = Conversation.objects.filter(Q(user_one = student) & Q(user_two = professor) | Q(user_one = professor) & Q(user_two = student))
  543 + messages_sent_to_professors = TalkMessages.objects.filter(talk__in = conversations_with_professor, user = student, subject = subject)
  544 +
  545 + messages_received_from_professors = TalkMessages.objects.filter(talk__in = conversations_with_professor, user = professor, subject = subject)
  546 + if data.get(_("amount messages sent to professors")):
  547 + data[_("amount messages sent to professors")] = messages_sent_to_professors.count() + data.get(_("amount messages sent to professors"))
  548 + else:
  549 + data[_("amount messages sent to professors")] = messages_sent_to_professors.count()
  550 +
  551 + if data.get(_("amount of messages received from professors")):
  552 + data[_("amount of messages received from professors")] = messages_received_from_professors.count() + data.get(_("amount of messages received from professors"))
  553 + else:
  554 + data[_("amount of messages received from professors")] = messages_received_from_professors.count()
  555 +
  556 +
  557 + return data
  558 +
487 559  
488 560 """
489 561 Get all possible resource subclasses available for that topic selected
490 562 """
491 563 def get_resources(request):
492 564  
493   - #get all possible resources
494   - classes = Resource.__subclasses__()
495   - data = {}
  565 + #get all possible resources
496 566 subject = Subject.objects.get(id=request.GET['subject_id'])
497 567  
498 568 topic_choice = request.GET["topic_choice"]
... ...
students_group/serializers.py 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +from rest_framework import serializers
  2 +
  3 +from .models import StudentsGroup
  4 +
  5 +class StudentsGroupSerializer(serializers.ModelSerializer):
  6 + class Meta:
  7 + model = StudentsGroup
  8 + fields = '__all__'
... ...
subjects/serializers.py 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +from rest_framework import serializers
  2 +
  3 +from .models import Tag
  4 +
  5 +class TagSerializer(serializers.ModelSerializer):
  6 + class Meta:
  7 + model = Tag
  8 + fields = '__all__'
0 9 \ No newline at end of file
... ...
subjects/templates/subjects/backup.html
... ... @@ -67,7 +67,7 @@
67 67 <h5>{% trans "Please select below the topics and resources which you want to backup:" %}</h5>
68 68  
69 69 <div class="backup_container">
70   - <form id="bkp_form" method="post" action="{% url 'subjects:do_backup' %}" enctype="multipart/form-data">
  70 + <form id="bkp_form" method="post" action="{% url 'subjects:do_backup' subject.slug %}" enctype="multipart/form-data">
71 71 {% csrf_token %}
72 72  
73 73 {% for topic in topics %}
... ... @@ -90,6 +90,15 @@
90 90 </div>
91 91 {% endfor %}
92 92  
  93 + {% if request.user.is_staff %}
  94 + <br clear="all" />
  95 + <div class="checkbox backup_item" style="margin-left: 0">
  96 + <label>
  97 + <input type="checkbox" name="participants" /> {% trans 'Include participants data.' %}
  98 + </label>
  99 + </div>
  100 + {% endif %}
  101 +
93 102 <div class="row text-center">
94 103 <input type="submit" value="{% trans 'Backup' %}" class="btn btn-success btn-raised" />
95 104 </div>
... ...
subjects/urls.py
... ... @@ -10,7 +10,7 @@ urlpatterns = [
10 10 url(r'^update/(?P<slug>[\w_-]+)/$', views.SubjectUpdateView.as_view(), name='update'),
11 11 url(r'^delete/(?P<slug>[\w_-]+)/$', views.SubjectDeleteView.as_view(), name='delete'),
12 12 url(r'^backup/(?P<slug>[\w_-]+)/$', views.Backup.as_view(), name='backup'),
13   - url(r'^do_backup/$', views.realize_backup, name='do_backup'),
  13 + url(r'^do_backup/(?P<subject>[\w_-]+)/$', views.realize_backup, name='do_backup'),
14 14 url(r'^view/(?P<slug>[\w_-]+)/$', views.SubjectDetailView.as_view(), name='view'),
15 15 url(r'^view/(?P<slug>[\w_-]+)/(?P<topic_slug>[\w_-]+)/$', views.SubjectDetailView.as_view(), name='topic_view'),
16 16 url(r'^subscribe/(?P<slug>[\w_-]+)/$', views.SubjectSubscribeView.as_view(), name='subscribe'),
... ...
subjects/views.py
... ... @@ -35,10 +35,25 @@ from news.models import News
35 35  
36 36 import os
37 37 import zipfile
  38 +import json
38 39 from io import BytesIO
39 40 from itertools import chain
40 41 from django.core import serializers
41   -from django.contrib.admin.utils import NestedObjects
  42 +from rest_framework.renderers import JSONRenderer
  43 +
  44 +from users.serializers import UserSerializer
  45 +from file_link.serializers import SimpleFileLinkSerializer, CompleteFileLinkSerializer
  46 +from file_link.models import FileLink
  47 +from goals.serializers import SimpleGoalSerializer, CompleteGoalSerializer
  48 +from goals.models import Goals
  49 +from links.serializers import SimpleLinkSerializer, CompleteLinkSerializer
  50 +from links.models import Link
  51 +from pdf_file.serializers import SimplePDFFileSerializer, CompletePDFFileSerializer
  52 +from pdf_file.models import PDFFile
  53 +from youtube_video.serializers import SimpleYTVideoSerializer, CompleteYTVideoSerializer
  54 +from youtube_video.models import YTVideo
  55 +from webpage.serializers import SimpleWebpageSerializer, CompleteWebpageSerializer
  56 +from webpage.models import Webpage
42 57  
43 58 from amadeus.permissions import has_category_permissions, has_subject_permissions, has_subject_view_permissions, has_resource_permissions
44 59  
... ... @@ -757,10 +772,9 @@ class Backup(LoginRequiredMixin, ListView):
757 772 return context
758 773  
759 774 @login_required
760   -def realize_backup(request):
761   - #collector = NestedObjects(using="default") # database name
762   - #collector.collect(list(Resource.objects.filter(visible = True)))
  775 +def realize_backup(request, subject):
763 776 resources_ids = request.POST.getlist("resource[]")
  777 + participants = request.POST.get('participants', False)
764 778  
765 779 resource_files_subdir = "files"
766 780 zip_filename = "backup.zip"
... ... @@ -769,29 +783,66 @@ def realize_backup(request):
769 783  
770 784 zf = zipfile.ZipFile(s, "w", compression = zipfile.ZIP_DEFLATED)
771 785  
772   - resources = Resource.objects.filter(id__in = resources_ids)
  786 + webpages = Webpage.objects.filter(id__in = resources_ids)
  787 + ytvideos = YTVideo.objects.filter(id__in = resources_ids)
  788 + filelinks = FileLink.objects.filter(id__in = resources_ids)
  789 + links = Link.objects.filter(id__in = resources_ids)
  790 + pdffiles = PDFFile.objects.filter(id__in = resources_ids)
  791 + goals = Goals.objects.filter(id__in = resources_ids)
773 792  
774   - for resource in resources:
775   - if resource._my_subclass == "filelink":
776   - fdir, fname = os.path.split(resource.filelink.file_content.path)
  793 +
  794 + for filelink in filelinks:
  795 + if os.path.exists(filelink.file_content.path):
  796 + fdir, fname = os.path.split(filelink.file_content.path)
777 797 zip_path = os.path.join(resource_files_subdir, fname)
778 798  
779 799 # Add file, at correct path
780   - zf.write(resource.filelink.file_content.path, zip_path)
781   - elif resource._my_subclass == "pdffile":
782   - fdir, fname = os.path.split(resource.pdffile.file.path)
  800 + zf.write(filelink.file_content.path, zip_path)
  801 +
  802 + for pdffile in pdffiles:
  803 + if os.path.exists(pdffile.file.path):
  804 + fdir, fname = os.path.split(pdffile.file.path)
783 805 zip_path = os.path.join(resource_files_subdir, fname)
784 806  
785 807 # Add file, at correct path
786   - zf.write(resource.pdffile.file.path, zip_path)
787   -
788   - topics = Topic.objects.filter(resource_topic__id__in = resources_ids).distinct()
  808 + zf.write(pdffile.file.path, zip_path)
789 809  
790 810 file = open("backup.json", "w")
791 811  
792   - json_serializer = serializers.get_serializer('json')()
793   - json_serializer.serialize(topics, stream = file)
794   - json_serializer.serialize(resources, stream = file)
  812 + if participants:
  813 + participants = User.objects.filter(subject_student__slug = subject)
  814 +
  815 + for user in participants:
  816 + if os.path.exists(user.image.path):
  817 + fdir, fname = os.path.split(user.image.path)
  818 + zip_path = os.path.join('users', fname)
  819 +
  820 + zf.write(user.image.path, zip_path)
  821 +
  822 + serializer_u = UserSerializer(participants, many = True)
  823 +
  824 + json.dump(serializer_u.data, file)
  825 +
  826 + serializer_w = CompleteWebpageSerializer(webpages, many = True)
  827 + serializer_y = CompleteYTVideoSerializer(ytvideos, many = True)
  828 + serializer_f = CompleteFileLinkSerializer(filelinks, many = True)
  829 + serializer_l = CompleteLinkSerializer(links, many = True)
  830 + serializer_p = CompletePDFFileSerializer(pdffiles, many = True)
  831 + serializer_g = CompleteGoalSerializer(goals, many = True)
  832 + else:
  833 + serializer_w = SimpleWebpageSerializer(webpages, many = True)
  834 + serializer_y = SimpleYTVideoSerializer(ytvideos, many = True)
  835 + serializer_f = SimpleFileLinkSerializer(filelinks, many = True)
  836 + serializer_l = SimpleLinkSerializer(links, many = True)
  837 + serializer_p = SimplePDFFileSerializer(pdffiles, many = True)
  838 + serializer_g = SimpleGoalSerializer(goals, many = True)
  839 +
  840 + json.dump(serializer_w.data, file)
  841 + json.dump(serializer_y.data, file)
  842 + json.dump(serializer_f.data, file)
  843 + json.dump(serializer_l.data, file)
  844 + json.dump(serializer_p.data, file)
  845 + json.dump(serializer_g.data, file)
795 846  
796 847 file.close()
797 848  
... ...
themes/urls.py
... ... @@ -5,5 +5,4 @@ urlpatterns = [
5 5 url(r'^$', views.IndexView.as_view(), name = 'manage'),
6 6 url(r'^basic_elements$', views.BasicElementsSettings.as_view(), name = 'basic'),
7 7 url(r'^css_selector$', views.CSSStyleSettings.as_view(), name = 'css'),
8   - url(r'^contrast$',views.Contrast, name = 'contrast'),
9 8 ]
... ...
themes/views.py
... ... @@ -3,7 +3,7 @@ from django.shortcuts import render
3 3 from django.contrib import messages
4 4 from django.core.urlresolvers import reverse, reverse_lazy
5 5 from django.utils.translation import ugettext_lazy as _
6   -from django.http import HttpResponse, JsonResponse, HttpResponseRedirect
  6 +from django.http import HttpResponse, JsonResponse, HttpResponseRedirect,HttpRequest
7 7 from django.shortcuts import redirect
8 8  
9 9 from braces import views as braces_mixins
... ... @@ -79,16 +79,3 @@ class CSSStyleSettings(braces_mixins.LoginRequiredMixin, braces_mixins.Staffuser
79 79 context['settings_menu_active'] = "settings_menu_active"
80 80  
81 81 return context
82   -
83   -def Contrast(request):
84   - theme = Themes.objects.get(id = 1)
85   -
86   - if theme.css_style == 'contrast':
87   - theme.css_style = 'green'
88   - else:
89   - theme.css_style = 'contrast'
90   - theme.save()
91   -
92   - caminho = request.META.get('HTTP_REFERER')
93   -
94   - return HttpResponseRedirect(caminho)
... ...
topics/serializers.py 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +from rest_framework import serializers
  2 +
  3 +from .models import Topic, Resource
  4 +
  5 +class TopicSerializer(serializers.ModelSerializer):
  6 + class Meta:
  7 + model = Topic
  8 + exclude = ('subject',)
0 9 \ No newline at end of file
... ...
users/serializers.py
... ... @@ -5,4 +5,4 @@ class UserSerializer(serializers.ModelSerializer):
5 5 class Meta:
6 6 model = User
7 7 fields = ('username','email','image','last_update','date_created','last_name','social_name',
8   - 'is_staff','is_active')
  8 + 'is_staff','is_active','description')
... ...
users/templates/users/login.html
... ... @@ -87,7 +87,7 @@
87 87 <span >[{{LANGUAGE_CODE}}] </span>
88 88  
89 89 </a>
90   - <a href="{% url 'themes:contrast'%}" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust"></i></a>
  90 + <a href="" id = "contrast_button" style="margin-left:10px;"><i class="glyphicon glyphicon-adjust"></i></a>
91 91 <ul class="dropdown-menu">
92 92  
93 93  
... ... @@ -146,7 +146,19 @@
146 146 </div>
147 147 </div>
148 148  
149   -
  149 +<script type="text/javascript">
  150 + $("#contrast_button" ).click(function() {
  151 + if (Cookies.get('contrast_check')) {
  152 + Cookies.remove('contrast_check')
  153 + location.reload()
  154 + }
  155 + else {
  156 + Cookies.set('contrast_check','anonymous')
  157 + location.reload()
  158 + }
  159 +
  160 + });
  161 +</script>
150 162 {% endblock%}
151 163  
152 164 {% block footer %}
... ...
webpage/serializers.py 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +from rest_framework import serializers
  2 +
  3 +from subjects.serializers import TagSerializer
  4 +from topics.serializers import TopicSerializer
  5 +from pendencies.serializers import PendenciesSerializer
  6 +from students_group.serializers import StudentsGroupSerializer
  7 +
  8 +from .models import Webpage
  9 +
  10 +class SimpleWebpageSerializer(serializers.ModelSerializer):
  11 + topic = TopicSerializer()
  12 + tags = TagSerializer(many = True)
  13 + pendencies_resource = PendenciesSerializer(many = True)
  14 +
  15 + class Meta:
  16 + model = Webpage
  17 + exclude = ('students', 'groups',)
  18 +
  19 +class CompleteWebpageSerializer(serializers.ModelSerializer):
  20 + topic = TopicSerializer()
  21 + tags = TagSerializer(many = True)
  22 + pendencies_resource = PendenciesSerializer(many = True)
  23 + groups = StudentsGroupSerializer(many = True)
  24 +
  25 + class Meta:
  26 + model = Webpage
  27 + fields = '__all__'
0 28 \ No newline at end of file
... ...
youtube_video/serializers.py 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +from rest_framework import serializers
  2 +
  3 +from subjects.serializers import TagSerializer
  4 +from topics.serializers import TopicSerializer
  5 +from pendencies.serializers import PendenciesSerializer
  6 +from students_group.serializers import StudentsGroupSerializer
  7 +
  8 +from .models import YTVideo
  9 +
  10 +class SimpleYTVideoSerializer(serializers.ModelSerializer):
  11 + topic = TopicSerializer()
  12 + tags = TagSerializer(many = True)
  13 + pendencies_resource = PendenciesSerializer(many = True)
  14 +
  15 + class Meta:
  16 + model = YTVideo
  17 + exclude = ('students', 'groups',)
  18 +
  19 +class CompleteYTVideoSerializer(serializers.ModelSerializer):
  20 + topic = TopicSerializer()
  21 + tags = TagSerializer(many = True)
  22 + pendencies_resource = PendenciesSerializer(many = True)
  23 + groups = StudentsGroupSerializer(many = True)
  24 +
  25 + class Meta:
  26 + model = YTVideo
  27 + fields = '__all__'
0 28 \ No newline at end of file
... ...