Skip to content

Commit

Permalink
Merge branch 'release/1.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
muloem committed Aug 18, 2015
2 parents 0780b02 + 124c4ec commit 80993d9
Show file tree
Hide file tree
Showing 27 changed files with 1,155 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,14 @@ public static void main(String[] args) throws Exception {
String outFolder = cli.getOptionValue("o");
String flowServices = cli.getOptionValue("fs");
String eventNotification = cli.getOptionValue("en");
String enableChangeEvents = cli.getOptionValue("ce");
if (enableChangeEvents == null) {
enableChangeEvents = "false";
}
String useGoogleMapsLayers = cli.getOptionValue("gm");
if (useGoogleMapsLayers == null) {
useGoogleMapsLayers = "false";
}
String googleMapsRegionBias = cli.getOptionValue("rb");
if (googleMapsRegionBias == null) {
googleMapsRegionBias = "";
}
String enableChangeEvents = cli.getOptionValue("ce", "false");
String mapsProvider = cli.getOptionValue("mapsProvider", "mapbox");
String googleMapsRegionBias = cli.getOptionValue("rb", "");
String cartodbApiKey = cli.getOptionValue("ck", "");
String cartodbSqlApi = cli.getOptionValue("cs", "");
String cartodbHost = cli.getOptionValue("ch", "");
String hereMapsAppId = cli.getOptionValue("hmai", "");
String hereMapsAppCode = cli.getOptionValue("hmac", "");
String alias = cli.getOptionValue("a");
String emailFrom = cli.getOptionValue("ef");
String emailTo = cli.getOptionValue("et");
Expand Down Expand Up @@ -191,6 +187,10 @@ public static void main(String[] args) throws Exception {
new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
data.put("accessKey", accessKeys);

Template t0 = cfg.getTemplate("bucket-policy.ftl");
StringWriter bucketPolicy = new StringWriter();
t0.process(data, bucketPolicy);

Template t1 = cfg.getTemplate("apk-s3-policy.ftl");
StringWriter apkPolicy = new StringWriter();
t1.process(data, apkPolicy);
Expand All @@ -199,6 +199,8 @@ public static void main(String[] args) throws Exception {
StringWriter gaePolicy = new StringWriter();
t2.process(data, gaePolicy);

s3Client.setBucketPolicy(bucketName, t0.toString());

iamClient.putUserPolicy(new PutUserPolicyRequest(apkUser, apkUser,
Policy.fromJson(apkPolicy.toString()).toJson()));

Expand Down Expand Up @@ -232,8 +234,13 @@ public static void main(String[] args) throws Exception {
webData.put("flowServices", flowServices);
webData.put("eventNotification", eventNotification);
webData.put("enableChangeEvents", enableChangeEvents);
webData.put("useGoogleMapsLayers", useGoogleMapsLayers);
webData.put("mapsProvider", mapsProvider);
webData.put("googleMapsRegionBias", googleMapsRegionBias);
webData.put("cartodbApiKey", cartodbApiKey);
webData.put("cartodbSqlApi", cartodbSqlApi);
webData.put("cartodbHost", cartodbHost);
webData.put("hereMapsAppId", hereMapsAppId);
webData.put("hereMapsAppCode", hereMapsAppCode);
webData.put("apiKey", apiKey);
webData.put("emailFrom", emailFrom);
webData.put("emailTo", emailTo);
Expand Down Expand Up @@ -309,18 +316,44 @@ private static Options getOptions() {
enableChangeEvents.setArgs(1);
enableChangeEvents.setRequired(false);

Option useGoogleMapsLayers = new Option("gm",
"true if the instance should use Google Maps layers instead of Mapbox");
useGoogleMapsLayers.setLongOpt("useGoogleMapsLayers");
useGoogleMapsLayers.setArgs(1);
useGoogleMapsLayers.setRequired(false);
Option mapsProvider = new Option("mp",
"The maps provider to use. One of 'mapbox', 'google', 'cartodb'");
mapsProvider.setLongOpt("mapsProvider");
mapsProvider.setArgs(1);
mapsProvider.setRequired(false);

Option googleMapsRegionBias = new Option("rb",
"Region bias code (only available for google maps layers)");
googleMapsRegionBias.setLongOpt("googleMapsRegionBias");
googleMapsRegionBias.setArgs(1);
googleMapsRegionBias.setRequired(false);

Option cartodbApiKey = new Option("ck", "Cartodb api key");
cartodbApiKey.setLongOpt("cartodbApiKey");
cartodbApiKey.setArgs(1);
cartodbApiKey.setRequired(false);

Option cartodbSqlApi = new Option("cs",
"Url endpoint for the cartodb sql api");
cartodbSqlApi.setLongOpt("cartodbSqlApi");
cartodbSqlApi.setArgs(1);
cartodbSqlApi.setRequired(false);

Option cartodbHost = new Option("ch", "Cartodb host");
cartodbHost.setLongOpt("cartodbHost");
cartodbHost.setArgs(1);
cartodbHost.setRequired(false);

Option hereMapsAppId = new Option("hmai", "Here maps app id");
hereMapsAppId.setLongOpt("hereMapsAppId");
hereMapsAppId.setArgs(1);
hereMapsAppId.setRequired(false);

Option hereMapsAppCode = new Option("hmac", "Here maps app code");
hereMapsAppCode.setLongOpt("hereMapsAppCode");
hereMapsAppCode.setArgs(1);
hereMapsAppCode.setRequired(false);

Option outputFolder = new Option("o",
"Output folder for configuration files");
outputFolder.setLongOpt("outFolder");
Expand Down Expand Up @@ -349,8 +382,13 @@ private static Options getOptions() {
options.addOption(flowServices);
options.addOption(eventNotification);
options.addOption(enableChangeEvents);
options.addOption(useGoogleMapsLayers);
options.addOption(mapsProvider);
options.addOption(googleMapsRegionBias);
options.addOption(cartodbApiKey);
options.addOption(cartodbSqlApi);
options.addOption(cartodbHost);
options.addOption(hereMapsAppId);
options.addOption(hereMapsAppCode);
options.addOption(alias);
options.addOption(signingKey);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Version": "2012-10-17",
"Statement": {
"Sid": "Stmt1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::179767337522:user/FlowAdmin"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::${bucketName}",
"arn:aws:s3:::${bucketName}/*",
]
}
}
6 changes: 6 additions & 0 deletions Dashboard/Assetfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ input 'app' do
end
end

match "css/custom-theme/images/*" do
concat do |input|
input.sub(/static\//, '')
end
end

match "css/**/*.css" do
if ENV['RAKEP_MODE'] == 'production'
yui_css
Expand Down
7 changes: 6 additions & 1 deletion Dashboard/AssetfilePublic
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,18 @@ input 'app' do
concat 'js/app.js'
end


match "static/**/*" do
concat do |input|
input.sub(/static\//, '')
end
end

match "css/custom-theme/images/*" do
concat do |input|
input.sub(/static\//, '')
end
end

match "css/**/*.css" do
if ENV['RAKEP_MODE'] == 'production'
yui_css
Expand Down
29 changes: 29 additions & 0 deletions Dashboard/app/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,35 @@ tfoot tr {
}
}

/**************** Inspect Data tab. **************/

#inspectData {
label {
&.surveyInstanceId {
&.tooltip {
a {
color: red;
}
}
}
}
div {
&.noResults {
color: red;
font-size: 1.3em;
text-align: center;
}
}
tr {
td {
&.survey,
&.submitter {
text-align: left;
}
}
}
}

/**************** Assign Survey to devices. **************/

#assignSurveys h2 {
Expand Down
4 changes: 4 additions & 0 deletions Dashboard/app/css/users.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ button, a{
}
}

a {
cursor: pointer;
}

/* Sliding panels
--------------------------------------------- */
section[role=main] {
Expand Down
9 changes: 7 additions & 2 deletions Dashboard/app/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
<![endif]-->
<!-- Stylesheets -->
<link rel="stylesheet" href="css/screen.css" media="screen,projection" />
<script src='//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script>

<link href='//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' />
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,400italic,600italic,300italic|Montserrat:400,700|Raleway|Dancing+Script:400,700" rel="stylesheet" type="text/css">
</head>

Expand Down Expand Up @@ -46,7 +44,14 @@
<script>
loader.require('akvo-flow/main');
</script>

<script>
link_href = (FLOW.Env.mapsProvider === 'cartodb') ? "//cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" : "//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css";
script_src = (FLOW.Env.mapsProvider === 'cartodb') ? "//cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js": "//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js";

document.write("<link rel=\"stylesheet\" href=\""+link_href+"\" />");
document.write("<script type=\"text/javascript\" src=\""+script_src+"\"><\/script>");

var regionBias = FLOW.Env.googleMapsRegionBias;
var region = regionBias ? '&region=' + regionBias : '';
document.write('<script src="//maps.google.com/maps/api/js?v=3.2&sensor=false' + region + '"><\/script>');
Expand Down
Loading

0 comments on commit 80993d9

Please sign in to comment.