Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
fix some problems with okhelptexts - make the keyword unique + fix di…
Browse files Browse the repository at this point in the history
…splay of question mark in bill page
  • Loading branch information
OriHoch committed Jun 27, 2016
1 parent e2a5d2e commit f66f7d1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
35 changes: 35 additions & 0 deletions okhelptexts/migrations/0003_auto__add_unique_keyword_kw_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

def forwards(self, orm):
# Adding unique constraint on 'Keyword', fields ['kw_text']
db.create_unique(u'okhelptexts_keyword', ['kw_text'])


def backwards(self, orm):
# Removing unique constraint on 'Keyword', fields ['kw_text']
db.delete_unique(u'okhelptexts_keyword', ['kw_text'])


models = {
u'okhelptexts.helptext': {
'Meta': {'object_name': 'Helptext'},
'fulltext': ('django.db.models.fields.TextField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'moreinfo': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'})
},
u'okhelptexts.keyword': {
'Meta': {'object_name': 'Keyword'},
'helptext': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['okhelptexts.Helptext']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'kw_text': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'})
}
}

complete_apps = ['okhelptexts']
2 changes: 1 addition & 1 deletion okhelptexts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __unicode__(self):

class Keyword(models.Model):
helptext = models.ForeignKey(Helptext)
kw_text = models.CharField(max_length=200)
kw_text = models.CharField(max_length=200, unique=True)

def __unicode__(self):
return self.kw_text
6 changes: 3 additions & 3 deletions templates/laws/bill_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@
if (typeof pre_vote_score != 'undefined') {
$("#pre-vote").css('background', pre_vote_score>0?"#39b44a":"#A60600");
$("#pre-vote").css('color', "white");
$("#pre-vote a").css('color', "white");
$("#pre-vote a.item").css('color', "white");
}
if (typeof first_vote_score != 'undefined') {
$("#first-vote").css('background', first_vote_score>0?"#39b44a":"#A60600");
$("#first-vote").css('color', "white");
$("#first-vote a").css('color', "white");
$("#first-vote a.item").css('color', "white");
}
if (typeof third_vote_score != 'undefined') {
$("#third-vote").css('background', third_vote_score>0?"#39b44a":"#A60600");
$("#third-vote").css('color', "white");
$("#third-vote a").css('color', "white");
$("#third-vote a.item").css('color', "white");
}
});

Expand Down

0 comments on commit f66f7d1

Please sign in to comment.