Changeset 989

Show
Ignore:
Timestamp:
11/20/08 14:04:37 (7 weeks ago)
Author:
lucy
Message:

actions and state hooked up so that delete just changes state and creates new delete action. objects can still be deleted fo' real, which deletes all actions and the object.
portfolio dimension kinda hierarchical..needs work.
quickrate changes for rating: inputs instead of dropdown.
recent activity and impact menus and stuff fixed up.

Location:
huginmunin/trunk/web/hm
Files:
1 added
1 removed
33 modified

Legend:

Unmodified
Added
Removed
  • huginmunin/trunk/web/hm/app/lib/tags/macros.py

    r969 r989  
    2323        template = split[2] 
    2424    if len(split) < 2 or len(split) > 3: 
    25         raise template.TemplateSyntaxError('%r tag takes one required argument and two optional arguments' % split[0]) 
     25        raise template.TemplateSyntaxError('%r tag takes one required argument and two optional arguments' % split) 
    2626    return RenderModelObject(split[1], template=template) 
    2727 
     
    6363register.tag('render_model_object', do_render_model_object) 
    6464 
     65def do_object_type(parser, token): 
     66    """ 
     67     
     68    """ 
     69    split = token.split_contents() 
     70    if len(split) != 2: 
     71        raise template.TemplateSyntaxError('%r tag takes one required argument' % split) 
     72    return RenderObjectType(split[1]) 
     73 
     74class RenderObjectType(template.Node): 
     75    """ 
     76    return type of object 
     77    """ 
     78    def __init__(self, object_var): 
     79        from django import template as django_template 
     80        self.obj = django_template.Variable(object_var) 
     81     
     82    def render(self, context): 
     83        key = self.obj.var 
     84        value = self.obj.resolve(context) 
     85        return value.__class__.__name__ 
     86 
     87register.tag('object_type', do_object_type) 
    6588 
    6689def do_if_edit_permission(parser, token): 
  • huginmunin/trunk/web/hm/app/media/css/general.css

    r988 r989  
    806806/* width: 100%; background-color: #FFC0C0; margin:0; padding:0;*/ 
    807807 
    808 /****** ADMIN PAGE ******/ 
     808/****** RECENT ACTIVITY AND UESR IMPACT PAGES ******/ 
    809809.horizontal_menu { clear: both; } 
    810 .horizontal_menu_item { text-align: center; cursor: pointer; border: 1px solid black; }  
    811 .horizontal_menu_item { padding: 2px 5px 2px 5px; margin: 2px 4px 2px 4px; float: left; background: #CCF; } 
    812 .horizontal_menu_item a { color: black; text-decoration: none; } 
    813  
     810.horizontal_menu_spacer { height: 10px; clear: both; } 
     811.horizontal_menu_item + .selected { 
     812        border: 1px solid black; 
     813        background: #CCF; 
     814        padding: 0px 5px 0px 5px 
     815        }        
     816.horizontal_menu_item {  
     817        padding: 1px 5px 1px 5px; 
     818        margin: 2px; 
     819        float: left; 
     820        text-align: center; 
     821        } 
     822.horizontal_menu_item + .selected a { color: black; } 
     823.horizontal_menu_item + .not_selectable a, .horizontal_menu_item + .not_selectable { color: #777; } 
     824/*.horizontal_menu_item a { color: #007; }*/ 
     825.impact_object { padding: .2em; background-color: #fffef9; border: medium double rgb(251,250,233);  margin: auto; margin-left: 20px; overflow: auto;} 
     826 
     827/****** PORTFOLIO PAGE **************/ 
     828 
     829.children { margin-left: 30px; } 
     830.child .label { padding: 0px; font-size: 1.2em; } 
     831.child .description { padding: 0px; } 
  • huginmunin/trunk/web/hm/app/media/js/main.js

    r979 r989  
    512512/// 
    513513function input_submit(key, form) { 
    514         var val = form.filter_by_name.value; 
     514        var val = encode(form.filter_by_name.value); 
    515515        get_parameter_submit(key, val); 
    516516} 
  • huginmunin/trunk/web/hm/app/templates/admin/admin.html

    r954 r989  
    1 {% extends "base.html" %} 
     1{% extends "general_extension.html" %} 
    22 
    3 {% block content_middle %} 
     3{% block content_general_center %} 
    44 
    5 <h1>Admin</h1> 
    6  
    7 <h2>Safe operations</h2> 
    8 <UL> 
    9         <LI><A HREF="{% url recent_activity %}">Recent Activity</A></LI> 
    10         <LI><A HREF="{% url calculate_aggregate_ratings %}">Calculate Aggregate Ratings</A></LI> 
    11         <LI><A HREF="{% url check_data_integrity %}">Check Data Integrity</A></LI> 
    12 </UL> 
    13  
    14 <h2>UNSAFE OPERATIONS</h2> 
    15 <UL> 
    16         <LI><A HREF="{% url correct_initial_weights %}">Correct initial user weights, rating weights and weighted_scores</A></LI> 
    17         <LI><A HREF="{% url delete_superfluous_actions %}">Delete ALL superfluous actions because items have been deleted.  ARE YOU SURE??</A></LI> 
    18          
    19 </UL> 
    20  
    21  
    22 <H2>Evolution Corrections</H2> 
    23  
    24 <P>After applying certain evolutions, especially those that add fields, initial 
    25 data may need to be corrected: apply "correct_initial_weights" above.</P> 
     5{% block top_box_title %}{% endblock %} 
     6{% block big_box %}{% endblock %} 
    267 
    278{% endblock %} 
     9 
     10{% block rightmenu %} 
     11<div class="menu_border"> 
     12        <h2 style="display:inline;">Safe</h2> 
     13        <div class="menu_overall"> 
     14                <UL> 
     15                        <LI><A HREF="{% url main_recent_activity %}">Recent activity</A></LI> 
     16                        <LI><A HREF="{% url calculate_aggregate_ratings %}">Calculate ratings</A></LI> 
     17                        <LI><A HREF="{% url check_data_integrity %}">Check data integrity</A></LI> 
     18                </UL> 
     19        </div> 
     20</div> 
     21 
     22<div class="menu_border"> 
     23<h2 style="display:inline;">Dangerous</h2> 
     24        <div class="menu_overall"> 
     25                <UL> 
     26                        <LI><A HREF="{% url correct_initial_weights %}">Correct weights</A></LI> 
     27                        <LI><A HREF="{% url delete_superfluous_actions %}">Delete itemless actions</A></LI> 
     28                         
     29                </UL> 
     30        </div> 
     31</div> 
     32{% endblock %} 
  • huginmunin/trunk/web/hm/app/templates/admin/data_integrity.html

    r982 r989  
    1 {% extends "base.html" %} 
     1{% extends 'admin/admin.html' %} 
    22 
    3 {% block content_middle %} 
     3{% block top_box_title %} 
     4<DIV class="Box_Title"> 
     5        Check Data Integrity 
     6</DIV> 
     7{% endblock %} 
    48 
     9 
     10{% block big_box %} 
    511<ul> 
    6 <li>number of actions: {{ num_actions }}</li> 
     12<li>number of actions: {{ num_all_actions }}</li> 
     13<li>number of create actions: {{ num_create_actions }}</li> 
     14<li>number of delete actions: {{ num_delete_actions }}</li> 
     15<li>number of modified actions: {{ num_modify_actions }}</li> 
     16<li>number of published actions: {{ num_publish_actions }}</li> 
    717<li>number of actionable items: {{ num_actionables }}</li> 
     18<li></li> 
     19<li>all: {{all}}</li> 
     20<li>raw: {{raw}}</li> 
     21<li>deletes: {{deletes}}</li> 
     22<li>filter deletes: {{filter_deletes}}</li> 
     23 
    824</ul> 
    925 
  • huginmunin/trunk/web/hm/app/templates/admin/recent_activity.html

    r954 r989  
    1 {% extends "base.html" %} 
     1{% extends 'admin/admin.html' %} 
    22 
    3 {% block content_middle %} 
     3{% block top_box_title %} 
     4<DIV class="Box_Title"> 
     5        <DIV class="horizontal_menu"> 
     6                <DIV class="horizontal_menu_item">Item:</DIV> 
     7        {% for name, url in menu %} 
     8                <DIV class="horizontal_menu_item {% ifequal name friendly_model %}selected{% endifequal %}"><A HREF="{{ url }}">{{ name }}</A></DIV> 
     9        {% endfor %} 
     10        </DIV> 
     11         
     12        <DIV class="horizontal_menu_spacer"></DIV> 
     13         
     14        <DIV class="horizontal_menu"> 
     15                <DIV class="horizontal_menu_item">Action Type:</DIV> 
     16        {% for name, url in state_menu %} 
     17                <DIV class="horizontal_menu_item {% ifequal action_type name %}selected{% endifequal %}"><A HREF="{{ url }}">{{ name }}</A></DIV> 
     18        {% endfor %} 
     19        </DIV> 
     20</DIV> 
     21{% endblock %} 
    422 
    5 <h1>Recent Activity</h1> 
    623 
    7 {% include 'models/recent_activity.html' %} 
     24{% block big_box %} 
     25        <div style="clear:both;"></div> 
     26        <hr class="divider" /> 
     27 
     28        <DIV id="add_item"> 
     29                {% include 'models/item_add.html' %} 
     30        </DIV> 
     31         
     32        {% load pagination_tags %} 
     33        {% autopaginate objects 10 %} 
     34 
     35        <DIV style="text-align: center;"> 
     36                <hr class="divider" /> 
     37                {% paginate %} 
     38                <hr class="divider" /> 
     39        </DIV> 
     40         
     41        {% for object in objects %} 
     42                <div id="object_{{object.id}}"> 
     43                        {% include template %} 
     44                </div> 
     45                <hr class="divider" /> 
     46        {% endfor %} 
     47         
     48        <DIV style="text-align: center;"> 
     49                {% paginate %} 
     50                <hr class="divider" /> 
     51        </DIV> 
    852 
    953{% endblock %} 
  • huginmunin/trunk/web/hm/app/templates/models/action.html

    r934 r989  
    22<small>{% include 'models/time.html' %}</small> 
    33<a href="{{ object.user.absolute_url }}"><strong>{{ object.user.username }}</strong></a> 
    4         created 
     4        {{ object.label }} 
    55        {% with object.item_model_name as mname %} 
    66        {% with object.item as o %} 
    77         
    8                 <DIV id="{{mname}}_{{o.id}}"> 
     8                <DIV class="impact_object" id="{{mname}}_{{o.id}}"> 
    99                        {% include 'models/action_item.html' %}                  
    1010                </DIV> 
  • huginmunin/trunk/web/hm/app/templates/models/action_item.html

    r969 r989  
    2020                        /> 
    2121                </SMALL> 
    22         {% endif %}              
     22        {% endif %} 
     23         
     24        <strong> 
     25        {% ifequal model 'Action' %} 
     26                {% object_type o %} 
     27        {% else %} 
     28                {{ friendly_model }} 
     29        {% endifequal %} 
     30        </strong> 
     31          
    2332        {% render_model_object o %} 
    2433 
  • huginmunin/trunk/web/hm/app/templates/models/aggregaterating.html

    r934 r989  
    11 
    2         <strong>aggregate rating</strong> {{ object.score }}  
     2        {{ object.score }}  
    33        for <strong><a href="{{ object.item.absolute_url }}">{{ object.item }}</a></strong>  
  • huginmunin/trunk/web/hm/app/templates/models/argument.html

    r934 r989  
    11 
    2 <strong>response</strong> 
    32<a href="{{ object.review.node.absolute_url }}"><strong>{{ object.review.node.label }}</strong></a>: 
    43"{% if object.label %}{{ object.label }}: {% endif %}{{ object.description|safe }}" 
  • huginmunin/trunk/web/hm/app/templates/models/behavior.html

    r934 r989  
    11 
    2 <strong>review</strong> 
    32<a href="{{ object.node.absolute_url }}"><strong>{{ object.node.label }}</strong></a>: 
    4 "{% if object.label %}{{ object.label }}: {% endif %}{{ object.description|safe }}" 
    5  
     3"{% if object.label %}{{ object.label }}: {% endif %} ({{object.dimension}}): {{ object.description|safe }}" 
  • huginmunin/trunk/web/hm/app/templates/models/dimension.html

    r934 r989  
    11 
    2 <strong>interest</strong> <a href="{{ object.absolute_url }}"><strong>{{ object.label }}</strong>({{ object.parent }})</a>: 
     2<a href="{{ object.absolute_url }}"><strong>{{ object.label }}</strong>({{ object.parent }})</a>: 
    33{{ object.description }} 
  • huginmunin/trunk/web/hm/app/templates/models/edge.html

    r954 r989  
    11 
    2 <strong>edge</strong> <a href="{{ r.item.absolute_url }}"><strong>{{ object.label }}</strong> 
     2<a href="{{ r.item.absolute_url }}"><strong>{{ object.label }}</strong> 
    33({% for t in object.typecasts %}{{ t.type.label }}{% endfor %})</a>: 
    44{{ object.src.label }} --> {{ object.dest.label }} ({{ object.cached_weighting }}) 
  • huginmunin/trunk/web/hm/app/templates/models/edgetype.html

    r934 r989  
    11 
    2 <strong>edge type</strong> <strong>{{ object.label }}</strong>: {{ object.description }} 
     2<strong>{{ object.label }}</strong>: {{ object.description }} 
  • huginmunin/trunk/web/hm/app/templates/models/edgetypecast.html

    r934 r989  
    11 
    2 <strong>edge type cast</strong> on <strong><a href="{{ object.absolute_url }}">{{ object.node }}</a></strong> 
     2 on <strong><a href="{{ object.absolute_url }}">{{ object.node }}</a></strong> 
    33as <strong>{{ object.type }}</strong> 
  • huginmunin/trunk/web/hm/app/templates/models/node.html

    r934 r989  
    11 
    2 <strong>node</strong> <a href="{{ object.absolute_url }}"><strong>{{ object.label }}</strong> 
     2<a href="{{ object.absolute_url }}"><strong>{{ object.label }}</strong> 
    33({% for t in object.typecasts %}{{ t.type.label }}{% endfor %})</a>: 
    44"{{ object.description|safe }}"  
  • huginmunin/trunk/web/hm/app/templates/models/nodetype.html

    r934 r989  
    11 
    2 <strong>node type</strong> <strong>{{ object.label }}</strong>: {{ object.description }} 
     2<strong>{{ object.label }}</strong>: {{ object.description }} 
  • huginmunin/trunk/web/hm/app/templates/models/nodetypecast.html

    r934 r989  
    11 
    2 <strong>node type cast</strong> on <strong><a href="{{ object.absolute_url }}">{{ object.node }}</a></strong> 
     2on <strong><a href="{{ object.absolute_url }}">{{ object.node }}</a></strong> 
    33as <strong>{{ object.type }}</strong> 
  • huginmunin/trunk/web/hm/app/templates/models/rating.html

    r934 r989  
    11 
    2         <strong>rating</strong> <a href="{{ object.item.absolute_url }}">{{ object.item }}</a> 
     2<a href="{{ object.item.absolute_url }}">{{ object.item }}</a> 
    33        as {{ object.score }} 
  • huginmunin/trunk/web/hm/app/templates/models/tag.html

    r934 r989  
    1  
    2 <strong>tag</strong> <strong>{{ object.tag }}</strong> 
     1 <strong>{{ object.tag }}</strong> 
  • huginmunin/trunk/web/hm/app/templates/models/tagging.html

    r934 r989  
    11 
    2 <strong>tagging</strong> on <a href="{{ object.item.absolute_url }}">{{ object.item }}</a> 
     2 on <a href="{{ object.item.absolute_url }}">{{ object.item }}</a> 
    33of {{ object.tag.tag }} 
  • huginmunin/trunk/web/hm/app/templates/models/upc.html

    r934 r989  
    11 
    2 <strong>identifier</strong> <strong>{{ object.upc_code }}</strong> 
     2 <strong>{{ object.upc_code }}</strong> 
    33for {{ object.node }} 
  • huginmunin/trunk/web/hm/app/templates/models/userinterestpercent.html

    r934 r989  
    11 
    2 <strong>user interest percent</strong> {{ object.percent }} for {{ object.interest.label }} 
     2{{ object.percent }} for {{ object.interest.label }} 
  • huginmunin/trunk/web/hm/app/templates/quickrate/rate_review.html

    r985 r989  
    1616<div class="rating_choice"> 
    1717        <form method="post" action=""> 
    18                 <table>{{ form }}</table> 
    19                         <input type="submit" /> 
     18                {% for rating in ratings %} 
     19                        <input type="submit" name="rating" value="{{ rating }}" /> 
     20                {% endfor %} 
    2021        </form> 
    2122</div> 
  • huginmunin/trunk/web/hm/app/templates/user/impact.html

    r969 r989  
    99        {% endif %} 
    1010</div> 
     11 
     12<DIV class="Box_Title"> 
     13        <DIV class="horizontal_menu"> 
     14                <DIV class="horizontal_menu_item">Item:</DIV> 
     15        {% for name, url, not_selectable in menu %} 
     16                <DIV class="horizontal_menu_item  
     17                        {% ifequal name friendly_model %}selected{% endifequal %} 
     18                        {% if not_selectable %}not_selectable{% endif %} 
     19                        ">{% if not not_selectable %}<A HREF="{{ url }}">{% endif %}{{ name }}{% if not not_selectable %}</A>{% endif %}</DIV> 
     20        {% endfor %} 
     21        </DIV> 
     22         
     23        <DIV class="horizontal_menu_spacer"></DIV> 
     24         
     25        <DIV class="horizontal_menu"> 
     26                <DIV class="horizontal_menu_item">Action Type:</DIV> 
     27        {% for name, url, option in state_menu %} 
     28                <DIV class="horizontal_menu_item  
     29                        {% ifequal action_type name %}selected{% endifequal %} 
     30                        {% if not_selectable %}not_selectable{% endif %} 
     31                        ">{% if not not_selectable %}<A HREF="{{ url }}">{% endif %}{{ name }}{% if not not_selectable %}</A>{% endif %}</DIV> 
     32        {% endfor %} 
     33        </DIV> 
     34</DIV> 
    1135{% endblock %} 
    1236 
     37 
    1338{% block big_box %} 
    14         <h1>Impact</h1> 
    15         {% include 'models/recent_activity.html' %} 
     39        <div style="clear:both;"></div> 
     40        <hr class="divider" /> 
     41 
     42        <DIV id="add_item"> 
     43                {% include 'models/item_add.html' %} 
     44        </DIV> 
     45         
     46        {% load pagination_tags %} 
     47        {% autopaginate objects 10 %} 
     48 
     49        <DIV style="text-align: center;"> 
     50                <hr class="divider" /> 
     51                {% paginate %} 
     52                <hr class="divider" /> 
     53        </DIV> 
     54         
     55        {% for object in objects %} 
     56                <div id="object_{{object.id}}"> 
     57                        {% include template %} 
     58                </div> 
     59                <hr class="divider" /> 
     60        {% endfor %} 
     61         
     62        <DIV style="text-align: center;"> 
     63                {% paginate %} 
     64                <hr class="divider" /> 
     65        </DIV> 
     66 
    1667{% endblock %} 
  • huginmunin/trunk/web/hm/app/templates/user/portfolio_display.html

    r986 r989  
    1212 
    1313        {% if show_portfolio %} 
    14                  
     14                <script type="text/javascript"> 
     15                $(document).ready(function() { 
     16                        $(".children").hide(); 
     17                        $(".parent").click( function() { 
     18                                $(".parent").next().hide(); 
     19                                $(this).next().toggle(); 
     20                        }).css("cursor","pointer"); 
     21                }); 
     22                </script> 
    1523                {% for w in interests %} 
    16                         <h2>{% if w.active %}{{ w.interest.label }}: {{ w.percent }}% </h2> 
    17                         <h3>{{ w.interest.description }}{% endif %}</h3> 
     24                        {% if not w.interest.parent %} 
     25                                <div class="parent"> 
     26                                        <h2>{% if w.active %}{{ w.interest.label }}: {{ w.percent }}% </h2> 
     27                                        <h3>{{ w.interest.description }}{% endif %}</h3> 
     28                                </div> 
     29                                <div class="children"> 
     30                                {% for x in interests %} 
     31                                        {% ifequal x.interest.parent w.interest %} 
     32                                                <div class="child"> 
     33                                                        <h2 class="label">{% if x.active %}{{ x.interest.label }}: {{ x.percent }}% </h2> 
     34                                                        <h3 class="description">{{ x.interest.description }}{% endif %}</h3> 
     35                                                </div> 
     36                                        {% endifequal %} 
     37                                {% endfor %} 
     38                                </div> 
     39                        {% endif %} 
    1840                {% endfor %} 
    1941                 
    2042        {% else %} 
    21             <h2>This portfolio is not public. View <A HREF=" 
    22                 {% if user.is_authenticated %}{% url portfolio user.id %} 
    23                 {% else %}{% url login %} 
    24                 {% endif %}">your porfolio</A></h2> 
     43            <h2>This portfolio is not public. View <A HREF="{% url portfolio user.id %}">your porfolio</A></h2> 
    2544        {% endif %} 
    2645         
  • huginmunin/tr