Skip to content

Commit

Permalink
Merge pull request #92 from sinag/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
sinag authored Nov 12, 2019
2 parents c4aac22 + 27a00c2 commit 0b44260
Show file tree
Hide file tree
Showing 36 changed files with 1,308 additions and 162 deletions.
37 changes: 18 additions & 19 deletions code/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion code/community/templates/community/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h5 class="card-title">{{ community.name }}</h5>
<div class="card-body">
<h5 class="card-title">There is nothing here</h5>
<p class="card-text">Click plus icon below to create a new community</p>
<a href="#" class="btn btn-primary"><span class="fas fa-plus"></span></a>
<a href="#" class="btn btn-primary"><span class="fas fa-plus"></span> New Community</a>
</div>
<div class="card-footer text-muted">
Just now
Expand Down
18 changes: 18 additions & 0 deletions code/datatype/migrations/0002_auto_20191111_1514.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.1 on 2019-11-11 12:14

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('datatype', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='datatype',
name='generic',
field=models.BooleanField(choices=[(0, 'Custom'), (1, 'Generic')], db_index=True),
),
]
6 changes: 5 additions & 1 deletion code/datatype/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ class DataType(models.Model):
name = models.CharField(max_length=100)
created_on = models.DateTimeField(auto_now_add=True, blank=False, null=False)
description = models.CharField(max_length=500, blank=False, null=False)
generic = models.BooleanField(db_index=True) # False = Custom, True = Generic
generic_choices = [
(0, 'Custom'),
(1, 'Generic'),
]
generic = models.BooleanField(db_index=True, choices=generic_choices) # False = Custom, True = Generic

def __str__(self):
return str(str(self.id) + '-' + self.name)
Expand Down
7 changes: 3 additions & 4 deletions code/datatype/templates/datatype/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="card-body">
<h5 class="card-title">{{ datatype.name }}</h5>
<p class="card-text">{{ datatype.description }}</p>
<a href="#"
<a href="{% url 'property:index' datatype.id %}"
class="btn btn-primary"><span
class="fas fa-search"></span> View Properties</a>
{% if user.is_authenticated %}
Expand All @@ -38,8 +38,7 @@ <h5 class="card-title">{{ datatype.name }}</h5>
<div class="card-footer text-muted">
<div style="display: flex; justify-content: space-around">
<div>{{ datatype.id|field_count }} Fields</div>
<div>{% if datatype.generic == True %}Generic Post Type{% else %}Custom Post
Type{% endif %}</div>
<div>{{ datatype.get_generic_display }} Post Type</div>
<div>0 Posts</div>
</div>
</div>
Expand All @@ -55,7 +54,7 @@ <h5 class="card-title">{{ datatype.name }}</h5>
<div class="card-body">
<h5 class="card-title">There is nothing here</h5>
<p class="card-text">Click plus icon below to create a new datatype</p>
<a href="#" class="btn btn-primary"><span class="fas fa-plus"></span></a>
<a href="#" class="btn btn-primary"><span class="fas fa-plus"></span> New Post Type</a>
</div>
<div class="card-footer text-muted">
Just now
Expand Down
2 changes: 1 addition & 1 deletion code/datatype/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_success_url(self):

def get_queryset(self):
"""
Get community details to delete
Get datatype details to delete
"""
return DataType.objects.filter(id=self.kwargs.get('pk'))

Expand Down
Loading

0 comments on commit 0b44260

Please sign in to comment.