Template updates, now includes middleware to detect the IGB

This commit is contained in:
Dreddit Web User
2011-01-17 12:06:31 +00:00
parent 11b8b2e07a
commit 943b4cb4e1
3 changed files with 32 additions and 10 deletions

View File

@@ -68,6 +68,7 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware',
'pagination.middleware.PaginationMiddleware', 'pagination.middleware.PaginationMiddleware',
'sso.middleware.IGBMiddleware',
) )
ROOT_URLCONF = 'urls' ROOT_URLCONF = 'urls'

19
sso/middleware.py Normal file
View File

@@ -0,0 +1,19 @@
class IGBMiddleware(object):
"""
Middleware to detect the EVE IGB
"""
def process_request(self, request):
request.is_igb = False
request.is_igb_trusted = False
if request.META.has_key('HTTP_EVE_TRUSTED'):
request.is_igb = True
if request.META.get('HTTP_EVE_TRUSTED') == 'Yes':
request.is_igb_trusted = True

View File

@@ -11,7 +11,7 @@
<ul> <ul>
<li>Applying Auth User: <a href="{% url sso.views.user_view app.user %}">{{ app.user }}</a></li> <li>Applying Auth User: <a href="{% url sso.views.user_view app.user %}">{{ app.user }}</a></li>
<li>Applying Character: <a href="{% url eve_api.views.eveapi_character rec.user_character.id %}">{{ app.character }}</a></li> <li>Applying Character: <a href="{% url eve_api.views.eveapi_character app.character.id %}">{{ app.character }}</a></li>
<li>Applying To: <a href="{% url eve_api.views.eveapi_corporation app.corporation.id %}">{{ app.corporation }}</a></li> <li>Applying To: <a href="{% url eve_api.views.eveapi_corporation app.corporation.id %}">{{ app.corporation }}</a></li>
<li>Application Status: <b>{{ app.get_status_display }}</b></li> <li>Application Status: <b>{{ app.get_status_display }}</b></li>
<li>Blacklist Status: <b>{% if app.blacklisted %}<font color='red'>BLACKLISTED</font>{% else %}<font color='geen'>OK</font>{% endif %}</b></li> <li>Blacklist Status: <b>{% if app.blacklisted %}<font color='red'>BLACKLISTED</font>{% else %}<font color='geen'>OK</font>{% endif %}</b></li>
@@ -19,30 +19,32 @@
{% ifnotequal app.status 5 %} {% ifnotequal app.status 5 %}
<h3>Actions</h3> <h3>Actions</h3>
<div class="skill_controls">
<p> <p>
{% if app.status < 1 %} {% if app.status < 1 %}
<a href="{% url hr.views.update_application app.id 1 %}">Submit Application</a>,&nbsp; <a href="{% url hr.views.update_application app.id 1 %}">Submit Application</a>
{% else %} {% else %}
<a href="{% url hr.views.update_application app.id 0 %}">Withdraw Application</a>,&nbsp; <a href="{% url hr.views.update_application app.id 0 %}">Withdraw Application</a>
{% endif %} {% endif %}
<a href="{% url hr.views.add_message app.id %}">Add Message</a>, <a href="{% url hr.views.add_message app.id %}">Add Message</a>
{% if hrstaff %} {% if hrstaff %}
<a href="{% url hr.views.add_note app.id %}">Add Staff Note</a>,&nbsp; <a href="{% url hr.views.add_note app.id %}">Add Staff Note</a>
{% if app.status < 2 or app.status = 4 %} {% if app.status < 2 or app.status = 4 %}
<a href="{% url hr.views.reject_application app.id %}">Reject Application</a>,&nbsp; <a href="{% url hr.views.reject_application app.id %}">Reject Application</a>
{% ifequal app.blacklisted 0 %} {% ifequal app.blacklisted 0 %}
<a href="{% url hr.views.accept_application app.id %}">Accept Application</a>,&nbsp; <a href="{% url hr.views.accept_application app.id %}">Accept Application</a>
{% endifequal %} {% endifequal %}
{% ifnotequal app.status 4 %} {% ifnotequal app.status 4 %}
<a href="{% url hr.views.update_application app.id 4 %}">Mark as In Query</a>,&nbsp; <a href="{% url hr.views.update_application app.id 4 %}">Mark as In Query</a>
{% endifnotequal %} {% endifnotequal %}
{% endif %} {% endif %}
{% ifequal app.status 3 %} {% ifequal app.status 3 %}
<a href="{% url hr.views.update_application app.id 5 %}">Mark as Complete</a>,&nbsp; <a href="{% url hr.views.update_application app.id 5 %}">Mark as Complete</a>
{% endifequal %} {% endifequal %}
{% endif %} {% endif %}
{% endifnotequal %} {% endifnotequal %}
</p> </p>
</div>
{% if audit %} {% if audit %}
<h3>Event Log</h3> <h3>Event Log</h3>
@@ -90,7 +92,7 @@
</td> </td>
<td align="right">{{ char.balance|intcomma }} ISK</td> <td align="right">{{ char.balance|intcomma }} ISK</td>
<td align="right">{{ char.total_sp|intcomma }} SP</td> <td align="right">{{ char.total_sp|intcomma }} SP</td>
<td><button type="button" onclick="CCPEVE.showInfo('1377//{{ char.id }}')">Show In Eve</button> / <a href="https://gate.eveonline.com/Profile/{{ char.name }}/">EveGate Profile</a> / <a href="http://eve-search.com/search/author/{{ char.name }}">EveSearch</a></td> <td>{% if request.is_igb %}<a href="javascript:CCPEVE.showInfo(1377, {{ char.id }})">Show In Eve</a> / {% endif %}<a href="https://gate.eveonline.com/Profile/{{ char.name }}/">EveGate Profile</a> / <a href="http://eve-search.com/search/author/{{ char.name }}">EveSearch</a></td>
</tr> </tr>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}