-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #977 from jfunez/beta
Primeira versão da interface para marcar o usuário editor da revista #963
- Loading branch information
Showing
10 changed files
with
561 additions
and
57 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
364 changes: 364 additions & 0 deletions
364
scielomanager/journalmanager/migrations/0060_auto__add_field_journal_editor.py
Large diffs are not rendered by default.
Oops, something went wrong.
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
83 changes: 83 additions & 0 deletions
83
scielomanager/journalmanager/templates/journalmanager/editor.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{% extends "base_lv1.html" %} | ||
{% load inctag_toolbars %} | ||
{% load user_avatar %} | ||
{% load modal %} | ||
{% load i18n %} | ||
|
||
{% block page_title %}{{block.super}}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
{% journaldash_toolbar 'editor' journal user %} | ||
|
||
{{block.super}} | ||
|
||
{% if editor %} | ||
<table class="table table-condensed _listings"> | ||
<thead> | ||
<tr> | ||
<th>{% trans "Username" %}:</th> | ||
<th>{% trans "E-mail" %}:</th> | ||
<th>{% trans "Full name" %}:</th> | ||
<th>{% trans "Groups" %}:</th> | ||
<th>{% trans "Actions" %}:</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td> | ||
<a {% if not editor.is_active %}class="strikethrough"{% endif %} | ||
href="{% url user.edit user.pk %}"> | ||
<img class="img-rounded" src="{% user_avatar_url editor 'small' %}" alt="Gravatar"> | ||
{{ editor.username }} | ||
</a> | ||
</td> | ||
<td> | ||
<a href="mailto:{{ editor.email }}"> | ||
{{ editor.email }} | ||
</a> | ||
</td> | ||
<td>{{ editor.get_full_name }}</td> | ||
<td>{{ editor.groups.all|join:", " }}</td> | ||
<td> | ||
<a data-target='#id_modal_change_editor' data-toggle="modal" href="{% url editor.add journal.id %}" class="btn btn-mini btn-warning"> | ||
<i class="icon-pencil"></i> {% trans 'Change user editor' %} | ||
</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
{% else %} | ||
<div class="alert"> | ||
{% trans "<strong>Warning!</strong> No user was selected as editor of this journal. To be the editor user must be in 'Editors' group" %} | ||
</div> | ||
|
||
{% include 'journalmanager/includes/form_add_editor.html' %} | ||
|
||
{% endif %} | ||
|
||
{% modal_form title="Change editor user" modal_id="id_modal_change_editor" %} | ||
|
||
{% endblock %} | ||
|
||
{% block extrafooter %} | ||
<script> | ||
|
||
$('#close_btn').click(function(){ | ||
|
||
$('#modal').modal('hide'); | ||
|
||
}); | ||
|
||
$(".chzn-select").chosen({no_results_text: "Nenhum resultado encontrado para: "}) | ||
|
||
$('#modal').on('shown', function () { | ||
|
||
$("select[name='editor']").attr('class', 'chzn-select span12'); | ||
$(".chzn-select").chosen({no_results_text: "Nenhum resultado encontrado para: "}); | ||
|
||
}); | ||
|
||
</script> | ||
{% endblock %} | ||
|
53 changes: 0 additions & 53 deletions
53
scielomanager/journalmanager/templates/journalmanager/home_editor.html
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
scielomanager/journalmanager/templates/journalmanager/includes/form_add_editor.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% load i18n %} | ||
|
||
<div style="height: 150px"> | ||
<h4>{% trans 'Choose a user to be editor of this journal' %}:</h4> | ||
|
||
<form method="POST" action="{% url editor.add journal.id %}" enctype="application/x-www-form-urlencoded"> | ||
{% csrf_token %} | ||
<div class="control-group"> | ||
<div class="controls"> | ||
<select name="editor" class="chzn-select span3"> | ||
{% for user in users_editor %} | ||
<option value="">{% trans 'Nobody' %}</option> | ||
<option value="{{ user.pk }}">{{ user.get_full_name }}</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</div> | ||
|
||
{% if not request.is_ajax %} | ||
<div class="control-group"> | ||
<div class="controls"> | ||
<button type="submit" class="btn btn-success">{% trans 'Add this user as editor of this journal' %}</button> | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
</form> | ||
|
||
</div> |
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