blob: c40ea5eb79130926224eef2a9033c5dc57537813 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
package FixMyStreet::Cobrand::EmptyHomes;
use base 'FixMyStreet::Cobrand::Default';
use strict;
use warnings;
use FixMyStreet;
use mySociety::Locale;
use Carp;
=item
Return the base url for this cobranded site
=cut
sub base_url {
my $base_url = FixMyStreet->config('BASE_URL');
if ( $base_url !~ /emptyhomes/ ) {
$base_url =~ s/http:\/\//http:\/\/emptyhomes\./g;
}
return $base_url;
}
sub admin_base_url {
return 'https://secure.mysociety.org/admin/emptyhomes/';
}
sub area_types {
return qw(DIS LBO MTD UTA LGD COI); # No CTY
}
sub base_url_with_lang {
my $self = shift;
my $email = shift;
my $base = $self->base_url;
if ($email) {
$base = $self->base_url_for_emails;
}
my $lang = $mySociety::Locale::lang;
if ($lang eq 'cy') {
$base =~ s{http://}{$&cy.};
} else {
$base =~ s{http://}{$&en.};
}
return $base;
}
=item set_lang_and_domain LANG UNICODE
Set the language and text domain for the site based on the query and host.
=cut
sub set_lang_and_domain {
my ( $self, $lang, $unicode, $dir ) = @_;
my $set_lang = mySociety::Locale::negotiate_language(
'en-gb,English,en_GB|cy,Cymraeg,cy_GB', $lang );
mySociety::Locale::gettext_domain( 'FixMyStreet-EmptyHomes', $unicode,
$dir );
mySociety::Locale::change();
return $set_lang;
}
=item site_title
Return the title to be used in page heads
=cut
sub site_title {
my ($self) = @_;
return _('Report Empty Homes');
}
=item feed_xsl
Return the XSL file path to be used for feeds'
=cut
sub feed_xsl {
my ($self) = @_;
return '/xsl.eha.xsl';
}
=item shorten_recency_if_new_greater_than_fixed
For empty homes we don't want to shorten the recency
=cut
sub shorten_recency_if_new_greater_than_fixed {
return 0;
}
=head2 generate_problem_banner
my $banner = $c->cobrand->generate_problem_banner;
<p id="[% banner.id %]:>[% banner.text %]</p>
Generate id and text for banner that appears at top of problem page.
=cut
sub generate_problem_banner {
my ( $self, $problem ) = @_;
my $banner = {};
if ($problem->state eq 'fixed') {
$banner->{id} = 'fixed';
$banner->{text} = _('This problem has been fixed') . '.';
}
return $banner;
}
=head2 default_photo_resize
Size that photos are to be resized to for display. If photos aren't
to be resized then return 0;
=cut
sub default_photo_resize { return '195x'; }
1;
|