mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Add check for decimalCoords != null
This commit is contained in:
parent
777d52e39b
commit
06a8cc6d49
1 changed files with 9 additions and 5 deletions
|
|
@ -133,8 +133,7 @@ public class Contribution extends Media {
|
|||
public String getPageContents() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
//TODO: Add location template immediately after Information template. {{Location|37.51136|-77.602615}}
|
||||
|
||||
buffer
|
||||
.append("== {{int:filedesc}} ==\n")
|
||||
.append("{{Information\n")
|
||||
|
|
@ -146,9 +145,14 @@ public class Contribution extends Media {
|
|||
.append("|date={{According to EXIF data|").append(isoFormat.format(dateCreated)).append("}}\n");
|
||||
}
|
||||
buffer
|
||||
.append("}}").append("\n")
|
||||
.append("{{Location|").append(decimalCoords).append("}}").append("\n")
|
||||
.append("== {{int:license-header}} ==\n")
|
||||
.append("}}").append("\n");
|
||||
|
||||
//Only add Location template (e.g. {{Location|37.51136|-77.602615}} ) if coords is not null
|
||||
if (decimalCoords != null) {
|
||||
buffer.append("{{Location|").append(decimalCoords).append("}}").append("\n");
|
||||
}
|
||||
|
||||
buffer.append("== {{int:license-header}} ==\n")
|
||||
.append(Utils.licenseTemplateFor(getLicense())).append("\n\n")
|
||||
.append("{{Uploaded from Mobile|platform=Android|version=").append(CommonsApplication.APPLICATION_VERSION).append("}}\n")
|
||||
.append(getTrackingTemplates());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue