Skip to content

Commit

Permalink
#212 Remove tags
Browse files Browse the repository at this point in the history
  • Loading branch information
tonylampada committed Dec 24, 2013
1 parent 1ac423f commit 3dd64e4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions djangoproject/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ def get_image3x1(self):
return '/static/img2/default_project_logo.png'
return '%s/%s' % (settings.MEDIA_ROOT_URL, self.image3x1)

def get_tags(self):
return [] # TODO

def __unicode__(self):
return self.name

Expand Down
2 changes: 1 addition & 1 deletion djangoproject/sandbox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def project(request):
u'Coloque 200 ml de água em uma panela, adicione o miojo, deixe\n'
u'ferver por 3 minutos. Adicione o tempero e pronto!',
'get_image3x1': '/static/img2/fs_logo.png',
'get_tags': ['tag1', 'tag2']
'get_tags': ['javascript', 'python']
}
_stats = {
'issues_open': 2,
Expand Down
2 changes: 1 addition & 1 deletion djangoproject/statfiles/static/js/tags/taglist.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<a href="" class="tag" ng-repeat="tag in tags" style="margin-right: 10px;">{[{tag}]}</a>
<span href class="tag" ng-repeat="tag in tags" style="margin-right: 10px;">{[{tag}]} <a href ng-click="remove($index)">x</a></span>
<div>
<input type="text" ng-model="newtag" ng-keypress="keypress()">
<div ng-show="poptags">
Expand Down
8 changes: 6 additions & 2 deletions djangoproject/statfiles/static/js/tags/taglist.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ mod.directive('taglist', function() {
restrict: 'E',
replace: true,
scope:{
tags: "=",
type: "@",
objid: "@"
},
templateUrl: '/static/js/tags/taglist.html',
controller: function ($scope, $timeout, SOApi /*, TagApi, SOApi*/) {
$scope.tags = ["java", "python"];
$scope.poptags = [];

var timer = undefined;
Expand All @@ -58,7 +58,11 @@ mod.directive('taglist', function() {
$scope.addTag = function(t){
$scope.tags.push(t.name);
$scope.poptags = [];
}
};

$scope.remove = function(index){
$scope.tags.splice(index, 1);
};
}
}
});
8 changes: 6 additions & 2 deletions djangoproject/templates/core2/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
);

mod.controller("MyCtrl", function($scope){
$scope.tags = [];
//tags {{ project.get_tags }}
});
</script>
{% endblock %}
Expand Down Expand Up @@ -93,11 +95,13 @@ <h3 class="arial green-text">{{ project.name }}</h3>
<!-- Project Description: Please limit to characters -->
<p class="text-align-justify" style="min-height:52px;">{{ project.description|markdown|safe }}</p>
<!-- Tags -->
<div class="tag-list">
<div class="tag-list" ng-show="false"> <!-- SEO -->
{% for tag in project.get_tags %}
<a href="" class="tag">{{ tag }}</a>
{% endfor %}
<taglist type="Project" objid="{[{ project.id }]}"></taglist>
</div>
<div class="tag-list">
<taglist tags="tags" type="Project" objid="{[{ project.id }]}"></taglist>
</div>
</div>
</div>
Expand Down

0 comments on commit 3dd64e4

Please sign in to comment.