editorconfig applied

This commit is contained in:
Peter Pfeufer
2021-05-17 11:42:28 +02:00
parent bad36a69e8
commit e6a4cea4de
99 changed files with 522 additions and 600 deletions

View File

@@ -9,11 +9,12 @@ from .models import Application
class ApplicationsMenu(MenuItemHook):
def __init__(self):
MenuItemHook.__init__(self,
_('Applications'),
'far fa-file fa-fw',
'hrapplications:index',
navactive=['hrapplications:'])
MenuItemHook.__init__(
self,
_('Applications'),
'far fa-file fa-fw',
'hrapplications:index',
navactive=['hrapplications:'])
def render(self, request):
app_count = Application.objects.pending_requests_count_for_user(request.user)

View File

@@ -42,14 +42,12 @@
{% endif %}
</td>
<td class="text-center">
<a href="{% url 'hrapplications:personal_view' personal_app.id %}"
class="btn btn-primary">
<a href="{% url 'hrapplications:personal_view' personal_app.id %}" class="btn btn-primary">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
{% if personal_app.approved == None %}
<a href="{% url 'hrapplications:personal_removal' personal_app.id %}"
class="btn btn-danger">
<a href="{% url 'hrapplications:personal_removal' personal_app.id %}" class="btn btn-danger">
<span class="glyphicon glyphicon-remove"></span>
</a>
{% endif %}
@@ -105,8 +103,7 @@
{% endif %}
</td>
<td class="text-center">
<a href="{% url 'hrapplications:view' app.id %}"
class="btn btn-primary">
<a href="{% url 'hrapplications:view' app.id %}" class="btn btn-primary">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
</td>
@@ -150,13 +147,11 @@
{% endif %}
</td>
<td class="text-center">
<a href="{% url 'hrapplications:view' app.id %}"
class="btn btn-primary">
<a href="{% url 'hrapplications:view' app.id %}" class="btn btn-primary">
<span class="glyphicon glyphicon-eye-open"></span>
</a>
{% if perms.hrapplications.delete_application %}
<a href="{% url 'hrapplications:remove' app.id %}"
class="btn btn-danger">
<a href="{% url 'hrapplications:remove' app.id %}" class="btn btn-danger">
<span class="glyphicon glyphicon-remove"></span>
</a>
{% endif %}
@@ -175,18 +170,15 @@
{% if perms.auth.human_resources %}
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal fade" id="myModal" 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"><span aria-hidden="true">&times;</span><span
class="sr-only">{% trans "Close" %}</span></button>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{% trans "Close" %}</span></button>
<h4 class="modal-title" id="myModalLabel">{% trans "Application Search" %}</h4>
</div>
<div class="modal-body">
<form class="form-signin" role="form"
action={% url 'hrapplications:search' %} method="POST">
<form class="form-signin" role="form" action={% url 'hrapplications:search' %} method="POST">
{% csrf_token %}
{{ search_form|bootstrap }}
<br/>

View File

@@ -56,18 +56,15 @@
{% if perms.auth.human_resources %}
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal fade" id="myModal" 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"><span aria-hidden="true">&times;</span><span
class="sr-only">{% trans "Close" %}</span></button>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{% trans "Close" %}</span></button>
<h4 class="modal-title" id="myModalLabel">{% trans "Application Search" %}</h4>
</div>
<div class="modal-body">
<form class="form-signin" role="form"
action={% url 'hrapplications:search' %} method="POST">
<form class="form-signin" role="form" action={% url 'hrapplications:search' %} method="POST">
{% csrf_token %}
{{ search_form|bootstrap }}
<br/>

View File

@@ -49,8 +49,7 @@
{% for char in app.characters %}
<tr>
<td class="text-center">
<img class="ra-avatar img-responsive img-circle"
src="{{ char.portrait_url_32 }}">
<img class="ra-avatar img-responsive img-circle" src="{{ char.portrait_url_32 }}">
</td>
<td class="text-center">{{ char.character_name }}</td>
<td class="text-center">{{ char.corporation_name }}</td>
@@ -77,25 +76,20 @@
{% if app.approved == None %}
{% if app.reviewer == user %}
{% if perms.hrapplications.approve_application %}
<a href="{% url 'hrapplications:approve' app.id %}"
class="btn btn-success">{% trans "Approve" %}</a>
<a href="{% url 'hrapplications:approve' app.id %}" class="btn btn-success">{% trans "Approve" %}</a>
{% endif %}
{% if perms.hrapplications.reject_application %}
<a href="{% url 'hrapplications:reject' app.id %}"
class="btn btn-danger">{% trans "Reject" %}</a>
<a href="{% url 'hrapplications:reject' app.id %}" class="btn btn-danger">{% trans "Reject" %}</a>
{% endif %}
{% if perms.hrapplications.delete_application %}
<a href="{% url 'hrapplications:remove' app.id %}"
class="btn btn-danger">{% trans "Delete" %}</a>
<a href="{% url 'hrapplications:remove' app.id %}" class="btn btn-danger">{% trans "Delete" %}</a>
{% endif %}
{% elif not app.reviewer %}
<a href="{% url 'hrapplications:mark_in_progress' app.id %}"
class="btn btn-warning">{% trans "Mark in Progress" %}</a>
<a href="{% url 'hrapplications:mark_in_progress' app.id %}" class="btn btn-warning">{% trans "Mark in Progress" %}</a>
{% endif %}
{% endif %}
{% if perms.hrapplications.add_applicationcomment %}
<button type="button" class="btn btn-primary" data-toggle="modal"
data-target="#myModal">{% trans "Comment" %}</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">{% trans "Comment" %}</button>
{% endif %}
</div>
</div>
@@ -104,15 +98,12 @@
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion"
href="#collapseThree" aria-expanded="false"
aria-controls="collapseThree">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
{% trans 'Comments' %} ({{ comments.count }})
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingThree">
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
<div class="panel-body">
{% for comment in comments %}
<div class="panel panel-default">
@@ -136,8 +127,7 @@
</div>
</div>
{% if perms.hrapplications.add_applicationcomment %}
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">

View File

@@ -63,15 +63,13 @@ def hr_application_create_view(request, form_id=None):
application.save()
for question in app_form.questions.all():
response = ApplicationResponse(question=question, application=application)
response.answer = "\n".join(request.POST.getlist(str(question.pk),
""))
response.answer = "\n".join(request.POST.getlist(str(question.pk), ""))
response.save()
logger.info("%s created %s" % (request.user, application))
return redirect('hrapplications:personal_view', application.id)
else:
questions = app_form.questions.all()
return render(request, 'hrapplications/create.html',
context={'questions': questions, 'corp': app_form.corp})
return render(request, 'hrapplications/create.html', context={'questions': questions, 'corp': app_form.corp})
else:
choices = []
for app_form in ApplicationForm.objects.all():
@@ -171,8 +169,7 @@ def hr_application_approve(request, app_id):
logger.info("User %s approving %s" % (request.user, app))
app.approved = True
app.save()
notify(app.user, "Application Accepted", message="Your application to %s has been approved." % app.form.corp,
level="success")
notify(app.user, "Application Accepted", message="Your application to %s has been approved." % app.form.corp, level="success")
else:
logger.warn("User %s not authorized to approve %s" % (request.user, app))
return redirect('hrapplications:index')
@@ -188,8 +185,7 @@ def hr_application_reject(request, app_id):
logger.info("User %s rejecting %s" % (request.user, app))
app.approved = False
app.save()
notify(app.user, "Application Rejected", message="Your application to %s has been rejected." % app.form.corp,
level="danger")
notify(app.user, "Application Rejected", message="Your application to %s has been rejected." % app.form.corp, level="danger")
else:
logger.warn("User %s not authorized to reject %s" % (request.user, app))
return redirect('hrapplications:index')
@@ -248,8 +244,7 @@ def hr_application_mark_in_progress(request, app_id):
app.reviewer = request.user
app.reviewer_character = request.user.profile.main_character
app.save()
notify(app.user, "Application In Progress",
message="Your application to %s is being reviewed by %s" % (app.form.corp, app.reviewer_str))
notify(app.user, "Application In Progress", message="Your application to %s is being reviewed by %s" % (app.form.corp, app.reviewer_str))
else:
logger.warn(
"User %s unable to mark %s in progress: already being reviewed by %s" % (request.user, app, app.reviewer))