Skip to content

Commit 74609ca

Browse files
authored
Merge pull request #183 from Piwigo/develop
Release 2.3.0
2 parents 7a7da9d + 919ac62 commit 74609ca

47 files changed

Lines changed: 1118 additions & 728 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ GeneratedPluginRegistrant.java
99
# Remember to never publicly share your keystore.
1010
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
1111
key.properties
12+
/build/.last_build_id

android/app/build.gradle

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,10 +22,6 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
def keystoreProperties = new Properties()
2926
def keystorePropertiesFile = rootProject.file('key.properties')
3027
if (keystorePropertiesFile.exists()) {
@@ -37,13 +34,13 @@ android {
3734
compileOptions {
3835
// Flag to enable support for the new language APIs
3936
coreLibraryDesugaringEnabled true
40-
// Sets Java compatibility to Java 8
41-
sourceCompatibility JavaVersion.VERSION_1_8
42-
targetCompatibility JavaVersion.VERSION_1_8
37+
// Sets Java compatibility to Java 11
38+
sourceCompatibility JavaVersion.VERSION_11
39+
targetCompatibility JavaVersion.VERSION_11
4340
}
4441

4542
kotlinOptions {
46-
jvmTarget = '1.8'
43+
jvmTarget = '11'
4744
}
4845

4946
sourceSets {
@@ -81,7 +78,6 @@ flutter {
8178
}
8279

8380
dependencies {
84-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
8581
implementation "androidx.window:window:1.0.0"
8682
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
8783
}

android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.3'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()

android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.1.3" apply false
22+
id "org.jetbrains.kotlin.android" version "1.9.22" apply false
23+
}
24+
25+
include ":app"

l10n/app_de.arb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"tabBar_albums": "Alben",
3-
"settings_language": "Wählen Sie die Sprache",
43
"tabBar_upload": "Hochladen",
54
"tabBar_preferences": "Einstellungen",
65
"alertOkButton": "OK",

l10n/app_zh.arb

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"loadingHUD_label": "正在加载…",
2121
"completeHUD_label": "完成",
2222
"errorHUD_label": "出错",
23-
"loadMoreHUD_label": "Release to load more",
23+
"loadMoreHUD_label": "松开以加载更多",
2424
"uploadRights_title": "需要上传权限",
2525
"uploadRights_message": "您必须拥有上传权限才能上传照片或视频。",
2626
"internetErrorGeneral_title": "连接出错",
@@ -48,16 +48,16 @@
4848
"login_newSession": "正在打开会话",
4949
"login_communityParameters": "社区参数",
5050
"login_serverParameters": "Piwigo参数",
51-
"login_advancedParameters": "Authentication Settings",
51+
"login_advancedParameters": "验证设置",
5252
"login_connectionChanged": "连接已变更!",
53-
"login_rememberCredentials": "Remember credentials",
53+
"login_rememberCredentials": "记住凭据",
5454
"loginHTTP_title": "HTTP 证书",
5555
"loginHTTP_message": "Piwigo服务器需要基本访问验证:",
56-
"loginHTTP_enable": "Enable HTTP Basic",
56+
"loginHTTP_enable": "使能 HTTP Basic",
5757
"loginHTTPuser_placeholder": "用户名",
5858
"loginHTTPpwd_placeholder": "密码",
59-
"loginCert_title": "Self Signed Certificates",
60-
"loginCert_enable": "Allow SSL",
59+
"loginCert_title": "自签名证书",
60+
"loginCert_enable": "允许 SSL",
6161
"loginCertFailed_title": "非私密连接",
6262
"loginCertFailed_message": "Piwigo警告网站证书无效。您仍然想要接受此证书吗?",
6363
"loginHTTPSfailed_title": "安全连接失败",
@@ -153,7 +153,7 @@
153153
"categoryUpload_loadSubCategories": "加载",
154154
"categoryUpload_images": "上传图片",
155155
"categoryUpload_videos": "上传视频",
156-
"categoryUpload_camera": "Camera",
156+
"categoryUpload_camera": "相机",
157157
"categoryUpload_takePhoto": "拍照",
158158
"categoryUpload_takeVideo": "录制",
159159
"uploadList_title": "上传状态",
@@ -242,23 +242,23 @@
242242
"moveCategoryHUD_moved": "相册已移动",
243243
"moveCategoryError_title": "移动失败",
244244
"moveCategoryError_message": "移动相册失败",
245-
"categoryPrivacy": "Manage Permissions",
246-
"categoryPrivacy_subtitle": "Manage access permissions of \"{album_name}\".",
245+
"categoryPrivacy": "管理权限",
246+
"categoryPrivacy_subtitle": "管理 \"{album_name}\" 的访问权限",
247247
"@categoryPrivacy_subtitle": {
248248
"placeholders": {
249249
"album_name": {}
250250
}
251251
},
252-
"categoryPrivacyMode_public": "Public",
253-
"categoryPrivacyMode_publicMessage": "Every user can see this album.",
254-
"categoryPrivacyMode_private": "Private",
255-
"categoryPrivacyMode_privateMessage": "Visitors must log in and have the necessary permissions to see this album.",
256-
"categoryPrivacyGroups": "Group permissions",
257-
"categoryPrivacyGroups_add": "Authorize groups",
258-
"categoryPrivacyUsers": "User permissions",
259-
"categoryPrivacyUsers_message": "To manage user permissions, go to your web administration.",
260-
"categoryPrivacyRecursive": "Apply to sub-albums",
261-
"categoryPrivacyRecursive_message": "After confirmation, all modifications will be applied to sub-albums.",
252+
"categoryPrivacyMode_public": "公开的",
253+
"categoryPrivacyMode_publicMessage": "每个用户都可以看到此相册。",
254+
"categoryPrivacyMode_private": "私有的",
255+
"categoryPrivacyMode_privateMessage": "访客必须登录并拥有查看此相册的必要权限。",
256+
"categoryPrivacyGroups": "组权限",
257+
"categoryPrivacyGroups_add": "授权组",
258+
"categoryPrivacyUsers": "用户权限",
259+
"categoryPrivacyUsers_message": "要管理用户权限,请前往您的网站管理界面。",
260+
"categoryPrivacyRecursive": "应用到子相册",
261+
"categoryPrivacyRecursive_message": "确认后,所有修改都将应用于子相册。",
262262
"categorySelection_setThumbnail": "请选择要使用照片 {photo} 作为缩略图的相册。",
263263
"@categorySelection_setThumbnail": {
264264
"placeholders": {
@@ -364,17 +364,17 @@
364364
"tagsAdd_placeholder": "新标签",
365365
"tagsAddHUD_label": "创建标签中...",
366366
"tagsAddHUD_created": "标签已创建",
367-
"group": "Group",
368-
"groups": "Groups",
369-
"groupsTitle_selectOne": "Select a Group",
370-
"groupsHeader_selected": "Selected",
371-
"groupsHeader_notSelected": "Not Selected",
372-
"groupsHeader_all": "All Groups",
373-
"groupsAdd_title": "Add Group",
374-
"groupsAdd_message": "Enter a name for this new group",
375-
"groupsAdd_placeholder": "New group",
376-
"groupsAddHUD_label": "Creating Group…",
377-
"groupsAddHUD_created": "Group Created",
367+
"group": "",
368+
"groups": "",
369+
"groupsTitle_selectOne": "选择一个组",
370+
"groupsHeader_selected": "已选中",
371+
"groupsHeader_notSelected": "未选中",
372+
"groupsHeader_all": "所有组",
373+
"groupsAdd_title": "添加组",
374+
"groupsAdd_message": "为新增的组设置名称",
375+
"groupsAdd_placeholder": "新增组",
376+
"groupsAddHUD_label": "正在创建组…",
377+
"groupsAddHUD_created": "已创建组",
378378
"tagsAddError_message": "无法创建新标签",
379379
"tagsAddError_title": "创建失败",
380380
"selectImages": "选择图片",

lib/app.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'package:piwigo_ng/views/image/edit_image_page.dart';
1616
import 'package:piwigo_ng/views/image/image_favorites_page.dart';
1717
import 'package:piwigo_ng/views/image/image_page.dart';
1818
import 'package:piwigo_ng/views/image/image_search_page.dart';
19+
import 'package:piwigo_ng/views/image/image_tags_page.dart';
1920
import 'package:piwigo_ng/views/image/video_player_page.dart';
2021
import 'package:piwigo_ng/views/settings/auto_upload_page.dart';
2122
import 'package:piwigo_ng/views/settings/privacy_policy_page.dart';
@@ -147,6 +148,14 @@ Route<dynamic> generateRoute(RouteSettings settings) {
147148
),
148149
settings: settings,
149150
);
151+
case ImageTagsPage.routeName:
152+
return MaterialPageRoute(
153+
builder: (_) => ImageTagsPage(
154+
isAdmin: arguments['isAdmin'] ?? isAdmin,
155+
tag: arguments["tag"],
156+
),
157+
settings: settings,
158+
);
150159
case ImageFavoritesPage.routeName:
151160
return MaterialPageRoute(
152161
builder: (_) => ImageFavoritesPage(

lib/components/appbars/root_search_app_bar.dart

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:piwigo_ng/components/modals/open_tag_modal.dart';
23
import 'package:piwigo_ng/components/notification_dot.dart';
34
import 'package:piwigo_ng/components/popup_list_item.dart';
45
import 'package:piwigo_ng/services/preferences_service.dart';
@@ -40,9 +41,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
4041
if (widget.scrollController.offset > _expandedHeight * _opacityScale) {
4142
return 0.0;
4243
}
43-
return (_expandedHeight * _opacityScale -
44-
widget.scrollController.offset) /
45-
(_expandedHeight * _opacityScale);
44+
return (_expandedHeight * _opacityScale - widget.scrollController.offset) / (_expandedHeight * _opacityScale);
4645
}
4746
return 1.0;
4847
}
@@ -58,8 +57,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
5857
}
5958

6059
// In case 0%-100% of the expanded height is viewed
61-
double scrollDelta =
62-
(_expandedHeight - widget.scrollController.offset) / _expandedHeight;
60+
double scrollDelta = (_expandedHeight - widget.scrollController.offset) / _expandedHeight;
6361
double scrollPercent = (scrollDelta * 2 - 1);
6462
return (1 - scrollPercent) * delta * basePadding + basePadding;
6563
}
@@ -71,8 +69,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
7169
Widget build(BuildContext context) {
7270
return SliverAppBar(
7371
leading: IconButton(
74-
onPressed: () =>
75-
Navigator.of(context).pushNamed(SettingsPage.routeName),
72+
onPressed: () => Navigator.of(context).pushNamed(SettingsPage.routeName),
7673
icon: const Icon(Icons.settings),
7774
),
7875
pinned: true,
@@ -90,7 +87,6 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
9087
child: AppField(
9188
padding: const EdgeInsets.symmetric(vertical: 8.0),
9289
prefix: Icon(Icons.search),
93-
hint: "Search...",
9490
),
9591
),
9692
),
@@ -108,7 +104,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
108104
),
109105
title: Text(
110106
appStrings.tabBar_albums,
111-
textScaleFactor: 1,
107+
textScaler: TextScaler.linear(1),
112108
style: Theme.of(context).appBarTheme.titleTextStyle,
113109
),
114110
),
@@ -125,8 +121,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
125121
PopupMenuItem(
126122
onTap: () => Future.delayed(
127123
const Duration(seconds: 0),
128-
() =>
129-
Navigator.of(context).pushNamed(UploadStatusPage.routeName),
124+
() => Navigator.of(context).pushNamed(UploadStatusPage.routeName),
130125
),
131126
child: Stack(
132127
children: [
@@ -137,8 +132,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
137132
Positioned(
138133
top: 14.0,
139134
left: 0.0,
140-
child: Consumer<UploadNotifier>(
141-
builder: (context, uploadNotifier, child) {
135+
child: Consumer<UploadNotifier>(builder: (context, uploadNotifier, child) {
142136
return NotificationDot(
143137
isShown: uploadNotifier.uploadList.isNotEmpty,
144138
);
@@ -147,12 +141,21 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
147141
],
148142
),
149143
),
144+
PopupMenuItem(
145+
onTap: () => Future.delayed(
146+
const Duration(seconds: 0),
147+
() => showOpenTagModal(context),
148+
),
149+
child: PopupListItem(
150+
icon: Icons.local_offer_outlined,
151+
text: appStrings.tags,
152+
),
153+
),
150154
if (Preferences.getUserStatus != 'guest')
151155
PopupMenuItem(
152156
onTap: () => Future.delayed(
153157
const Duration(seconds: 0),
154-
() => Navigator.of(context)
155-
.pushNamed(ImageFavoritesPage.routeName),
158+
() => Navigator.of(context).pushNamed(ImageFavoritesPage.routeName),
156159
),
157160
child: PopupListItem(
158161
icon: Icons.favorite,
@@ -164,8 +167,7 @@ class _RootSearchAppBarState extends State<RootSearchAppBar> {
164167
Positioned(
165168
top: 12.0,
166169
left: 12.0,
167-
child: Consumer<UploadNotifier>(
168-
builder: (context, uploadNotifier, child) {
170+
child: Consumer<UploadNotifier>(builder: (context, uploadNotifier, child) {
169171
return NotificationDot(
170172
isShown: uploadNotifier.uploadList.isNotEmpty,
171173
);

lib/components/appbars/settings_app_bar.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class _SettingsAppBarState extends State<SettingsAppBar> {
3333
}
3434

3535
// In case 0%-100% of the expanded height is viewed
36-
double scrollDelta =
37-
(_expandedHeight - widget.scrollController.offset) / _expandedHeight;
36+
double scrollDelta = (_expandedHeight - widget.scrollController.offset) / _expandedHeight;
3837
double scrollPercent = (scrollDelta * 2 - 1);
3938
return (1 - scrollPercent) * delta * basePadding + basePadding;
4039
}
@@ -59,7 +58,7 @@ class _SettingsAppBarState extends State<SettingsAppBar> {
5958
),
6059
title: Text(
6160
appStrings.tabBar_preferences,
62-
textScaleFactor: 1,
61+
textScaler: TextScaler.linear(1),
6362
style: Theme.of(context).appBarTheme.titleTextStyle,
6463
),
6564
),

lib/components/cards/image_card.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ImageCard extends StatelessWidget {
8080
end: Alignment.topCenter),
8181
),
8282
child: AutoSizeText(
83-
image.name,
83+
image.name ?? "",
8484
maxLines: 1,
8585
maxFontSize: 14,
8686
minFontSize: 8,

0 commit comments

Comments
 (0)