Skip to content

Commit

Permalink
The tags interface is a lot prettier now.
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-hughes committed Apr 23, 2011
1 parent ea813d2 commit cf0bfe1
Show file tree
Hide file tree
Showing 29 changed files with 298 additions and 63 deletions.
2 changes: 2 additions & 0 deletions scrumdo-web/apps/projects/story_views.py
Expand Up @@ -224,10 +224,12 @@ def story(request, group_slug, story_id):
read_access_or_403(project,request.user)
form = StoryForm(project, instance=story )

tags = project.tags.all().order_by("name")
return render_to_response("stories/story.html", {
"story": story,
"form": form,
"project": project,
"tags": tags,
"return_type": return_type
}, context_instance=RequestContext(request))

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

30 changes: 9 additions & 21 deletions scrumdo-web/media/css/tagit.css
@@ -1,28 +1,16 @@
/* @override http://localhost:8000/site_media/static/css/tagit.css */

.ui-autocomplete {
background-color: #eee;
position: absolute;
cursor: default;
}
.ui-autocomplete .ui-menu-item {
}
.ui-autocomplete .ui-menu-item a {
display:block;
padding:4px 6px;
text-decoration:none;
line-height:12px;
}
.ui-autocomplete .ui-menu-item a.ui-state-hover,
.ui-autocomplete .ui-menu-item a.ui-state-active {
background-color:#78959D;
color:#fff;
margin:0;
}
.ui-autocomplete-loading {
background: white url(images/ui-anim_basic_16x16.gif) right center no-repeat;
max-height: 200px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
}

li.ui-menu-item {
font-size: 10px;
}
ul.tagit {
padding:1px 5px;
border-style:solid;
Expand Down
3 changes: 3 additions & 0 deletions scrumdo-web/media/js/scrumdo.js
@@ -1,4 +1,7 @@

scrumdo_special_tags = [ {label:"Bug", desc:"Represents a bug report.", value:"Bug"}
];

function setupAutoClose( divID )
{
setTimeout( "$('body').one('click',function() { $(\"" + divID + "\").fadeOut(100); });" , 100);
Expand Down
24 changes: 21 additions & 3 deletions scrumdo-web/media/js/tag-it.js
Expand Up @@ -62,18 +62,36 @@
});

tag_input.autocomplete({
minLength: 0,
source: options.availableTags,
select: function(event,ui){
if (is_new (ui.item.value)) {
create_choice (ui.item.value);
}
// Cleaning the input.
tag_input.val("");

tag_input.val("");
// Preventing the tag input to be update with the chosen value.
return false;
}
});
}).data( "autocomplete" )._renderItem = function( ul, item ) {
if( item.desc )
{
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a><b>" + item.label + "</b><br><i>" + item.desc + "</i></a>" )
.appendTo( ul );
}
else
{
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a><b>" + item.label + "</b></a>" )
.appendTo( ul );
}
};

$(tag_input).focus( function() { tag_input.autocomplete( "search", "" ); });


function serializeTags()
{
Expand Down
2 changes: 1 addition & 1 deletion scrumdo-web/templates/base.html
Expand Up @@ -10,7 +10,7 @@
<link rel="stylesheet" href="{{ STATIC_URL }}css/layout.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/tipTip.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/jquery.confirm.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/redmond/jquery-ui-1.8.6.custom.css" />
<link rel="stylesheet" href="{{STATIC_URL}}css/smoothness/jquery-ui-1.8.12.custom.css" />



Expand Down
10 changes: 9 additions & 1 deletion scrumdo-web/templates/stories/story.html
Expand Up @@ -74,9 +74,17 @@ <h2>Comments {% silk "comments" %}</h2>
</div>

<script type="text/javascript" charset="utf-8">
var project_tags = [
{% for tag in tags %}
{label:"{{tag.name}}",value:"{{tag.name}}"},
{% endfor %}
{label:"", value:""}
];

var all_tags = scrumdo_special_tags.concat( project_tags );

$("#story_details #id_tags2").tagit({
availableTags:["one","two"],
availableTags:all_tags,
input_field:"#facebox #story_details #id_tags"
});

Expand Down
2 changes: 1 addition & 1 deletion scrumdo-web/templates/unauthenticated_homepage.html
Expand Up @@ -11,7 +11,7 @@



<link rel="stylesheet" href="{{STATIC_URL}}css/redmond/jquery-ui-1.8.6.custom.css" />
<link rel="stylesheet" href="{{STATIC_URL}}css/smoothness/jquery-ui-1.8.12.custom.css" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
Expand Down

0 comments on commit cf0bfe1

Please sign in to comment.