Changeset 976
- Timestamp:
- 11/07/08 19:00:00 (2 months ago)
- Location:
- huginmunin/trunk/web/hm/app
- Files:
-
- 7 modified
-
media/css/general.css (modified) (1 diff)
-
media/js/main.js (modified) (4 diffs)
-
templates/base.html (modified) (1 diff)
-
templates/browse_extension.html (modified) (1 diff)
-
templates/forms/object_form.html (modified) (1 diff)
-
templates/graph/list.html (modified) (2 diffs)
-
views/main.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
huginmunin/trunk/web/hm/app/media/css/general.css
r971 r976 717 717 718 718 /****** BROWSE REVIEWS ******/ 719 #add_node { text-align: center; } 719 #add_node input { float: right; } 720 #add_node { margin-bottom: 10px; } 721 #add_node table th label { float: right; padding-right: 1em; } 722 #add_node table td input { float: left; } 723 #add_node .ajax_button { text-align: right; } 720 724 721 725 #list_of_nodes .node { -
huginmunin/trunk/web/hm/app/media/js/main.js
r973 r976 447 447 function (responseText, textStatus, XMLHttpRequest) { 448 448 textarea_to_rte(container); 449 if (container.indexOf('add_node') > -1) { 450 location.href = remove_get_parameter('add_node', location.href) 451 } 449 452 } 450 453 ); … … 458 461 /// 459 462 function cancel_form(cancel_url, container, template) { 460 $("#"+container).load( 461 cancel_url+'?container='+container+'&template='+template 462 ); 463 if (container.indexOf('add_node') > -1) { 464 location.href = remove_get_parameter('add_node', location.href) 465 } else { 466 $("#"+container).load( 467 cancel_url+'?container='+container+'&template='+template 468 ); 469 } 463 470 } 464 471 … … 497 504 function dropdown_submit(key, select) { 498 505 var val = (select.options[select.selectedIndex].value); 499 get_param ter_submit(key, val);506 get_parameter_submit(key, val); 500 507 } 501 508 /// 502 509 /// Adjust GET parameters based on key and value and submit. 503 510 /// 504 function get_param ter_submit(key, val) {511 function get_parameter_submit(key, val) { 505 512 if (val) { 506 513 new_location = location.href; … … 522 529 /// 523 530 function remove_get_parameter(key, loc) { 531 if (!loc) { loc = location.href; } 524 532 two_parts = loc.split("?"); 525 533 // two_parts = /Main/foo, key=val&k2=v2 -
huginmunin/trunk/web/hm/app/templates/base.html
r969 r976 90 90 <script type="text/javascript"> 91 91 $(document).ready(function() { 92 $(".expanding_area, .contract_button").hide(); 92 {% if show_controls %} 93 $(".expand_button").hide(); 94 {% else %} 95 $(".expanding_area, .contract_button").hide(); 96 {% endif %} 97 {% if show_add_node %} 98 $("#add_node input").click(); 99 {% endif %} 100 93 101 $(".expand_button, .contract_button").css("cursor", "pointer"); 94 102 <!-- This script shows the area when "expand_button" is clicked--> -
huginmunin/trunk/web/hm/app/templates/browse_extension.html
r963 r976 24 24 <div class="menu_overall"> 25 25 <ul> 26 <li> <a href="{% url coming_soon %}">Browse List</A> <span class="coming_soon">(coming soon)</span></li>26 <li> <a href="{% url browse %}">Browse List</A></li> 27 27 <li> <a href="{% url coming_soon %}">Keyword Search</A> <span class="coming_soon">(coming soon)</span></li> 28 28 <li> <a href="{% url coming_soon %}">My Recently Viewed</A> <span class="coming_soon">(coming soon)</span></li> 29 <li> <a href="{% url coming_soon %}">Add Listing</A> <span class="coming_soon">(coming soon)</span></li>29 <li> <a href="{% url browse %}?add_node=yes">Add Listing</A></li> 30 30 <li> <a href="{% url coming_soon %}">Notepad</A> <span class="coming_soon">(coming soon)</span></li> 31 31 </ul> -
huginmunin/trunk/web/hm/app/templates/forms/object_form.html
r934 r976 3 3 <TABLE> 4 4 {{ form }} 5 <INPUT6 TYPE="button"7 onClick="replace_form('{{ action_url }}', '{{ container }}', '{{ template }}' );"8 VALUE="Save"9 class="ajax_button save"10 />11 <INPUT12 TYPE="button"13 onClick="cancel_form('{{ cancel_url }}', '{{ container }}', '{{ template }}');"14 VALUE="Cancel"15 class="ajax_button cancel"16 />17 5 </TABLE> 6 <INPUT 7 TYPE="button" 8 onClick="replace_form('{{ action_url }}', '{{ container }}', '{{ template }}' );" 9 VALUE="Save" 10 class="ajax_button save" 11 /> 12 <INPUT 13 TYPE="button" 14 onClick="cancel_form('{{ cancel_url }}', '{{ container }}', '{{ template }}');" 15 VALUE="Cancel" 16 class="ajax_button cancel" 17 /> 18 18 </FORM> -
huginmunin/trunk/web/hm/app/templates/graph/list.html
r969 r976 15 15 </div> 16 16 <div class="expanding_area"><br> 17 <DIV id="add_node" class="control_item float_right">17 <DIV id="add_node" class="control_item"> 18 18 {% if user.is_authenticated %} 19 19 {% include 'graph/node_add.html' %} … … 55 55 View by name: 56 56 {% for letter in letters %} 57 <SPAN class="letter {% ifequal selected_letter letter %}selected{% endifequal %}" onClick="get_param ter_submit('filter_by_letter', '{{ letter }}');">{{ letter }}</SPAN>57 <SPAN class="letter {% ifequal selected_letter letter %}selected{% endifequal %}" onClick="get_parameter_submit('filter_by_letter', '{{ letter }}');">{{ letter }}</SPAN> 58 58 {% endfor %} 59 59 <SPAN class="letter {% ifequal selected_letter "none" %}selected {% endifequal %}" onClick="location.href = remove_get_parameter('filter_by_letter');">(View All)</SPAN> -
huginmunin/trunk/web/hm/app/views/main.py
r975 r976 325 325 #TagsJSON = JSON_API([['id','tag','count']]) 326 326 327 def pluralize(word): 328 if word[-1] == 'y': 329 return "%sies" % word[:-1] 330 else: 331 return "%ss" % word 327 332 328 333 def graph_centric(request): 329 334 params = run_params(request.GET) 330 335 nodes = Node.find().select_related().order_by('label') 331 332 336 order = 'alphabetical' 333 337 … … 339 343 selected_type = int(filter_by_type) 340 344 selected_type_label = (NodeType.get(selected_type)).label 341 viewed_items_title.append( "%ss" % selected_type_label)345 viewed_items_title.append(pluralize(selected_type_label)) 342 346 nodes = nodes.filter(nodetypecast__type__id__in=filter_by_type) 343 347 … … 368 372 viewed_items_title = "View All" 369 373 else: 374 show_controls = True 370 375 viewed_items_title = "View " + ' '.join(viewed_items_title) 376 377 if 'add_node' in params: 378 show_controls = True 379 show_add_node = True 371 380 372 381 types = NodeType.objects.all().order_by('label')