Commit a4c6c4e71cc7b1f105bc0dfe0cb76e3c7798ee58

Authored by fbormann
2 parents 94f73b06 6ee24e2b

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

.gitignore
... ... @@ -49,4 +49,5 @@ coverage.xml
49 49  
50 50 angular_api
51 51 logs/
52   -amadeus/upload/
  52 +amadeus/uploads/
  53 +links/static/images/
... ...
core/static/js/topic_editation_presentation.js
... ... @@ -1,79 +0,0 @@
1   -
2   -var x = 0;
3   -$(".edit_card").on('click', function() {
4   - $(".presentation").css('display','none');
5   - $(".editation").css('display','block');
6   -})
7   -$(".edit_card_end").on('click', function() {
8   - $(".editation").css('display','none');
9   - $(".presentation").css('display','block');
10   -})
11   -
12   -$("#bot").on('click', function(){
13   - x = x+1;
14   - console.log(2)
15   - if(x%2 == 0){
16   - console.log(0)
17   - $("#down").attr('class', 'fa fa-caret-square-o-down');
18   -}
19   -else{
20   - console.log(1)
21   - $("#down").attr('class', 'fa fa-caret-square-o-up');
22   -}
23   -
24   -})
25   -$("#bot1").on('click', function(){
26   - x = x+1;
27   - console.log(2)
28   - if(x%2 == 0){
29   - console.log(0)
30   - $("#down1").attr('class', 'fa fa-caret-square-o-down');
31   -}
32   -else{
33   - console.log(1)
34   - $("#down1").attr('class', 'fa fa-caret-square-o-up');
35   -}
36   -
37   -})
38   -
39   -$("#bot2").on('click', function(){
40   - x = x+1;
41   - console.log(2)
42   - if(x%2 == 0){
43   - console.log(0)
44   - $("#down2").attr('class', 'fa fa-caret-square-o-down');
45   -}
46   -else{
47   - console.log(1)
48   - $("#down2").attr('class', 'fa fa-caret-square-o-up');
49   -}
50   -
51   -})
52   -
53   -$("#bot3").on('click', function(){
54   - x = x+1;
55   - console.log(2)
56   - if(x%2 == 0){
57   - console.log(0)
58   - $("#down3").attr('class', 'fa fa-caret-square-o-down');
59   -}
60   -else{
61   - console.log(1)
62   - $("#down3").attr('class', 'fa fa-caret-square-o-up');
63   -}
64   -
65   -})
66   -$("#bot4").on('click', function(){
67   - x = x+1;
68   - console.log(2)
69   - if(x%2 == 0){
70   - console.log(0)
71   - $("#down4").attr('class', 'fa fa-caret-square-o-down');
72   -}
73   -else{
74   - console.log(1)
75   - $("#down4").attr('class', 'fa fa-caret-square-o-up');
76   -}
77   -
78   -})
79   -
courses/static/js/topic_editation_presentation.js
  1 +
1 2 $(document).ready(function(){
2 3 $(".editation").hide();
3 4 });
... ... @@ -10,5 +11,3 @@ function show_presentation(id_topic){
10 11 $(".editation_"+ id_topic).hide();
11 12 $(".presentation_"+ id_topic).show();
12 13 };
13   -
14   -
... ...
courses/templates/subject/form_view_teacher.html
... ... @@ -125,7 +125,7 @@
125 125 {# opções de cancelar e editar no modo de edição #}
126 126 <div class="form-group editation editation_{{topic.slug}}">
127 127 <div class="col-md-10">
128   - <a href="javascript:show_presentation('{{topic.slug}}')" class="btn btn-raise btn-default">{% trans 'Back' %}</a>
  128 + <a href="javascript:show_presentation('{{topic.slug}}')" class="btn btn-raised btn-default">{% trans 'Back' %}</a>
129 129 {# <a href="javascript:show_presentation('{{topic.slug}}')" class="btn btn-raised btn-primary">{% trans 'Submit' %}</a>#}
130 130 </div>
131 131 </div>
... ...
links/templates/links/create_link.html
... ... @@ -45,6 +45,7 @@
45 45 {# // <script src="{% static 'js/links.js' %}"></script> #}
46 46 <script type="text/javascript">
47 47 $("#form-link").submit(function(event) {
  48 + $("#createLinksModal").modal("hide");
48 49 var data = new FormData($('#form-link').get(0));
49 50 $.ajax({
50 51 url: "{% url 'course:links:create_link' topic.slug %}",
... ... @@ -54,15 +55,16 @@
54 55 processData: false,
55 56 contentType: false,
56 57 success: function(data) {
57   - $('#createLinksModal').modal('hide');
  58 + $('#requisicoes_ajax').empty();
58 59 $('#list-topic{{ topic.id }}-links').append(data);
59 60 $('#list-topic{{ topic.id }}-links-edit').append(data);
60 61 alertify.alert('Link successfully created!')
61 62 },
62 63 error: function(data){
63   - $('.erro').html(data.responseText);
64   - $('.modal-backdrop').remove();
65   - $('#createLinksModal').modal();
  64 + $("div.modal-backdrop.fade.in").remove();
  65 + $('#requisicoes_ajax').empty();
  66 + $('#requisicoes_ajax').append(data.responseText);
  67 + $('#createLinksModal').modal('show');
66 68 alertify.alert('Invalid link, insert a valid one!');
67 69 }
68 70 });
... ...
links/templates/links/delete_link.html
... ... @@ -40,6 +40,7 @@
40 40 <script type="text/javascript">
41 41 $("#form-delete-link").submit(function(event) {
42 42 var data = new FormData($('#form-delete-link').get(0));
  43 + $('#linkDeleteModal').modal('hide');
43 44 $.ajax({
44 45 url: "{% url 'course:links:delete_link' link.slug %}",
45 46 type: $("#form-delete-link").attr('method'),
... ... @@ -48,16 +49,17 @@
48 49 processData: false,
49 50 contentType: false,
50 51 success: function(data) {
51   - $('#linkDeleteModal').modal('hide');
  52 + $('#requisicoes_ajax').empty();
52 53 $('#link_{{ link.slug }}').remove();
53 54 $('#link_edit_icon_{{ link.slug }}').remove();
54 55 $('#link_edit_{{ link.slug }}').remove();
55 56 alertify.alert('Link successfully deleted!')
56 57 },
57 58 error: function(data){
58   - // $('.erro-update').html(data.responseText);
59   - $('.modal-backdrop').remove();
60   - $('#linkDeteleModal').modal();
  59 + $("div.modal-backdrop.fade.in").remove();
  60 + $('#requisicoes_ajax').empty();
  61 + $('#requisicoes_ajax').append(data.responseText);
  62 + $('#linkDeleteModal').modal('show');
61 63 alertify.alert('Error when trying to delete.');
62 64 }
63 65 });
... ...
links/templates/links/update_link.html
... ... @@ -50,6 +50,7 @@
50 50 {# // <script src="{% static 'js/links.js' %}"></script> #}
51 51 <script type="text/javascript">
52 52 $("#form-update-link").submit(function(event) {
  53 + $('#linksModalEdit').modal('hide');
53 54 var data = new FormData($('#form-update-link').get(0));
54 55 $.ajax({
55 56 url: "{% url 'course:links:update_link' link.slug %}",
... ... @@ -59,14 +60,15 @@
59 60 processData: false,
60 61 contentType: false,
61 62 success: function(data) {
62   - $('#linksModalEdit').modal('hide');
  63 + $('#requisicoes_ajax').empty();
63 64 $('#link_edit_{{ link.slug }}').replaceWith(data);
64 65 $('#link_{{ link.slug }}').replaceWith(data);
65 66 alertify.alert("Sucessfully Updated!")
66 67 },
67 68 error: function(data){
68   - $('.erro-update').html(data.responseText);
69   - $('.modal-backdrop').remove();
  69 + $("div.modal-backdrop.fade.in").remove();
  70 + $('#requisicoes_ajax').empty();
  71 + $('#requisicoes_ajax').append(data.responseText);
70 72 $('#linksModalEdit').modal();
71 73 alertify.alert('Invalid link, insert a valid one!');
72 74 }
... ...
links/templates/links/view_link.html
... ... @@ -22,10 +22,6 @@
22 22 </div>
23 23 </div>
24 24 </div>
25   -
26   -<div class = 'row' id ="divModalLink">
27   -
28   -</div>
29 25 <!-- EndModal -->
30 26 <script type="text/javascript">
31 27 $('.modal-backdrop').remove();
... ...
poll/static/js/modal_poll.js
1   -//
  1 +//
2 2 // //controles do modal
3 3 // $(window).ready(function() { // utilizado para abrir o modal quando tiver tido algum erro no preenchimento do formulario
4 4 // if($('.not_submited').length){
... ... @@ -38,7 +38,8 @@ var Submite = {
38 38 }
39 39 });
40 40 $("#requisicoes_ajax").empty();
41   - alertify.alert('Link successfully created!');
  41 + alertify.alert('Poll successfully created!');
  42 + $("div.modal-backdrop.fade.in").remove();
42 43 }).fail(function(data){
43 44 $("div.modal-backdrop.fade.in").remove();
44 45 $("#requisicoes_ajax").empty();
... ... @@ -49,12 +50,9 @@ var Submite = {
49 50 update: function(url,dados, slug_poll, slug_topic){
50 51 $('#poll').modal('hide');
51 52 $.post(url,dados, function(data){
52   - $('#list-topic-'+ slug_topic +'-poll #'+slug_poll).remove();
53   - $('#list-topic-'+ slug_topic +'-poll #'+slug_poll).remove();
54   - $('#list-topic-'+ slug_topic +'-poll').append(data);
55   - $('#list-topic-'+ slug_topic +'-poll-edit').append(data);
56   - $("#requisicoes_ajax").empty();
57   - alertify.alert('Link successfully updated!')
  53 + $('#list-topic-'+ slug_topic +'-poll #'+slug_poll).replaceWith(data);
  54 + $('#list-topic-'+ slug_topic +'-poll #'+slug_poll).replaceWith(data);
  55 + alertify.alert('Poll successfully updated!')
58 56 }).fail(function(data){
59 57 $("div.modal-backdrop.fade.in").remove();
60 58 $("#requisicoes_ajax").empty();
... ...