diff --git a/closedverse_main/admin.py b/closedverse_main/admin.py index 2008a50..0d8144b 100644 --- a/closedverse_main/admin.py +++ b/closedverse_main/admin.py @@ -87,7 +87,7 @@ class CommentAdmin(admin.ModelAdmin): class CommunityAdmin(admin.ModelAdmin): raw_id_fields = ('creator', ) - list_display = ('id', 'name', 'description', 'type', 'creator', 'is_rm', 'is_feature', 'require_auth') + list_display = ('id', 'name', 'description', 'type', 'creator', 'popularity', 'is_rm', 'is_feature', 'require_auth') search_fields = ('id', 'unique_id', 'name', 'description', ) actions = [Hide_content, Show_content, Feature_community, Unfeature_community, force_login, unforce_login] def get_queryset(self, request): diff --git a/closedverse_main/models.py b/closedverse_main/models.py index 7016146..a645fa6 100644 --- a/closedverse_main/models.py +++ b/closedverse_main/models.py @@ -143,6 +143,7 @@ class User(models.Model): user_agent = models.TextField(null=True, blank=True) # C Tokens are things that let you make communities and shit. c_tokens = models.IntegerField(default=1) + protect_data = models.BooleanField(default=False) # Things that don't have to do with auth lol hide_online = models.BooleanField(default=False) @@ -639,7 +640,11 @@ class Community(models.Model): objects = PostManager() real = models.Manager() def popularity(self): - popularity = Post.objects.filter(community=self).count() + if self.creator: + # don't count posts from the community owner. + popularity = Post.objects.filter(community=self).exclude(creator=self.creator).count() + else: + popularity = Post.objects.filter(community=self).count() return popularity def __str__(self): return self.name diff --git a/closedverse_main/templates/closedverse_main/community_list.html b/closedverse_main/templates/closedverse_main/community_list.html index ea0471b..04a7353 100644 --- a/closedverse_main/templates/closedverse_main/community_list.html +++ b/closedverse_main/templates/closedverse_main/community_list.html @@ -74,11 +74,11 @@ {% if feature %} {% community_page_element feature "Featured Communities" True %} {% endif %} - {% community_page_element general "General Communities" %} - {% community_page_element game "Game Communities" %} - {% community_page_element special "Special Communities" %} - {% community_page_element user_communities "Popular User-Created communities" %} - {% if my_communities %}{% community_page_element my_communities "My communities" %}{% endif %} + {% if general %}{% community_page_element general "General Communities" %}{% endif %} + {% if game %}{% community_page_element game "Game Communities" %}{% endif %} + {% if special %}{% community_page_element special "Special Communities" %}{% endif %} + {% if user_communities %}{% community_page_element user_communities "Popular User-Created Communities" %}{% endif %} + {% if my_communities %}{% community_page_element my_communities "My Communities" %}{% endif %} Show more