Changeset - 475b32f4bb94
[Not reviewed]
Merge
0 7 0
Luke Hatcher - 11 years ago 2013-04-30 07:10:11
lukeman@gmail.com
Merge pull request #30 from florapdx/master

change sponsorship/views.py so that admins can add logos/text from dashboard
7 files changed with 39 insertions and 41 deletions:
0 comments (0 inline, 0 general)
symposion/reviews/templatetags/review_tags.py
Show inline comments
...
 
@@ -7,10 +7,2 @@ register = template.Library()
 

	
 

	
 
@register.assignment_tag(takes_context=True)
 
def user_reviews(context):
 
    request = context["request"]
 
    reviews = Review.objects.filter(user=request.user)
 
    return reviews
 

	
 

	
 
@register.assignment_tag(takes_context=True)
symposion/reviews/urls.py
Show inline comments
...
 
@@ -4,3 +4,5 @@ from django.conf.urls.defaults import patterns, url
 
urlpatterns = patterns("symposion.reviews.views",
 
    url(r"^section/(?P<section_slug>[\w\-]+)/$", "review_section", name="review_section"),
 
    url(r"^section/(?P<section_slug>[\w\-]+)/all/$", "review_section", {"reviewed": "all"}, name="review_section"),
 
    url(r"^section/(?P<section_slug>[\w\-]+)/reviewed/$", "review_section", {"reviewed": "reviewed"}, name="user_reviewed"),
 
    url(r"^section/(?P<section_slug>[\w\-]+)/not_reviewed/$", "review_section", {"reviewed": "not_reviewed"}, name="user_not_reviewed"),
 
    url(r"^section/(?P<section_slug>[\w\-]+)/assignments/$", "review_section", {"assigned": True}, name="review_section_assignments"),
symposion/reviews/views.py
Show inline comments
...
 
@@ -64,4 +64,6 @@ def proposals_generator(request, queryset, user_pk=None, check_speaker=True):
 

	
 
# Returns a list of all proposals, proposals reviewed by the user, or the proposals the user has yet to review
 
# depending on the link user clicks in dashboard
 
@login_required
 
def review_section(request, section_slug, assigned=False):
 
def review_section(request, section_slug, assigned=False, reviewed='all'):
 
    
...
 
@@ -76,5 +78,14 @@ def review_section(request, section_slug, assigned=False):
 
        queryset = queryset.filter(id__in=assignments)
 
    
 
    queryset = queryset.select_related("result").select_subclasses()
 
    
 

	
 
# passing reviewed in from reviews.urls and out to review_list for appropriate template header rendering
 
    if reviewed == 'all':
 
        queryset = queryset.select_related("result").select_subclasses()
 
        reviewed = 'all_reviews'
 
    elif reviewed == 'reviewed':
 
        queryset = queryset.filter(reviews__user=request.user)
 
        reviewed = 'user_reviewed'
 
    else:
 
        queryset = queryset.exclude(reviews__user=request.user).exclude(speaker=request.user)
 
        reviewed = 'user_not_reviewed'
 

	
 
    proposals = proposals_generator(request, queryset)
...
 
@@ -84,2 +95,3 @@ def review_section(request, section_slug, assigned=False):
 
        "section": section,
 
        "reviewed": reviewed,
 
    }
...
 
@@ -88,3 +100,2 @@ def review_section(request, section_slug, assigned=False):
 

	
 

	
 
@login_required
symposion/speakers/models.py
Show inline comments
...
 
@@ -28,2 +28,5 @@ class Speaker(models.Model):
 
    )
 

	
 
    class Meta:
 
        ordering = ['name']
 
    
...
 
@@ -34,2 +37,3 @@ class Speaker(models.Model):
 
            return "?"
 

	
 
    
symposion/sponsorship/views.py
Show inline comments
...
 
@@ -37,3 +37,3 @@ def sponsor_add(request):
 
            sponsor.save()
 
            return redirect("dashboard")
 
            return redirect("sponsor_detail", pk=sponsor.pk)
 
    else:
symposion/templates/dashboard.html
Show inline comments
...
 
@@ -133,5 +133,5 @@
 
            </div>
 
            {% user_reviews as user_reviews %}
 
            
 
            <div class="dashboard-panel-content">
 
                <h4>Review Sections</h4>
 
                <h4>Reviews by Section</h4>
 
                
...
 
@@ -139,3 +139,6 @@
 
                    {% for section in review_sections %}
 
                        <li><a href="{% url review_section section.section.slug %}">{{ section }}</a></li>
 
                        <h5>{{ section }}</h5>
 
                            <li><a href="{% url review_section section.section.slug %}">All</a></li>
 
                            <li><a href="{% url user_reviewed section.section.slug %}">Reviewed by you</a></li>
 
                            <li><a href="{% url user_not_reviewed section.section.slug %}">Not Reviewed by you</a></li>
 
                    {% endfor %}
...
 
@@ -143,24 +146,2 @@
 
                
 
                <h4>Proposals you have reviewed</h4>
 
                <table class="table table-condensed">
 
                    <thead>
 
                        <th>#</th>
 
                        <th>Speaker / Title</th>
 
                        <th>Your Vote</th>
 
                    </thead>
 
                    <tbody>
 
                        {% for review in user_reviews %}
 
                            <tr>
 
                                <td>{{ review.proposal.number }}</td>
 
                                <td>
 
                                    <b>{{ review.proposal.speaker }}</b>
 
                                    <br />
 
                                    {{ review.proposal.title }}
 
                                </td>
 
                                <td>{{ review.vote }}</td>
 
                            </tr>
 
                        {% endfor %}
 
                    </tbody>
 
                </table>
 
                
 
                {% comment %}
symposion/templates/reviews/review_list.html
Show inline comments
...
 
@@ -3,3 +3,11 @@
 
{% block body %}
 
    <h3>{{ section }}</h3>
 
	<h3>{{ section }}</h3>
 
	{% if reviewed == 'all_reviews' %}
 
    	<h4>All proposals</h4>
 
    {% elif reviewed == 'user_reviewed' %}
 
    	<h4>Proposals you have reviewed</h4>
 
    {% else %}
 
    	<h4>Proposals you have not yet reviewed</h4>
 
    {% endif %}
 

	
 
    {% include "reviews/_review_table.html" %}
0 comments (0 inline, 0 general)