aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmybarangay/_colours.scss8
-rw-r--r--web/cobrands/fixmybarangay/base.scss34
-rw-r--r--web/cobrands/fixmybarangay/config.rb25
-rw-r--r--web/cobrands/fixmybarangay/images/ie_front_logo.gifbin0 -> 3473 bytes
-rw-r--r--web/cobrands/fixmybarangay/images/ie_logo.pngbin0 -> 3559 bytes
-rw-r--r--web/cobrands/fixmybarangay/images/sprite.pngbin0 -> 125210 bytes
-rw-r--r--web/cobrands/fixmybarangay/layout.scss42
-rw-r--r--web/cobrands/fixmybarangay/messages.js26
-rw-r--r--web/cobrands/fixmybarangay/test-texts.json17
-rw-r--r--web/cobrands/fixmystreet/_layout.scss6
-rwxr-xr-xweb/fixmystreet_app_cgi.cgi7
-rwxr-xr-xweb/fixmystreet_app_fastcgi.cgi6
-rw-r--r--web/js/map-OpenLayers.js46
13 files changed, 196 insertions, 21 deletions
diff --git a/web/cobrands/fixmybarangay/_colours.scss b/web/cobrands/fixmybarangay/_colours.scss
new file mode 100644
index 000000000..b8229dc59
--- /dev/null
+++ b/web/cobrands/fixmybarangay/_colours.scss
@@ -0,0 +1,8 @@
+/* COLOURS */
+
+$primary: #ffff99;
+$primary_b: #000000;
+$primary_text: #222222;
+
+$contrast1: #00BD08;
+$contrast2: #AA8D11;
diff --git a/web/cobrands/fixmybarangay/base.scss b/web/cobrands/fixmybarangay/base.scss
new file mode 100644
index 000000000..7a33be97e
--- /dev/null
+++ b/web/cobrands/fixmybarangay/base.scss
@@ -0,0 +1,34 @@
+@import "../fixmystreet/_h5bp";
+@import "./_colours";
+@import "../fixmystreet/_mixins";
+@import "compass";
+
+@import "../fixmystreet/_base";
+
+#site-logo{
+ width: 225px !important;
+ background: url('/cobrands/fixmybarangay/images/sprite.png') -3px -3px no-repeat;
+}
+.ie6 #site-logo {
+ background: url('/cobrands/fixmybarangay/images/ie_logo.gif') 0 -5px no-repeat;
+}
+
+body.frontpage {
+ #site-logo{
+ width: 370px !important;
+ }
+}
+
+.ie6 body.frontpage #site-logo {
+ background:url(/cobrands/fixmybarangay/images/ie_front_logo.gif) 0 0 no-repeat;
+}
+
+.yellow-btn,
+a.yellow-btn,
+button.yellow-btn,
+input.yellow-btn{
+ @include button-reset(#FFD000, #cc9000, #aa7000, #300, #FFD000, #cc9000, #aa7000, #300);
+ &:visited, &:hover {
+ color:#300;
+ }
+} \ No newline at end of file
diff --git a/web/cobrands/fixmybarangay/config.rb b/web/cobrands/fixmybarangay/config.rb
new file mode 100644
index 000000000..cab97b18f
--- /dev/null
+++ b/web/cobrands/fixmybarangay/config.rb
@@ -0,0 +1,25 @@
+# Require any additional compass plugins here.
+
+# Set this to the root of your project when deployed:
+http_path = "/"
+css_dir = ""
+sass_dir = ""
+images_dir = ""
+javascripts_dir = ""
+
+# You can select your preferred output style here (can be overridden via the command line):
+# output_style = :expanded or :nested or :compact or :compressed
+
+# To enable relative paths to assets via compass helper functions. Uncomment:
+# relative_assets = true
+
+# To disable debugging comments that display the original location of your selectors. Uncomment:
+# line_comments = false
+
+# If you prefer the indented syntax, you might want to regenerate this
+# project again passing --syntax sass, or you can uncomment this:
+# preferred_syntax = :sass
+# and then run:
+# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
+
+line_comments = false # by Compass.app
diff --git a/web/cobrands/fixmybarangay/images/ie_front_logo.gif b/web/cobrands/fixmybarangay/images/ie_front_logo.gif
new file mode 100644
index 000000000..2eeda87ef
--- /dev/null
+++ b/web/cobrands/fixmybarangay/images/ie_front_logo.gif
Binary files differ
diff --git a/web/cobrands/fixmybarangay/images/ie_logo.png b/web/cobrands/fixmybarangay/images/ie_logo.png
new file mode 100644
index 000000000..df73a7785
--- /dev/null
+++ b/web/cobrands/fixmybarangay/images/ie_logo.png
Binary files differ
diff --git a/web/cobrands/fixmybarangay/images/sprite.png b/web/cobrands/fixmybarangay/images/sprite.png
new file mode 100644
index 000000000..fad72a23a
--- /dev/null
+++ b/web/cobrands/fixmybarangay/images/sprite.png
Binary files differ
diff --git a/web/cobrands/fixmybarangay/layout.scss b/web/cobrands/fixmybarangay/layout.scss
new file mode 100644
index 000000000..63b329337
--- /dev/null
+++ b/web/cobrands/fixmybarangay/layout.scss
@@ -0,0 +1,42 @@
+@import "_colours";
+@import "../fixmystreet/_layout";
+
+body {
+ background: #1A1A1A;
+}
+
+#front-main {
+ color: $primary_text;
+ background: $primary;
+
+ #postcodeForm {
+ margin-left: 0;
+ margin-right: 0;
+ }
+
+}
+
+.nav-wrapper {
+ .nav-wrapper-2 {
+ border-top: solid 4px $primary;
+ @include border-image(none);
+ }
+}
+#main-nav {
+ ul {
+ &#mysoc-menu {
+ background:$primary;
+ }
+ }
+}
+
+#front-howto {
+ #front_stats {
+ border-top: 0.25em solid #000;
+ div {
+ big {
+ color: #000;
+ }
+ }
+ }
+}
diff --git a/web/cobrands/fixmybarangay/messages.js b/web/cobrands/fixmybarangay/messages.js
new file mode 100644
index 000000000..aebf35156
--- /dev/null
+++ b/web/cobrands/fixmybarangay/messages.js
@@ -0,0 +1,26 @@
+$(function(){
+
+ var mm = $('#message_manager');
+
+ $.getJSON('/cobrands/fixmybarangay/test-texts.json', function(data) {
+ var items = [];
+ $.each(data, function(k, v) {
+ var item = $('<input type="radio"/>').attr({
+ 'id': 'mm_text_' + v.id,
+ 'name': 'mm_text',
+ 'value': v.text
+ }).wrap('<p/>').parent().html();
+ var label = $('<label/>', {
+ 'class': 'inline',
+ 'for': 'mm_text_' + v.id
+ }).text(v.text).wrap('<p/>').parent().html();
+ item = '<li><p>' + item + ' ' + label + '</p></li>';
+ items.push(item);
+ });
+ mm.html(items.join(''));
+ mm.find('input').click(function(){
+ $('#form_detail').val( $('input[name=mm_text]:checked').val() );
+ });
+ });
+
+});
diff --git a/web/cobrands/fixmybarangay/test-texts.json b/web/cobrands/fixmybarangay/test-texts.json
new file mode 100644
index 000000000..7acde1e32
--- /dev/null
+++ b/web/cobrands/fixmybarangay/test-texts.json
@@ -0,0 +1,17 @@
+[
+ {
+ "id" : 1,
+ "number" : "032-9999999",
+ "text" : "Pothole on corner of G. De Vera and T. Padilla"
+ },
+ {
+ "id" : 2,
+ "number" : "032-1234567",
+ "text" : "Broken street light on Rahmann Street"
+ },
+ {
+ "id" : 3,
+ "number" : "+63 917 0000000",
+ "text" : "F. Manalo giant pothole"
+ }
+]
diff --git a/web/cobrands/fixmystreet/_layout.scss b/web/cobrands/fixmystreet/_layout.scss
index 2e0ebbca7..b4c108ce9 100644
--- a/web/cobrands/fixmystreet/_layout.scss
+++ b/web/cobrands/fixmystreet/_layout.scss
@@ -752,7 +752,7 @@ textarea.form-error {
.no-js #report-a-problem-sidebar {
position: static;
width: auto;
- @include box-shadow(rgba(0, 0, 0, 0), 0, 0, 0);
+ @include box-shadow(rgba(0, 0, 0, 0) 0 0 0);
.sidebar-tips,
.sidebar-notes {
font-size:1em;
@@ -807,7 +807,7 @@ body.frontpage {
p {
top:-4em;
right:0;
- color:#FFD000;
+ color: $primary;
background:none;
@include box-shadow(rgba(0, 0, 0, 0) 0 0 0);
a {
@@ -1033,7 +1033,7 @@ body.frontpage {
.general-sidebar-notes {
position: static;
width: auto;
- @include box-shadow(rgba(0, 0, 0, 0), 0, 0, 0);
+ @include box-shadow(rgba(0, 0, 0, 0) 0 0 0);
.sidebar-tips,
.sidebar-notes {
font-size:1em;
diff --git a/web/fixmystreet_app_cgi.cgi b/web/fixmystreet_app_cgi.cgi
index 7d60ce673..dd0984e15 100755
--- a/web/fixmystreet_app_cgi.cgi
+++ b/web/fixmystreet_app_cgi.cgi
@@ -1,8 +1,11 @@
#!/usr/bin/env perl
BEGIN { # set all the paths to the perl code
- use FindBin;
- require "$FindBin::Bin/../setenv.pl";
+ use File::Spec;
+ use File::Basename;
+ my $root = dirname(File::Spec->rel2abs(__FILE__));
+
+ require "$root/../setenv.pl";
}
use Catalyst::ScriptRunner;
diff --git a/web/fixmystreet_app_fastcgi.cgi b/web/fixmystreet_app_fastcgi.cgi
index 1059cbd34..08504f8f4 100755
--- a/web/fixmystreet_app_fastcgi.cgi
+++ b/web/fixmystreet_app_fastcgi.cgi
@@ -1,8 +1,10 @@
#!/usr/bin/env perl
BEGIN { # set all the paths to the perl code
- use FindBin;
- require "$FindBin::Bin/../setenv.pl";
+ use File::Spec;
+ use File::Basename;
+ my $root = dirname(File::Spec->rel2abs(__FILE__));
+ require "$root/../setenv.pl";
}
use Catalyst::ScriptRunner;
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 1574754c9..87876a723 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -7,6 +7,32 @@ function fixmystreet_update_pin(lonlat) {
);
document.getElementById('fixmystreet.latitude').value = lonlat.lat || lonlat.y;
document.getElementById('fixmystreet.longitude').value = lonlat.lon || lonlat.x;
+
+ $.getJSON('/report/new/ajax', {
+ latitude: $('#fixmystreet\\.latitude').val(),
+ longitude: $('#fixmystreet\\.longitude').val()
+ }, function(data) {
+ if (data.error) {
+ if (!$('#side-form-error').length) {
+ $('<div id="side-form-error"/>').insertAfter($('#side-form'));
+ }
+ $('#side-form-error').html('<h1>Reporting a problem</h1><p>' + data.error + '</p>').show();
+ $('#side-form').hide();
+ return;
+ }
+ $('#side-form, #site-logo').show();
+ $('#councils_text').html(data.councils_text);
+ $('#form_category_row').html(data.category);
+ if ( data.extra_name_info ) {
+ // there might be a first name field on some cobrands
+ var lb = $('#form_first_name').prev() || $('#form_name').prev();
+ lb.before(data.extra_name_info);
+ }
+ });
+
+ if (!$('#side-form-error').is(':visible')) {
+ $('#side-form, #site-logo').show();
+ }
}
function fixmystreet_activate_drag() {
@@ -419,7 +445,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
fixmystreet.markers.addFeatures( markers );
fixmystreet_activate_drag();
}
- fixmystreet_update_pin(lonlat);
+
// check to see if markers are visible. We click the
// link so that it updates the text in case they go
// back
@@ -427,23 +453,15 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
fixmystreet.state_pins_were_hidden = true;
$('#hide_pins_link').click();
}
+
+ // Store pin location in form fields, and check coverage of point
+ fixmystreet_update_pin(lonlat);
+
+ // Already did this first time map was clicked, so no need to do it again.
if (fixmystreet.page == 'new') {
return;
}
- $.getJSON('/report/new/ajax', {
- latitude: $('#fixmystreet\\.latitude').val(),
- longitude: $('#fixmystreet\\.longitude').val()
- }, function(data) {
- if (data.error) {
- // XXX If they then click back and click somewhere in the area, this error will still show.
- $('#side-form').html('<h1>Reporting a problem</h1><p>' + data.error + '</p>');
- return;
- }
- $('#councils_text').html(data.councils_text);
- $('#form_category_row').html(data.category);
- });
- $('#side-form, #site-logo').show();
fixmystreet.map.updateSize(); // might have done, and otherwise Firefox gets confused.
/* For some reason on IOS5 if you use the jQuery show method it
* doesn't display the JS validation error messages unless you do this