Преглед на файлове

Distinct visited link colours are always a good idea

tags/last-sinatra-version
Adrian Short преди 14 години
родител
ревизия
5fc1480439
променени са 2 файла, в които са добавени 17 реда и са изтрити 9 реда
  1. +9
    -9
      lib/models.rb
  2. +8
    -0
      public/style.css

+ 9
- 9
lib/models.rb Целия файл

@@ -19,12 +19,12 @@ end
class Ward
include DataMapper::Resource
property :id, Serial
property :ons_id, String, :required => true
property :name, String, :required => true
property :constituency_id, Integer, :required => true
property :id, Serial
property :ons_id, String, :required => true
property :name, String, :required => true
property :constituency_id, Integer, :required => true
has n, :councilcandidates, :order => [ 'surname' ]
has n, :councilcandidates, :order => ['surname']
belongs_to :constituency
def self.slugify(name)
@@ -39,8 +39,8 @@ class Party
property :id, Serial
property :name, String, :required => true
has n, :councilcandidates, :order => [ 'surname' ]
has n, :parliamentcandidates, :order => [ 'surname' ]
has n, :councilcandidates, :order => ['surname']
has n, :parliamentcandidates, :order => ['surname']
end

class Councilcandidate
@@ -79,8 +79,8 @@ class Constituency
property :id, Serial
property :name, String, :required => true
has n, :wards, :order => 'name'
has n, :parliamentcandidates, :order => [ 'surname' ]
has n, :wards, :order => ['name']
has n, :parliamentcandidates, :order => ['surname']
end

DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3")

+ 8
- 0
public/style.css Целия файл

@@ -51,6 +51,14 @@ a, a:visited
text-decoration: none;
}

a:visited
{
background-color: #eee;
padding: 1px 4px;
color: #111;
text-decoration: none;
}

a:hover
{
background-color: #4f4f4f;


Зареждане…
Отказ
Запис