Commit a3daba23 authored by Sherif's avatar Sherif

replaced all calls to access student name with my custom methods that can fall...

replaced all calls to access student name with my custom methods that can fall back to the usernameif needed.
parent 8dd5776e
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<div class="row"> <div class="row">
{% for student in building.list %} {% for student in building.list %}
<div class="col-sm-3 text-center"> <div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.user.first_name }} Gravatar picture"> <img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ me.get_available_name }} Gravatar picture">
<h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.user.first_name }} {{ student.user.last_name }}</strong></a></h4> <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.user.first_name }} {{ student.user.last_name }}</strong></a></h4>
{% if student.get_flag_count > 4 %} {% if student.get_flag_count > 4 %}
<p><em>* a number of other floormates say this info is incorrect</em></p> <p><em>* a number of other floormates say this info is incorrect</em></p>
......
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} SRCT Roomlist | {{ student.user.first_name }} {{ student.user.last_name }} {% endblock %} {% block title %} SRCT Roomlist | {{ student.get_full_name }} {% endblock %}
{% block messsage_queue %} {% block messsage_queue %}
{% endblock %} {% endblock %}
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<div class="page-header" id="banner"> <div class="page-header" id="banner">
<div class="row"> <div class="row">
<div class="col-md-8 col-md-offset-2 text-center"> <div class="col-md-8 col-md-offset-2 text-center">
<img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.user.first_name }} Gravatar picture"> <img class="img-circle img-responsive center center-block" src="{{ student.profile_image_url }}" alt="{{ student.get_first_name }} Gravatar picture">
<h1>{{ student.user.first_name }} {{ student.user.last_name }}, {{ student.user.username }}</h1> <h1>{{ student.get_full_name }} , {{ student.user.username }}</h1>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="row"> <div class="row">
<div class="col-md-12 text-center"> <div class="col-md-12 text-center">
<h2><strong>Welcome, {{ request.user.first_name }}!</strong></h2> <h2><strong>Welcome, {{ me.get_first_name }}!</strong></h2>
</div> </div>
</div> </div>
......
{% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist &bull; Homepage {% endblock %} {% block content %} {% extends 'layouts/base.html' %} {% block title %} SRCT Roomlist &bull; Homepage {% endblock %} {% block content %}
{% load cache %} {% load cache %}
{% load gravatar %} {% load gravatar %}
<h2>Welcome Back {{ request.user.first_name }}!</h2> <h2>Welcome Back {{ me.get_first_name }}!</h2>
<legend></legend> <legend></legend>
{% if not me.room %} {% if not me.room %}
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
{% endif %} {% endif %}
<div class="text-center"> <div class="text-center">
<div class="row"> <div class="row">
{% for student in roomies %} {% for student in roomies %}
<div class="col-md-3"> <div class="col-md-3">
<a href="{{ student.get_absolute_url }}"><img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.user.first_name }} Gravatar picture"></img></a> <a href="{{ student.get_absolute_url }}"><img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.get_first_name}} Gravatar picture"></img></a>
<h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.user.get_full_name }}</strong></a></h4> <h4><a href="{{ student.get_absolute_url }}"><strong>{{ student.get_full_name }}</strong></a></h4>
<h5><a href="{{ student.major.get_absolute_url }}"><em>{{ student.major }}</em></a></h5> <h5><a href="{{ student.major.get_absolute_url }}"><em>{{ student.major }}</em></a></h5>
</div> </div>
{% empty %} {% empty %}
...@@ -73,19 +73,20 @@ ...@@ -73,19 +73,20 @@
<legend></legend> <legend></legend>
<div class="text-center"> <div class="text-center">
<div class="row"> <div class="row">
{% for student in majormates %} <!--{//% for student in majormates %}
<div class="col-md-3"> <div class="col-md-3">
<a href="{{ student.get_absolute_url }}"><img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.user.first_name }} Gravatar picture"></a> <a href="{{ student.get_absolute_url }}"><img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.user.first_name }} Gravatar picture"></a>
<h4><a href="{{ student.get_full_name }}"><strong>{{ student.user.get_full_name }}</strong></a></h4> <h4><a href="{{ student.get_full_name }}"><strong>{{ student.user.get_full_name }}</strong></a></h4>
</div> </div>
{% empty %} {//% empty %}
<h4>There are no other students registered in your major right now.</h4> <h4>There are no other students registered in your major right now.</h4>
{% if forloop.counter|divisibleby:4 %} {//% if forloop.counter|divisibleby:4 %}
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
{% endif %} {//% endif %}
{% endfor %} {//% endfor %}
-->
</div> </div>
</div> </div>
{% endcache %} {% endcache %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment