Commit beabbf7f105221b61d094372d240ea8ec90d5874
1 parent
90bfb5c9
Exists in
master
and in
5 other branches
modifying js topic editation #205
Showing
3 changed files
with
16 additions
and
14 deletions
Show diff stats
core/static/css/base/amadeus.css
| ... | ... | @@ -404,6 +404,7 @@ ul, li { |
| 404 | 404 | .dropdown-menu .pull-right { |
| 405 | 405 | right: 0; |
| 406 | 406 | } |
| 407 | + .editation{display: none} | |
| 407 | 408 | .moreAccordion{ padding-left: 0px; padding-right: 0px;} |
| 408 | 409 | .moreAccordion div button{ padding-left: 0px; padding-right: 0px;} |
| 409 | 410 | .cards-content{ padding-left: 0px; padding-right: 0px; } | ... | ... |
courses/static/js/topic_editation_presentation.js
| 1 | -$(".edit_card").on('click', function() { | |
| 2 | - $(".presentation").css('display','none'); | |
| 3 | - $(".editation").css('display','block'); | |
| 4 | -}) | |
| 5 | -$(".edit_card_end").on('click', function() { | |
| 6 | - $(".editation").css('display','none'); | |
| 7 | - $(".presentation").css('display','block'); | |
| 8 | -}) | |
| 9 | 1 | \ No newline at end of file |
| 2 | +function show_editation(id_topic){ | |
| 3 | + $("#presentation_"+ id_topic).css('display','none'); | |
| 4 | + $("#editation_"+ id_topic).css('display','block'); | |
| 5 | +} | |
| 6 | + | |
| 7 | +function show_presentation(id_topic){ | |
| 8 | + $("#editation_"+ id_topic).css('display','none'); | |
| 9 | + $("#presentation_"+ id_topic).css('display','block'); | |
| 10 | +} | |
| 10 | 11 | \ No newline at end of file | ... | ... |
courses/templates/subject/form_view_teacher.html
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | <a role="button"> |
| 17 | 17 | <h4>{{topic}}</h4> |
| 18 | 18 | </a> |
| 19 | - </div><!--column--> | |
| 19 | + </div><!--column --> | |
| 20 | 20 | <div class="col-xs-3 col-md-2 divMoreActions"> |
| 21 | 21 | <div class="btn-group"> |
| 22 | 22 | <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> |
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | {% if dropdown_topic %} |
| 32 | 32 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
| 33 | 33 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal4"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> |
| 34 | - <li><a href="javascript:void(0)" class="edit_card"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | |
| 34 | + <li><a href="javascript:show_editation('{{topic.slug}}')"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | |
| 35 | 35 | <li><a href="javascript:void(0)" data-toggle="modal" data-target="#removeTopic"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> |
| 36 | 36 | </ul> |
| 37 | 37 | {% endif %} |
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | </div> |
| 42 | 42 | <div class="panel-collapse collapseTopic-{{topic.slug}} collapse in" role="tabpanel" aria-labelledby="heading_{{topic.id}}" aria-expanded="true" aria-hidden="false"> |
| 43 | 43 | <div class="panel-body"> |
| 44 | - <div class="presentation"> | |
| 44 | + <div class="presentation" id="presentation_{{topic.slug}}"> | |
| 45 | 45 | <p> |
| 46 | 46 | <i> |
| 47 | 47 | {{topic.description|linebreaks}} |
| ... | ... | @@ -86,7 +86,7 @@ |
| 86 | 86 | </div> |
| 87 | 87 | </div> |
| 88 | 88 | </div><!--EndPresentation--> |
| 89 | - <div class="editation"> | |
| 89 | + <div class="editation" id="editation_{{topic.slug}}"> | |
| 90 | 90 | <div class="form-group"> |
| 91 | 91 | <label class="control-label" for="focusedInput2">{% trans 'Name Topic' %}</label> |
| 92 | 92 | <input type="text" class="form-control" value="{{topic}}"> |
| ... | ... | @@ -135,8 +135,8 @@ |
| 135 | 135 | </div> |
| 136 | 136 | <div class="form-group"> |
| 137 | 137 | <div class="col-md-10"> |
| 138 | - <button type="button" class="btn btn-raised btn-default edit_card_end">{% trans 'Cancel' %}</button> | |
| 139 | - <button type="submit" class="btn btn-raised btn-primary edit_card_end">{% trans 'Submit' %}</button> | |
| 138 | + <a href="javascript:show_presentation('{{topic.slug}}')" class="btn btn-raised btn-default">{% trans 'Cancel' %}</a> | |
| 139 | + <a href="javascript:show_presentation('{{topic.slug}}')" class="btn btn-raised btn-primary">{% trans 'Submit' %}</a> | |
| 140 | 140 | </div> |
| 141 | 141 | </div> |
| 142 | 142 | </div><!--EndEditation--> | ... | ... |