[MediaWiki-commits] [Gerrit] Made details page license selectable for new images. - change (apps...commons)

2013-10-07 Thread Brion VIBBER (Code Review)
Brion VIBBER has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88165


Change subject: Made details page license selectable for new images.
..

Made details page license selectable for new images.

Change-Id: Ib1061e91647310ee8ba9bfd2ea116b65c8b97560
---
M Commons-iOS.xcodeproj/project.pbxproj
M Commons-iOS/CommonsApp.m
M Commons-iOS/DetailScrollViewController.m
M Commons-iOS/FileUpload.h
M Commons-iOS/FileUpload.m
M Commons-iOS/FileUpload.xcdatamodeld/.xccurrentversion
M Commons-iOS/FileUpload.xcdatamodeld/FileUpload 3.xcdatamodel/contents
A Commons-iOS/FileUpload.xcdatamodeld/FileUpload 4.xcdatamodel/contents
8 files changed, 192 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/commons 
refs/changes/65/88165/1

diff --git a/Commons-iOS.xcodeproj/project.pbxproj 
b/Commons-iOS.xcodeproj/project.pbxproj
index 07c631c..e01e242 100644
--- a/Commons-iOS.xcodeproj/project.pbxproj
+++ b/Commons-iOS.xcodeproj/project.pbxproj
@@ -341,6 +341,7 @@
0417D9E9176E666B00081D8C /* GalleryMultiSelectCollectionVC.m */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = GalleryMultiSelectCollectionVC.m; sourceTree = 
group; };
0417D9EE176EB0081D8C /* GalleryMultiSelectAlbumCell.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = GalleryMultiSelectAlbumCell.h; sourceTree = group; };
0417D9EF176EB00100081D8C /* GalleryMultiSelectAlbumCell.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = GalleryMultiSelectAlbumCell.m; sourceTree = 
group; };
+   0438EF0317FCCB96005F8BF5 /* FileUpload 4.xcdatamodel */ = {isa 
= PBXFileReference; lastKnownFileType = file; path = FileUpload 
4.xcdatamodel; sourceTree = group; };
044A0C3A170F6504003395DD /* GradientButton.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
GradientButton.h; sourceTree = group; };
044A0C3B170F6504003395DD /* GradientButton.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= GradientButton.m; sourceTree = group; };
0451C8601739A2CC00C2D03B /* FetchImageOperation.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
FetchImageOperation.h; sourceTree = group; };
@@ -1997,11 +1998,12 @@
D41B99ED16B1CB2E0045BEB5 /* FileUpload.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
+   0438EF0317FCCB96005F8BF5 /* FileUpload 
4.xcdatamodel */,
D41BFA46173AF10600472EC7 /* FileUpload 
3.xcdatamodel */,
D4C5B4201720BCD700C40532 /* FileUpload 
2.xcdatamodel */,
D41B99EE16B1CB2E0045BEB5 /* 
FileUpload.xcdatamodel */,
);
-   currentVersion = D41BFA46173AF10600472EC7 /* FileUpload 
3.xcdatamodel */;
+   currentVersion = 0438EF0317FCCB96005F8BF5 /* FileUpload 
4.xcdatamodel */;
path = FileUpload.xcdatamodeld;
sourceTree = group;
versionGroupType = wrapper.xcdatamodel;
diff --git a/Commons-iOS/CommonsApp.m b/Commons-iOS/CommonsApp.m
index fb4ac60..907c52d 100644
--- a/Commons-iOS/CommonsApp.m
+++ b/Commons-iOS/CommonsApp.m
@@ -683,6 +683,9 @@
if (_currentUploadOp.isLoggedIn) {

record.progress = @0.0f;
+
+// In case license somehow is not set by now...
+if (record.license == nil) record.license = @cc-by-sa-3.0;

MWPromise *upload = [_currentUploadOp uploadFile:fileName
withFileData:fileData
@@ -763,12 +766,12 @@
 NSString *format = @== {{int:filedesc}} ==\n

@{{Information\n|description=%@\n|source={{own}}\n|author=[[User:%@|%2$@]]\n|date=%@}}\n
@== {{int:license-header}} ==\n
-   @{{self|cc-by-sa-3.0}}\n
+   @{{self|%@}}\n
@\n
@{{Uploaded from Mobile|platform=iOS|version=%@}}\n
@%@;
 NSString *cats = [self formatCategories:record];
-NSString *desc = [NSString stringWithFormat:format, record.desc, 
self.username, [self formatDescriptionDate:record], self.version, cats];
+NSString *desc = [NSString stringWithFormat:format, record.desc, 
self.username, [self formatDescriptionDate:record], record.license, 
self.version, cats];
 return desc;
 }
 
diff --git a/Commons-iOS/DetailScrollViewController.m 
b/Commons-iOS/DetailScrollViewController.m
index 5f0058c..bf9b2a0 100644

[MediaWiki-commits] [Gerrit] Made details page license selectable for new images. - change (apps...commons)

2013-10-07 Thread Brion VIBBER (Code Review)
Brion VIBBER has submitted this change and it was merged.

Change subject: Made details page license selectable for new images.
..


Made details page license selectable for new images.

Change-Id: Ib1061e91647310ee8ba9bfd2ea116b65c8b97560
---
M Commons-iOS.xcodeproj/project.pbxproj
M Commons-iOS/CommonsApp.m
M Commons-iOS/DetailScrollViewController.m
M Commons-iOS/FileUpload.h
M Commons-iOS/FileUpload.m
M Commons-iOS/FileUpload.xcdatamodeld/.xccurrentversion
M Commons-iOS/FileUpload.xcdatamodeld/FileUpload 3.xcdatamodel/contents
A Commons-iOS/FileUpload.xcdatamodeld/FileUpload 4.xcdatamodel/contents
8 files changed, 192 insertions(+), 44 deletions(-)

Approvals:
  Brion VIBBER: Verified; Looks good to me, approved



diff --git a/Commons-iOS.xcodeproj/project.pbxproj 
b/Commons-iOS.xcodeproj/project.pbxproj
index 07c631c..e01e242 100644
--- a/Commons-iOS.xcodeproj/project.pbxproj
+++ b/Commons-iOS.xcodeproj/project.pbxproj
@@ -341,6 +341,7 @@
0417D9E9176E666B00081D8C /* GalleryMultiSelectCollectionVC.m */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = GalleryMultiSelectCollectionVC.m; sourceTree = 
group; };
0417D9EE176EB0081D8C /* GalleryMultiSelectAlbumCell.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = GalleryMultiSelectAlbumCell.h; sourceTree = group; };
0417D9EF176EB00100081D8C /* GalleryMultiSelectAlbumCell.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = GalleryMultiSelectAlbumCell.m; sourceTree = 
group; };
+   0438EF0317FCCB96005F8BF5 /* FileUpload 4.xcdatamodel */ = {isa 
= PBXFileReference; lastKnownFileType = file; path = FileUpload 
4.xcdatamodel; sourceTree = group; };
044A0C3A170F6504003395DD /* GradientButton.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
GradientButton.h; sourceTree = group; };
044A0C3B170F6504003395DD /* GradientButton.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= GradientButton.m; sourceTree = group; };
0451C8601739A2CC00C2D03B /* FetchImageOperation.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
FetchImageOperation.h; sourceTree = group; };
@@ -1997,11 +1998,12 @@
D41B99ED16B1CB2E0045BEB5 /* FileUpload.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
+   0438EF0317FCCB96005F8BF5 /* FileUpload 
4.xcdatamodel */,
D41BFA46173AF10600472EC7 /* FileUpload 
3.xcdatamodel */,
D4C5B4201720BCD700C40532 /* FileUpload 
2.xcdatamodel */,
D41B99EE16B1CB2E0045BEB5 /* 
FileUpload.xcdatamodel */,
);
-   currentVersion = D41BFA46173AF10600472EC7 /* FileUpload 
3.xcdatamodel */;
+   currentVersion = 0438EF0317FCCB96005F8BF5 /* FileUpload 
4.xcdatamodel */;
path = FileUpload.xcdatamodeld;
sourceTree = group;
versionGroupType = wrapper.xcdatamodel;
diff --git a/Commons-iOS/CommonsApp.m b/Commons-iOS/CommonsApp.m
index fb4ac60..907c52d 100644
--- a/Commons-iOS/CommonsApp.m
+++ b/Commons-iOS/CommonsApp.m
@@ -683,6 +683,9 @@
if (_currentUploadOp.isLoggedIn) {

record.progress = @0.0f;
+
+// In case license somehow is not set by now...
+if (record.license == nil) record.license = @cc-by-sa-3.0;

MWPromise *upload = [_currentUploadOp uploadFile:fileName
withFileData:fileData
@@ -763,12 +766,12 @@
 NSString *format = @== {{int:filedesc}} ==\n

@{{Information\n|description=%@\n|source={{own}}\n|author=[[User:%@|%2$@]]\n|date=%@}}\n
@== {{int:license-header}} ==\n
-   @{{self|cc-by-sa-3.0}}\n
+   @{{self|%@}}\n
@\n
@{{Uploaded from Mobile|platform=iOS|version=%@}}\n
@%@;
 NSString *cats = [self formatCategories:record];
-NSString *desc = [NSString stringWithFormat:format, record.desc, 
self.username, [self formatDescriptionDate:record], self.version, cats];
+NSString *desc = [NSString stringWithFormat:format, record.desc, 
self.username, [self formatDescriptionDate:record], record.license, 
self.version, cats];
 return desc;
 }
 
diff --git a/Commons-iOS/DetailScrollViewController.m 
b/Commons-iOS/DetailScrollViewController.m
index 5f0058c..bf9b2a0 100644
--- a/Commons-iOS/DetailScrollViewController.m
+++