-
-
Notifications
You must be signed in to change notification settings - Fork 12
Thumbs #134
base: master
Are you sure you want to change the base?
Thumbs #134
Changes from all commits
e282193
a76eca9
76270d7
157cea8
f0c02fe
8b9caf3
ce60e6f
e05eee6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$('body').on('click', function (e) { | ||
$('.spc-popover').each(function () { | ||
//the 'is' for buttons that triggers popups | ||
//the 'has' for icons within a button that triggers a popup | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a space between |
||
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need the last condition? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And shouldn't it be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The piece of code I referred is http://stackoverflow.com/a/14857326/1162468 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So you copied the code exactly like that. Do you understand what it does? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is looking at where on body onclick event happened and whether it happened on the popover or not. That was the first condition. I didn't understood why .length is used here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't copy things you don't understand. Have a good read of this line, understand what it does, and then add a good comment on why this is written like this. |
||
$(this).popover('hide'); | ||
} | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,7 @@ | |
.pointer { | ||
cursor: pointer; | ||
} | ||
|
||
.block-inline { | ||
display: inline-block; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,20 @@ | |
{% if entry %} | ||
{% load comments %} | ||
|
||
<li class="media"> | ||
<a class="pull-left" href="#"> | ||
<div class="media"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should still be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay |
||
<div class="pull-left" href="#"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<div class="text-center reputation">{{entry.reputation}}</div> | ||
<div class="text-center muted">votes</div> | ||
{% if entry.entry.sub_type == 'snippet' %} | ||
<img src="{{STATIC_URL}}single-file-list-icon-tiny.png"> | ||
<img class="no-lead" src="{{STATIC_URL}}single-file-list-icon-tiny.png"> | ||
{% endif %} | ||
{% if entry.entry.sub_type == 'package' %} | ||
<img src="{{STATIC_URL}}multiple-file-list-icon-tiny.png"> | ||
<img class="no-lead" src="{{STATIC_URL}}multiple-file-list-icon-tiny.png"> | ||
{% endif %} | ||
{% if entry.entry.sub_type == 'link' %} | ||
<img src="{{STATIC_URL}}external-link-list-icon-tiny.png"> | ||
<img class="no-lead" src="{{STATIC_URL}}external-link-list-icon-tiny.png"> | ||
{% endif %} | ||
</a> | ||
</div> | ||
<div class="media-body"> | ||
<h4 class="media-heading"> | ||
<a href="{{entry.get_absolute_url}}">{{ entry.title}}</a> | ||
|
@@ -36,6 +38,6 @@ <h4 class="media-heading"> | |
<li><small>on {{ entry.date_created|date:"d F Y"}}</small></li> | ||
</ul> | ||
</div> | ||
</li> | ||
</div> | ||
<hr> <!--helps to create some space between each submission, draw a line "easily"--> | ||
{% endif %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
# -*- coding: utf-8 -*- | ||
import datetime | ||
from south.db import db | ||
from south.v2 import SchemaMigration | ||
from django.db import models | ||
|
||
|
||
class Migration(SchemaMigration): | ||
|
||
def forwards(self, orm): | ||
# Adding model 'Comment' | ||
db.create_table('django_comments', ( | ||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='content_type_set_for_comment', to=orm['contenttypes.ContentType'])), | ||
('object_pk', self.gf('django.db.models.fields.TextField')()), | ||
('site', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sites.Site'])), | ||
('user', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='comment_comments', null=True, to=orm['auth.User'])), | ||
('user_name', self.gf('django.db.models.fields.CharField')(max_length=50, blank=True)), | ||
('user_email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)), | ||
('user_url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), | ||
('comment', self.gf('django.db.models.fields.TextField')(max_length=3000)), | ||
('submit_date', self.gf('django.db.models.fields.DateTimeField')(default=None)), | ||
('ip_address', self.gf('django.db.models.fields.IPAddressField')(max_length=15, null=True, blank=True)), | ||
('is_public', self.gf('django.db.models.fields.BooleanField')(default=True)), | ||
('is_removed', self.gf('django.db.models.fields.BooleanField')(default=False)), | ||
)) | ||
db.send_create_signal('comments', ['Comment']) | ||
|
||
# Adding model 'CommentFlag' | ||
db.create_table('django_comment_flags', ( | ||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | ||
('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='comment_flags', to=orm['auth.User'])), | ||
('comment', self.gf('django.db.models.fields.related.ForeignKey')(related_name='flags', to=orm['comments.Comment'])), | ||
('flag', self.gf('django.db.models.fields.CharField')(max_length=30, db_index=True)), | ||
('flag_date', self.gf('django.db.models.fields.DateTimeField')(default=None)), | ||
)) | ||
db.send_create_signal('comments', ['CommentFlag']) | ||
|
||
# Adding unique constraint on 'CommentFlag', fields ['user', 'comment', 'flag'] | ||
db.create_unique('django_comment_flags', ['user_id', 'comment_id', 'flag']) | ||
|
||
# Adding model 'SpcComment' | ||
db.create_table('comments_spccomment', ( | ||
('comment_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['comments.Comment'], unique=True, primary_key=True)), | ||
('rest_comment', self.gf('django.db.models.fields.TextField')(max_length=3000, null=True)), | ||
)) | ||
db.send_create_signal('comments', ['SpcComment']) | ||
|
||
|
||
def backwards(self, orm): | ||
# Removing unique constraint on 'CommentFlag', fields ['user', 'comment', 'flag'] | ||
db.delete_unique('django_comment_flags', ['user_id', 'comment_id', 'flag']) | ||
|
||
# Deleting model 'Comment' | ||
db.delete_table('django_comments') | ||
|
||
# Deleting model 'CommentFlag' | ||
db.delete_table('django_comment_flags') | ||
|
||
# Deleting model 'SpcComment' | ||
db.delete_table('comments_spccomment') | ||
|
||
|
||
models = { | ||
'auth.group': { | ||
'Meta': {'object_name': 'Group'}, | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), | ||
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) | ||
}, | ||
'auth.permission': { | ||
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, | ||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
}, | ||
'auth.user': { | ||
'Meta': {'object_name': 'User'}, | ||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), | ||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), | ||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) | ||
}, | ||
'comments.comment': { | ||
'Meta': {'ordering': "('submit_date',)", 'object_name': 'Comment', 'db_table': "'django_comments'"}, | ||
'comment': ('django.db.models.fields.TextField', [], {'max_length': '3000'}), | ||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'content_type_set_for_comment'", 'to': "orm['contenttypes.ContentType']"}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'ip_address': ('django.db.models.fields.IPAddressField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), | ||
'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'is_removed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'object_pk': ('django.db.models.fields.TextField', [], {}), | ||
'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}), | ||
'submit_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None'}), | ||
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'comment_comments'", 'null': 'True', 'to': "orm['auth.User']"}), | ||
'user_email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), | ||
'user_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}), | ||
'user_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) | ||
}, | ||
'comments.commentflag': { | ||
'Meta': {'unique_together': "[('user', 'comment', 'flag')]", 'object_name': 'CommentFlag', 'db_table': "'django_comment_flags'"}, | ||
'comment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'flags'", 'to': "orm['comments.Comment']"}), | ||
'flag': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}), | ||
'flag_date': ('django.db.models.fields.DateTimeField', [], {'default': 'None'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'comment_flags'", 'to': "orm['auth.User']"}) | ||
}, | ||
'comments.spccomment': { | ||
'Meta': {'ordering': "('submit_date',)", 'object_name': 'SpcComment', '_ormbases': ['comments.Comment']}, | ||
'comment_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['comments.Comment']", 'unique': 'True', 'primary_key': 'True'}), | ||
'rest_comment': ('django.db.models.fields.TextField', [], {'max_length': '3000', 'null': 'True'}) | ||
}, | ||
'contenttypes.contenttype': { | ||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, | ||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
}, | ||
'sites.site': { | ||
'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"}, | ||
'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
}, | ||
'thumbs.thumbs': { | ||
'Meta': {'unique_together': "(('person', 'content_type', 'object_pk'),)", 'object_name': 'Thumbs'}, | ||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'content_type_set_for_thumbs'", 'to': "orm['contenttypes.ContentType']"}), | ||
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'ip_address': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}), | ||
'is_valid': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'object_pk': ('django.db.models.fields.TextField', [], {}), | ||
'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), | ||
'submit_date': ('django.db.models.fields.DateField', [], {'auto_now': 'True', 'blank': 'True'}), | ||
'user_agent': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'vote': ('django.db.models.fields.NullBooleanField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) | ||
} | ||
} | ||
|
||
complete_apps = ['comments'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this repeated again? The same for pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the "less" compilation is making this mistake. There seems to be quite a bit duplicate code.
We can create a new PR removing this error and correcting it.
Actually, we can't remove these css files from repo and only depend on less files each time to compile..
The reason is, these css files come under static files.
{{static}}
template tag won't work if we remove.