Commit 4e750d28 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Merge branch 'develop' into 'master'

refactor notes.html template to user tranlate from js

See merge request !124
parents 83790810 9f8e7115
......@@ -3,13 +3,13 @@
{% load static %}
{% block js %}
{{ block.super }}
{% compress js %}
<!-- Notes -->
<script type="text/javascript" src="{% static 'js/notes/app.js' %}"></script>
<script type="text/javascript" src="{% static 'js/notes/controllers.js' %}"></script>
<script type="text/javascript" src="{% static 'js/notes/services.js' %}"></script>
{% endcompress %}
{{ block.super }}
{% compress js %}
<!-- Notes -->
<script type="text/javascript" src="{% static 'js/notes/app.js' %}"></script>
<script type="text/javascript" src="{% static 'js/notes/controllers.js' %}"></script>
<script type="text/javascript" src="{% static 'js/notes/services.js' %}"></script>
{% endcompress %}
{% endblock %}
{% block wrapper_classes %}
......@@ -17,7 +17,7 @@ notes my-notes
{% endblock %}
{% block body_attrs %}
ng-app="notes"
ng-app="notes"
{% endblock %}
{% block content %}
......@@ -28,52 +28,51 @@ notes my-notes
<section class="content">
{% block notes_header %}
<div class="page-header">
<h2><i class="fa fa-angle-double-right"></i>Minhas Anotações</h2>
<h2><i class="fa fa-angle-double-right" translate></i>My Notes</h2>
<a href="/api/user_notes/download" class="btn btn-primary" translate>Download my notes</a>
</div>
{% endblock %}
<p ng-if="courses.length == 0">
Você ainda não fez nenhuma anotação.
<p ng-if="courses.length == 0" translate>
You don't have any note yet.
<!-- Você ainda não fez nenhuma anotação. -->
</p>
{% verbatim %}
<div class="courses courses-list" ng-repeat="course in courses">
<div class="line">
<div class="header">
<h3 class="course-title">{{course.name}}</h3>
<a href="/course/{{course.slug}}/intro/" class="btn btn-xs btn-primary">Início</a>
<a href="/course/{{course.slug}}/resume/" class="btn btn-xs btn-info">Continuar curso</a>
<a href="/course/{{course.slug}}/intro/" class="btn btn-xs btn-primary" translate>Go to course</a>
<!-- <a href="/course/{{course.slug}}/resume/" class="btn btn-xs btn-info">Continuar curso</a> {% endcomment %} -->
</div>
<div class="notes-info">
<span translate
translate-n="course.course_notes_number"
translate-plural="você tem {{$count}} notas">você tem 1 nota</span>
<button class="btn btn-link btn-sm"
ng-init="course.show_notes=false"
ng-class="course.show_notes ? 'hide-all': 'show-all'"
ng-click="course.show_notes=!course.show_notes">
<span ng-show="!course.show_notes"
translate
translate-n="course.course_notes_number"
translate-plural="ver todas">ver</span>
<span ng-show="course.show_notes">ocultar</span>
<span translate translate-n="course.course_notes_number"
translate-plural="You have {{$count}} notes">You have 1 note</span>
<button class="btn btn-link btn-sm" ng-init="course.show_notes=false"
ng-class="course.show_notes ? 'hide-all': 'show-all'"
ng-click="course.show_notes=!course.show_notes">
<span ng-show="!course.show_notes" translate translate-n="course.course_notes_number"
translate-plural="Show all">Show</span>
<span ng-show="course.show_notes">Hide</span>
</button>
</div>
<div ng-repeat="lesson in course.lessons_notes" ng-show="course.show_notes">
<h4 class="lesson-title">{{ lesson.name }}</h4>
<div class="notes-list" ng-repeat="unit in lesson.units_notes">
<h5 class="unit-title">{{ unit.name }}</h5>
<div class="note-content">
<div class="row">
<div class="col-sm-7 col-md-8 col-lg-9 note-text">{{ unit.user_note.text }}</div>
<div class="col-sm-5 col-md-4 col-lg-3">
<!--<a ng-href="/course/{{ course.slug }}/lesson/{{ lesson.slug }}/#/{{ unit.id }}"-->
<!--class="btn btn-xs btn-success edit">editar (vai para o curso)</a>-->
<button class="btn btn-xs btn-danger delete"
ng-click="delele_note(course, lesson, unit, unit.user_note)">descartar</button>
</div>
</div>
</div>
</div>
<h4 class="lesson-title">{{ lesson.name }}</h4>
<div class="notes-list" ng-repeat="unit in lesson.units_notes">
<h5 class="unit-title">{{ unit.name }}</h5>
<div class="note-content">
<div class="row">
<div class="col-sm-7 col-md-8 col-lg-9 note-text">{{ unit.user_note.text }}</div>
<div class="col-sm-5 col-md-4 col-lg-3">
<button class="btn-danger delete"
ng-click="delele_note(course, lesson, unit, unit.user_note)">Excluir</button>
<a ng-href="/course/{{ course.slug }}/lesson/{{ lesson.slug }}/#/{{ unit.id }}"
class="btn btn-xs btn-success edit">Editar</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -82,4 +81,4 @@ notes my-notes
</div>
<!-- CONTAINER -->
{% endblock %}
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment