Changeset 989
- Timestamp:
- 11/20/08 14:04:37 (7 weeks ago)
- Location:
- huginmunin/trunk/web/hm
- Files:
-
- 1 added
- 1 removed
- 33 modified
-
app/lib/tags/macros.py (modified) (2 diffs)
-
app/media/css/general.css (modified) (1 diff)
-
app/media/js/main.js (modified) (1 diff)
-
app/templates/admin/admin.html (modified) (1 diff)
-
app/templates/admin/data_integrity.html (modified) (1 diff)
-
app/templates/admin/recent_activity.html (modified) (1 diff)
-
app/templates/models/action.html (modified) (1 diff)
-
app/templates/models/action_item.html (modified) (1 diff)
-
app/templates/models/aggregaterating.html (modified) (1 diff)
-
app/templates/models/argument.html (modified) (1 diff)
-
app/templates/models/behavior.html (modified) (1 diff)
-
app/templates/models/dimension.html (modified) (1 diff)
-
app/templates/models/edge.html (modified) (1 diff)
-
app/templates/models/edgetype.html (modified) (1 diff)
-
app/templates/models/edgetypecast.html (modified) (1 diff)
-
app/templates/models/node.html (modified) (1 diff)
-
app/templates/models/nodetype.html (modified) (1 diff)
-
app/templates/models/nodetypecast.html (modified) (1 diff)
-
app/templates/models/rating.html (modified) (1 diff)
-
app/templates/models/recent_activity.html (deleted)
-
app/templates/models/tag.html (modified) (1 diff)
-
app/templates/models/tagging.html (modified) (1 diff)
-
app/templates/models/upc.html (modified) (1 diff)
-
app/templates/models/userinterestpercent.html (modified) (1 diff)
-
app/templates/quickrate/rate_review.html (modified) (1 diff)
-
app/templates/quickrate/winner.html (added)
-
app/templates/user/impact.html (modified) (1 diff)
-
app/templates/user/portfolio_display.html (modified) (1 diff)
-
app/views/main.py (modified) (10 diffs)
-
app/views/main_urls.py (modified) (2 diffs)
-
app/views/quickrate_main.py (modified) (1 diff)
-
db/evolutions/__init__.py (modified) (1 diff)
-
db/log.py (modified) (6 diffs)
-
db/models.py (modified) (1 diff)
-
db/state.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
huginmunin/trunk/web/hm/app/lib/tags/macros.py
r969 r989 23 23 template = split[2] 24 24 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) 26 26 return RenderModelObject(split[1], template=template) 27 27 … … 63 63 register.tag('render_model_object', do_render_model_object) 64 64 65 def 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 74 class 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 87 register.tag('object_type', do_object_type) 65 88 66 89 def do_if_edit_permission(parser, token): -
huginmunin/trunk/web/hm/app/media/css/general.css
r988 r989 806 806 /* width: 100%; background-color: #FFC0C0; margin:0; padding:0;*/ 807 807 808 /****** ADMIN PAGE******/808 /****** RECENT ACTIVITY AND UESR IMPACT PAGES ******/ 809 809 .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 512 512 /// 513 513 function input_submit(key, form) { 514 var val = form.filter_by_name.value;514 var val = encode(form.filter_by_name.value); 515 515 get_parameter_submit(key, val); 516 516 } -
huginmunin/trunk/web/hm/app/templates/admin/admin.html
r954 r989 1 {% extends " base.html" %}1 {% extends "general_extension.html" %} 2 2 3 {% block content_ middle%}3 {% block content_general_center %} 4 4 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 %} 26 7 27 8 {% 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' %} 2 2 3 {% block content_middle %} 3 {% block top_box_title %} 4 <DIV class="Box_Title"> 5 Check Data Integrity 6 </DIV> 7 {% endblock %} 4 8 9 10 {% block big_box %} 5 11 <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> 7 17 <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 8 24 </ul> 9 25 -
huginmunin/trunk/web/hm/app/templates/admin/recent_activity.html
r954 r989 1 {% extends "base.html"%}1 {% extends 'admin/admin.html' %} 2 2 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 %} 4 22 5 <h1>Recent Activity</h1>6 23 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> 8 52 9 53 {% endblock %} -
huginmunin/trunk/web/hm/app/templates/models/action.html
r934 r989 2 2 <small>{% include 'models/time.html' %}</small> 3 3 <a href="{{ object.user.absolute_url }}"><strong>{{ object.user.username }}</strong></a> 4 created4 {{ object.label }} 5 5 {% with object.item_model_name as mname %} 6 6 {% with object.item as o %} 7 7 8 <DIV id="{{mname}}_{{o.id}}">8 <DIV class="impact_object" id="{{mname}}_{{o.id}}"> 9 9 {% include 'models/action_item.html' %} 10 10 </DIV> -
huginmunin/trunk/web/hm/app/templates/models/action_item.html
r969 r989 20 20 /> 21 21 </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 23 32 {% render_model_object o %} 24 33 -
huginmunin/trunk/web/hm/app/templates/models/aggregaterating.html
r934 r989 1 1 2 <strong>aggregate rating</strong>{{ object.score }}2 {{ object.score }} 3 3 for <strong><a href="{{ object.item.absolute_url }}">{{ object.item }}</a></strong> -
huginmunin/trunk/web/hm/app/templates/models/argument.html
r934 r989 1 1 2 <strong>response</strong>3 2 <a href="{{ object.review.node.absolute_url }}"><strong>{{ object.review.node.label }}</strong></a>: 4 3 "{% if object.label %}{{ object.label }}: {% endif %}{{ object.description|safe }}" -
huginmunin/trunk/web/hm/app/templates/models/behavior.html
r934 r989 1 1 2 <strong>review</strong>3 2 <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 1 1 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>: 3 3 {{ object.description }} -
huginmunin/trunk/web/hm/app/templates/models/edge.html
r954 r989 1 1 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> 3 3 ({% for t in object.typecasts %}{{ t.type.label }}{% endfor %})</a>: 4 4 {{ object.src.label }} --> {{ object.dest.label }} ({{ object.cached_weighting }}) -
huginmunin/trunk/web/hm/app/templates/models/edgetype.html
r934 r989 1 1 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 1 1 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> 3 3 as <strong>{{ object.type }}</strong> -
huginmunin/trunk/web/hm/app/templates/models/node.html
r934 r989 1 1 2 < strong>node</strong> <a href="{{ object.absolute_url }}"><strong>{{ object.label }}</strong>2 <a href="{{ object.absolute_url }}"><strong>{{ object.label }}</strong> 3 3 ({% for t in object.typecasts %}{{ t.type.label }}{% endfor %})</a>: 4 4 "{{ object.description|safe }}" -
huginmunin/trunk/web/hm/app/templates/models/nodetype.html
r934 r989 1 1 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 1 1 2 <strong>node 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> 3 3 as <strong>{{ object.type }}</strong> -
huginmunin/trunk/web/hm/app/templates/models/rating.html
r934 r989 1 1 2 <strong>rating</strong><a href="{{ object.item.absolute_url }}">{{ object.item }}</a>2 <a href="{{ object.item.absolute_url }}">{{ object.item }}</a> 3 3 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 1 1 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> 3 3 of {{ object.tag.tag }} -
huginmunin/trunk/web/hm/app/templates/models/upc.html
r934 r989 1 1 2 <strong>identifier</strong><strong>{{ object.upc_code }}</strong>2 <strong>{{ object.upc_code }}</strong> 3 3 for {{ object.node }} -
huginmunin/trunk/web/hm/app/templates/models/userinterestpercent.html
r934 r989 1 1 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 16 16 <div class="rating_choice"> 17 17 <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 %} 20 21 </form> 21 22 </div> -
huginmunin/trunk/web/hm/app/templates/user/impact.html
r969 r989 9 9 {% endif %} 10 10 </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> 11 35 {% endblock %} 12 36 37 13 38 {% 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 16 67 {% endblock %} -
huginmunin/trunk/web/hm/app/templates/user/portfolio_display.html
r986 r989 12 12 13 13 {% 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> 15 23 {% 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 %} 18 40 {% endfor %} 19 41 20 42 {% 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> 25 44 {% endif %} 26 45 -
huginmunin/tr