marinofaggiana 5 yıl önce
ebeveyn
işleme
3c6b058303

+ 11 - 3
iOSClient/Main/CCMain.m

@@ -3881,9 +3881,17 @@
     } else {
     
         tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.activeAccount, self.serverUrl]];
-        [self.viewRichWorkspace setRichWorkspaceText:directory.richWorkspace];
-        [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, CCUtility.getRichWorkspaceHeight)];
-        [self.tableView setTableHeaderView:self.viewRichWorkspace];
+        
+        if (directory.richWorkspace.length == 0) {
+            
+            [self.tableView setTableHeaderView:nil];
+            
+        } else {
+            
+            [self.viewRichWorkspace setRichWorkspaceText:directory.richWorkspace];
+            [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, CCUtility.getRichWorkspaceHeight)];
+            [self.tableView setTableHeaderView:self.viewRichWorkspace];
+        }
     }
     
     [self.tableView reloadData];

+ 1 - 8
iOSClient/Main/NCRichWorkspace.swift

@@ -11,7 +11,6 @@ import Foundation
 @objc class NCViewRichWorkspace: UIView {
     
     @IBOutlet weak var webView: WKWebView!
-    var richWorkspace: String?
 
     required init?(coder: NSCoder) {
         super.init(coder: coder)
@@ -26,14 +25,8 @@ import Foundation
     
     @objc func setRichWorkspaceText(_ richWorkspace: String?) {
         
-        var html = ""
+        let html = "<h2><span style=\"color: #000000;\">" + richWorkspace! + "</span></h2>"
         
-        if richWorkspace != nil && richWorkspace!.count > 0 {
-            html = "<h2><span style=\"color: #000000;\">" + richWorkspace! + "</span></h2>"
-        } else {
-            html = "<h2><span style=\"color: #808080;\">" + NSLocalizedString("_add_notes_readme_md_", comment: "") + "</span></h2>"
-        }
-        self.richWorkspace = richWorkspace
         webView.loadHTMLString(html, baseURL: Bundle.main.bundleURL)
         webView.isUserInteractionEnabled = false
     }

+ 3 - 3
iOSClient/Main/NCRichWorkspace.xib

@@ -15,7 +15,7 @@
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XXz-cr-h4j">
-                    <rect key="frame" x="0.0" y="0.0" width="320" height="478"/>
+                    <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
                     <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <wkWebViewConfiguration key="configuration">
                         <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
@@ -23,10 +23,10 @@
                     </wkWebViewConfiguration>
                 </wkWebView>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C1O-Se-sSW" customClass="NCRichWorkspaceViewTouch" customModule="Nextcloud" customModuleProvider="target">
-                    <rect key="frame" x="0.0" y="478" width="320" height="2"/>
+                    <rect key="frame" x="0.0" y="480" width="320" height="0.0"/>
                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
-                        <constraint firstAttribute="height" constant="2" id="xy3-eG-rRi"/>
+                        <constraint firstAttribute="height" id="xy3-eG-rRi"/>
                     </constraints>
                 </view>
             </subviews>

+ 1 - 1
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -115,7 +115,7 @@
 "_no_permission_delete_file_" = "You don't have permission to delete files";
 "_no_permission_modify_file_" = "You don't have permission to modify files";
 "_request_upload_new_ver_"  = "The file has been modified, do you want to upload the new version ?";
-"_add_notes_readme_md_"     = "Add notes, lists or links ...";
+"_add_folder_info_"         = "Add folder info";
 
 // App