Changeset ae881e5


Ignore:
Timestamp:
May 16, 2010, 11:01:29 PM (16 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, fysm-4-1, space-access, stable, stage, test-hooks
Children:
101bf09
Parents:
aaa8e04
git-author:
Alex Dehnert <adehnert@…> (05/16/10 23:01:29)
git-committer:
Alex Dehnert <adehnert@…> (05/16/10 23:01:29)
Message:

Add navigation on the detail page

Location:
asadb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • asadb/forms/views.py

    raaa8e04 rae881e5  
    7676
    7777def fysm_view(request, year, submission, ):
     78    submit_obj = get_object_or_404(forms.models.FYSM, pk=submission,)
     79    all = forms.models.FYSM.objects.only("id", "display_name", )
     80    try:
     81        prev = all.filter(display_name__lt=submit_obj.display_name).order_by("-display_name")[0]
     82    except IndexError:
     83        prev = None
     84    try:
     85        next = all.filter(display_name__gt=submit_obj.display_name).order_by("display_name")[0]
     86    except IndexError:
     87        next = None
    7888    return list_detail.object_detail(
    7989        request,
     
    8595            "year": year,
    8696            "pagename": "fysm",
     97            "prev": prev,
     98            "next": next,
    8799        },
    88100    )
  • asadb/media/style/style.css

    raaa8e04 rae881e5  
    9090}
    9191
    92 .single-fysm-entry h3 a
     92.single-fysm-entry h3 a, .fysm-navstrip a
    9393{
    9494    color:#fcfcfc;
     
    9696}
    9797
    98 .single-fysm-entry h3 a:hover
     98.single-fysm-entry h3 a:hover, .fysm-navstrip a:hover
    9999{
    100100    text-decoration: underline;
     
    158158}
    159159
    160 .fysm-detail
     160.fysm-detail .back    { float: left;  }
     161.fysm-detail .forward { float: right; }
     162.fysm-detail .up      { text-align: center; }
     163.fysm-detail h3
    161164{
    162     height: 100%;
    163     width: 100%;
     165    text-align: center;
     166    clear: both;
    164167}
    165168
    166 .fysm-detail .single-fysm-entry
     169.fysm-navstrip
    167170{
    168     margin: 0 auto;
     171    clear: both;
     172    margin: 0;
     173    margin-top: 3em;
     174    padding: 0.5em 1em;
     175    background: #BE2933;
    169176}
    170177
    171 .fysm-detail td
     178.fysm-navstrip p
    172179{
    173     padding: 0;
     180    margin: 0;
    174181}
    175 .fysm-join
    176 {
    177     display: block;
    178     width: 100%;
    179     height: 100%;
    180     margin: 0;
    181     padding: 0;
    182 }
     182
    183183
    184184/* Reset some stuff */
  • asadb/template/fysm/fysm_detail.html

    raaa8e04 rae881e5  
    1 {% extends "base-plain.html" %}
     1{% extends "base.html" %}
    22{% load formcats %}
    33
     
    55{% block content %}
    66<div class='fysm-detail'>
     7
     8<div class='fysm-navstrip'>
     9{% if prev %}
     10<p><a class='back'    href='{% url fysm-view year prev.pk %}'>&laquo; {{prev.display_name}}</a></p>
     11{% endif %}
     12{% if next %}
     13<p><a class='forward' href='{% url fysm-view year next.pk %}'>{{next.display_name}} &raquo;</a></p>
     14{% endif %}
     15<p class='up'><a href='{% url fysm year %}'>Up to Index</a></p>
     16<div style='clear: both;'></div>
     17</div>
     18
    719<div class='single-fysm-entry'>
    8     <h3><a href='{{fysm.website}}'>{{fysm.display_name}}</a></h3>
     20    <h3>
     21        <a href='{{fysm.website}}'>{{fysm.display_name}}</a>
     22    </h3>
    923    <div class='fysm-body'>
    1024    <div class='logo'>
     
    2539    {% endif %}
    2640</div>
    27 <iframe src='{{fysm.join_url}}' class='fysm-join' height='100%'>
    28     <p><a href='{{fysm.join_url}}'>Learn about joining {{fysm.display_name}}</a></p>
    29 </iframe>
     41
    3042{% endblock %}
    3143
Note: See TracChangeset for help on using the changeset viewer.