-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
66c90cd
commit ebc9baf
Showing
13 changed files
with
287 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{% block head %} | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>{{ course }}</title> | ||
|
||
<script src="//www.youtube.com/iframe_api"></script> | ||
|
||
{% load static %} | ||
{% load compressed %} | ||
|
||
{% compressed_css 'common' %} | ||
{% compressed_css 'admin' %} | ||
{% compressed_js 'all' %} | ||
|
||
{# TODO: aprender a comprimir estas coisas (fabio) #} | ||
<script type="text/javascript" src="{% static 'js/vendor/pagedown/Markdown.Converter.js' %}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{% static 'js/vendor/pagedown/Markdown.Editor.js' %}" charset="utf-8"></script> | ||
<script type="text/javascript" src="{% static 'js/vendor/pagedown/Markdown.Sanitizer.js' %}" charset="utf-8"></script> | ||
{% endblock %} | ||
</head> | ||
<body id="admin"> | ||
|
||
<!-- NAVBAR --> | ||
<div id="main-navbar" class="navbar navbar-fixed-top navbar-inverse"> | ||
<div class="container"> | ||
<a class="navbar-brand" href="/">TIM Tec - ADMIN</a> | ||
<ul class="nav navbar-nav pull-right"> | ||
<li> | ||
<a href="#">Cursos</a> | ||
</li> | ||
<li> | ||
<a href="#">Usuários</a> | ||
</li> | ||
<li> | ||
<a href="#">Estatísticas</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<!-- END NAVBAR --> | ||
|
||
<!-- WRAPPER --> | ||
<div class="wrapper"> | ||
{% block content %} | ||
<h1>missing content block</h1> | ||
{% endblock %} | ||
</div> | ||
<!-- END WRAPPER --> | ||
|
||
<!-- FOOTER --> | ||
{% include 'footer.html' %} | ||
<!-- END FOOTER --> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from course_material.models import CourseMaterial | ||
from rest_framework import serializers | ||
|
||
|
||
class CourseMaterialSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = CourseMaterial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
'use strict'; | ||
|
||
angular.module('courseMaterial.directives', []).directive('dropZone', function() { | ||
return function(scope, element, attrs) { | ||
element.dropzone({ | ||
url: "/upload", | ||
maxFilesize: 100, | ||
paramName: "uploadfile", | ||
angular.module('courseMaterial.directives', []). | ||
directive('dropZone', function() { | ||
return function(scope, element, attrs) { | ||
element.dropzone({ | ||
url: "/upload", | ||
maxFilesize: 100, | ||
paramName: "uploadfile", | ||
}); | ||
}; | ||
}). | ||
directive('markdowneditor', function(){ | ||
return { | ||
"restrict": 'A', | ||
"controller": function($scope, $element) { | ||
// $element.find('textarea').attr('id', "wmd-input"); | ||
$element.find('.js-button-bar').attr('id', "wmd-button-bar"); | ||
|
||
var editor = new Markdown.Editor(Markdown.getSanitizingConverter(), ''); | ||
editor.run(); | ||
}, | ||
"link": function(scope, element) { | ||
var read = function read(evt){ | ||
scope.editor_text = evt.currentTarget.value; | ||
}; | ||
element.find('textarea').on('blur change', read); | ||
} | ||
}; | ||
}); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
/* Filters */ | ||
|
||
angular.module('courseMaterial.filters', ["ngSanitize"]). | ||
filter('markdown', ['$window', function($window) { | ||
return function(text) { | ||
return text ? Markdown.getSanitizingConverter().makeHtml(text) : ""; | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{% extends 'admin/admin-base.html' %} | ||
{% load i18n %} | ||
{% load staticfiles %} | ||
{% load timtec_markdown %} | ||
|
||
{% block head %} | ||
{{ block.super }} | ||
{% include "_course_material_angular.html" %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<script> | ||
window.course_id = {{ course.pk }};</script> | ||
<!-- CONTAINER --> | ||
<div> | ||
<!-- HEADER --> | ||
<header id="main-header" class="container"> | ||
<div class="page-header"> | ||
<div class="row"> | ||
<div class="col-sm-9 col-lg-9"> | ||
<h1 class="top editable"><span contenteditable="true" ng-model="course.name"></span></h1> | ||
<h5><span class="icon-addable icon-plus-sign-alt"></span> Adicionar professores ao curso</h5> | ||
</div> | ||
<div class="col-sm-3 col-lg-3 textright"> | ||
<!-- COURSE-SECTION-NAV --> | ||
<nav class="course-sections textright"> | ||
<a href="{% url 'course_admin' course.slug %}"> | ||
<span class="has-tooltip icon-home" data-toggle="tooltip" data-placement="top" data-original-title="Intro"></span> | ||
</a> | ||
<a href="{% url 'course_material_admin' course.slug %}"> | ||
<span class="has-tooltip icon-exclamation-sign" data-toggle="tooltip" data-placement="top" data-original-title="Material Didádico"></span> | ||
</a> | ||
</nav> | ||
<!-- END COURSE-SECTION-NAV --> | ||
</div> | ||
</div> | ||
</div> | ||
</header> | ||
<!-- END HEADER --> | ||
<!-- MAIN CONTENT --> | ||
<section id="main-content" class="container"> | ||
<div class="row"> | ||
<div class="col-sm-9 col-lg-9" ng-app="courseMaterial" ng-controller="CourseMaterialEditorCtrl"> | ||
<p class="description"> | ||
<span class="description" ng-bind-html="course_material.text|markdown"></span> | ||
</p> | ||
<a data-toggle="modal" href="#course-material-modal">Editar texto</a> | ||
{% verbatim %} | ||
<div class="modal fade" id="course-material-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> | ||
× | ||
</button> | ||
<h4 class="modal-title">Editar material didático</h4> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="text-editor" markdowneditor="true"> | ||
<div class="row"> | ||
<div class="col-lg-12 js-button-bar"></div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-lg-12 form-group"> | ||
<textarea id="wmd-input" ng-model="editor_text" class="col-lg-12 form-control" rows="15"></textarea> | ||
</div> | ||
</div> | ||
<div class="js-preview"></div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" ng-click="reset()" class="btn btn-default" data-dismiss="modal"> | ||
Cancelar | ||
</button> | ||
<button type="button" ng-click="save()" class="btn btn-primary" data-dismiss="modal"> | ||
Save changes | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endverbatim %} | ||
</div> | ||
<!-- ASIDE --> | ||
<aside class="col-sm-3 col-lg-3"> | ||
<form action="{% url 'file_upload' course.slug %}" class="dropzone textcenter" drop-zone id="file-dropzone"> | ||
<p> | ||
<strong>Drop</strong> files to upload | ||
<br> | ||
(or click) | ||
</p> | ||
{% csrf_token %} | ||
</form> | ||
<ul class="uploaded-files-list"> | ||
<li> | ||
<h5>{% trans "Files" %}</h5> | ||
</li> | ||
{% for file in course_material.files.all %} | ||
<li> | ||
<a href="{{ file.file.url }}">{{ file.file.name }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</aside> | ||
<!-- END ASIDE --> | ||
</div> | ||
</section> | ||
<!-- END MAIN CONTENT--> | ||
</div> | ||
<!-- END CONTAINER --> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters