From d84d1428b23ad0b5574df9417a9b6c7e7f0cc53a Mon Sep 17 00:00:00 2001 From: jendib Date: Sat, 14 May 2016 02:05:03 +0200 Subject: [PATCH 01/12] Android: Better layout for read-only documents --- .../docs/activity/DocumentEditActivity.java | 2 +- .../docs/activity/DocumentViewActivity.java | 8 +-- .../sismics/docs/fragment/SearchFragment.java | 2 +- .../res/layout/document_view_activity.xml | 72 +++++++++---------- docs-android/gradle.properties | 2 + 5 files changed, 44 insertions(+), 42 deletions(-) diff --git a/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentEditActivity.java b/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentEditActivity.java index c15d04fc..7072bbbb 100644 --- a/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentEditActivity.java +++ b/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentEditActivity.java @@ -101,7 +101,7 @@ public class DocumentEditActivity extends AppCompatActivity { finish(); return; } - JSONArray tagArray = tags.optJSONArray("stats"); + JSONArray tagArray = tags.optJSONArray("tags"); List tagList = new ArrayList<>(); for (int i = 0; i < tagArray.length(); i++) { diff --git a/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentViewActivity.java b/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentViewActivity.java index ec38eae4..46a17f55 100644 --- a/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentViewActivity.java +++ b/docs-android/app/src/main/java/com/sismics/docs/activity/DocumentViewActivity.java @@ -642,10 +642,10 @@ public class DocumentViewActivity extends AppCompatActivity { } // Action only available if the document is writable - findViewById(R.id.actionEditDocument).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); - findViewById(R.id.actionUploadFile).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); - findViewById(R.id.actionSharing).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); - findViewById(R.id.actionDelete).setVisibility(writable ? View.VISIBLE : View.INVISIBLE); + findViewById(R.id.actionEditDocument).setVisibility(writable ? View.VISIBLE : View.GONE); + findViewById(R.id.actionUploadFile).setVisibility(writable ? View.VISIBLE : View.GONE); + findViewById(R.id.actionSharing).setVisibility(writable ? View.VISIBLE : View.GONE); + findViewById(R.id.actionDelete).setVisibility(writable ? View.VISIBLE : View.GONE); // ACLs ListView aclListView = (ListView) findViewById(R.id.aclListView); diff --git a/docs-android/app/src/main/java/com/sismics/docs/fragment/SearchFragment.java b/docs-android/app/src/main/java/com/sismics/docs/fragment/SearchFragment.java index a1e8cadb..cc55d3a5 100644 --- a/docs-android/app/src/main/java/com/sismics/docs/fragment/SearchFragment.java +++ b/docs-android/app/src/main/java/com/sismics/docs/fragment/SearchFragment.java @@ -73,7 +73,7 @@ public class SearchFragment extends DialogFragment { dialog.cancel(); return dialog; } - JSONArray tagArray = tags.optJSONArray("stats"); + JSONArray tagArray = tags.optJSONArray("tags"); List tagList = new ArrayList<>(); for (int i = 0; i < tagArray.length(); i++) { diff --git a/docs-android/app/src/main/res/layout/document_view_activity.xml b/docs-android/app/src/main/res/layout/document_view_activity.xml index 13c3e0f3..0068dceb 100644 --- a/docs-android/app/src/main/res/layout/document_view_activity.xml +++ b/docs-android/app/src/main/res/layout/document_view_activity.xml @@ -166,28 +166,6 @@ android:orientation="horizontal" style="?android:buttonBarStyle"> - + +

 

+ + \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.theme.html b/docs-web/src/main/webapp/src/partial/docs/settings.config.html similarity index 77% rename from docs-web/src/main/webapp/src/partial/docs/settings.theme.html rename to docs-web/src/main/webapp/src/partial/docs/settings.config.html index 5f046bc5..b909bbe1 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.theme.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.config.html @@ -1,3 +1,18 @@ +

+ Guest access + + {{ app.guest_login ? 'Enabled' : 'Disabled' }} + +

+

+ Guest access is a mode where anyone can access {{ appName }} without password.
+ Like a normal user, the guest user can only access its documents and those accessible through permissions.
+

+
+ + +
+

Theme customization

diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.html b/docs-web/src/main/webapp/src/partial/docs/settings.html index 6594764f..6c574a65 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.html @@ -9,14 +9,14 @@
-
-
General settings
+
diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html b/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html index d9033895..88d44636 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.user.edit.html @@ -62,7 +62,7 @@ Number required -
+
@@ -76,7 +76,7 @@ Too long
-
+
@@ -94,7 +94,7 @@ -
From a79922d7c9b3e72c80d60f1f611b5b4b5d05489a Mon Sep 17 00:00:00 2001 From: jendib Date: Mon, 6 Jun 2016 20:51:05 +0200 Subject: [PATCH 10/12] Android: upgrade okhttp (fix for Android 6) --- docs-android/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-android/app/build.gradle b/docs-android/app/build.gradle index 9252b12e..a38850e3 100644 --- a/docs-android/app/build.gradle +++ b/docs-android/app/build.gradle @@ -56,7 +56,7 @@ dependencies { compile 'it.sephiroth.android.library.imagezoom:imagezoom:1.0.5' compile 'org.greenrobot:eventbus:3.0.0' compile 'com.squareup.picasso:picasso:2.5.2' - compile 'com.squareup.okhttp3:okhttp:3.1.1' - compile "com.squareup.okhttp3:okhttp-urlconnection:3.1.1" + compile 'com.squareup.okhttp3:okhttp:3.3.1' + compile "com.squareup.okhttp3:okhttp-urlconnection:3.3.1" compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2' } From ed1353a4eb563da7a3ead7e73815ecf168d0f158 Mon Sep 17 00:00:00 2001 From: jendib Date: Thu, 16 Jun 2016 20:13:34 +0200 Subject: [PATCH 11/12] Android: upgrade build tools --- docs-android/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-android/app/build.gradle b/docs-android/app/build.gradle index a38850e3..8351f7ed 100644 --- a/docs-android/app/build.gradle +++ b/docs-android/app/build.gradle @@ -3,7 +3,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } apply plugin: 'com.android.application' @@ -14,7 +14,7 @@ repositories { android { compileSdkVersion 23 - buildToolsVersion '23.0.3' + buildToolsVersion '24' defaultConfig { minSdkVersion 14 From f5705b11539afaba0c75636d94b6b8a154db7b1a Mon Sep 17 00:00:00 2001 From: jendib Date: Thu, 16 Jun 2016 20:31:39 +0200 Subject: [PATCH 12/12] Minor UI tweaks --- .../webapp/src/partial/docs/document.html | 20 +++++++++++++++++-- .../src/partial/docs/settings.group.html | 2 +- .../src/partial/docs/settings.session.html | 6 ++++-- .../src/partial/docs/settings.user.html | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docs-web/src/main/webapp/src/partial/docs/document.html b/docs-web/src/main/webapp/src/partial/docs/document.html index 557dfd6a..0f9276a1 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.html @@ -46,6 +46,19 @@ + + + + + + + + + No document in the database + No matches for "{{ search }}" + + + {{ document.title }} ({{ document.file_count }}) @@ -79,8 +92,11 @@ used on {{ userInfo.storage_quota / 1000000 | number: 0 }}MB
-
- {{ totalDocuments }} document{{ totalDocuments > 1 ? 's' : '' }} found +
+ + {{ totalDocuments }} document{{ totalDocuments > 1 ? 's' : '' }} found + +  
diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.group.html b/docs-web/src/main/webapp/src/partial/docs/settings.group.html index 284706ec..84b6e535 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.group.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.group.html @@ -1,4 +1,4 @@ -

Groups management Add

+

Groups management Add a group

diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.session.html b/docs-web/src/main/webapp/src/partial/docs/settings.session.html index 8d32a86d..2b5c015b 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.session.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.session.html @@ -13,10 +13,12 @@ {{ session.create_date | date: 'yyyy-MM-dd HH:mm' }} {{ session.last_connection_date | date: 'yyyy-MM-dd HH:mm' }} {{ session.ip }} - + + +
- +
\ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/settings.user.html b/docs-web/src/main/webapp/src/partial/docs/settings.user.html index c4fb3c1b..2f4e991e 100644 --- a/docs-web/src/main/webapp/src/partial/docs/settings.user.html +++ b/docs-web/src/main/webapp/src/partial/docs/settings.user.html @@ -1,4 +1,4 @@ -

Users management Add

+

Users management Add a user