summaryrefslogtreecommitdiffstats
path: root/templates/org
diff options
context:
space:
mode:
authorHester Gong <hestergong@gmail.com>2023-04-23 17:24:19 +0800
committerGitHub <noreply@github.com>2023-04-23 17:24:19 +0800
commit476a043a5fb2b472e2aaced450ac2a0c9102854e (patch)
treefcbc301d7fca09eee292cdd039a6980a88aefa63 /templates/org
parent5e389228f61844c0d59d5bc5974483dae0aa1b8b (diff)
downloadgitea-476a043a5fb2b472e2aaced450ac2a0c9102854e.tar.gz
gitea-476a043a5fb2b472e2aaced450ac2a0c9102854e.zip
Refactor delete_modal_actions template and use it for project column related actions (#24097)
Co-Author: @wxiaoguang This PR is to fix https://github.com/go-gitea/gitea/issues/23318#issuecomment-1506275446 . The way to fix this in this PR is to use `delete_modal_actions.tmpl` here both to fix this issue and keep ui consistency (as suggested by [TODO here](https://github.com/go-gitea/gitea/blob/4299c3b7db61f8741eca0ba3d663bb65745a4acc/templates/projects/view.tmpl#L161)) And this PR also refactors `delete_modal_actions.tmpl` and its related styles, and use the template for more modal actions: 1. Added template attributes: * locale * ModalButtonStyle: "yes" (default) or "confirm" * ModalButtonCancelText * ModalButtonOkText 2. Rename `delete_modal_actions.tmpl` template to `modal_actions_confirm.tmpl` because it is not only used for action modals deletion now. 3. Refactored css related to modals into `web_src/css/modules/modal.css` and improved the styles. 4. Also use the template for PR deletion modal and remove issue dependency modal. 5. Some modals should also use the template, but not sure how to open them, so mark these modal actions by `{{/* TODO: Convert to base/modal_actions_confirm */}}` After (Also tested on arc green): Hovering on the left buttons <img width="711" alt="Screen Shot 2023-04-23 at 15 17 12" src="https://user-images.githubusercontent.com/17645053/233825650-76307e65-9255-44bb-80e8-7062f58ead1b.png"> <img width="786" alt="Screen Shot 2023-04-23 at 15 17 21" src="https://user-images.githubusercontent.com/17645053/233825652-4dc6f7d1-a180-49fb-a468-d60950eaee0d.png"> Test for functionalities: https://user-images.githubusercontent.com/17645053/233826857-76376fda-022c-42d0-b0f3-339c17ca4e59.mov --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/org')
-rw-r--r--templates/org/member/members.tmpl14
-rw-r--r--templates/org/settings/delete.tmpl6
-rw-r--r--templates/org/team/members.tmpl7
-rw-r--r--templates/org/team/new.tmpl6
-rw-r--r--templates/org/team/repositories.tmpl12
-rw-r--r--templates/org/team/sidebar.tmpl7
-rw-r--r--templates/org/team/teams.tmpl7
7 files changed, 27 insertions, 32 deletions
diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl
index 511d333c29..7b6c83cfcc 100644
--- a/templates/org/member/members.tmpl
+++ b/templates/org/member/members.tmpl
@@ -81,25 +81,23 @@
{{template "base/paginate" .}}
</div>
</div>
-<div class="ui small basic delete modal" id="leave-organization">
- <div class="ui icon header">
- {{svg "octicon-x" 16 "close inside"}}
+<div class="ui gitea-confirm-modal delete modal" id="leave-organization">
+ <div class="header">
{{$.locale.Tr "org.members.leave"}}
</div>
<div class="content">
<p>{{$.locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
-<div class="ui small basic delete modal" id="remove-organization-member">
- <div class="ui icon header">
- {{svg "octicon-x" 16 "close inside"}}
+<div class="ui gitea-confirm-modal delete modal" id="remove-organization-member">
+ <div class="header">
{{$.locale.Tr "org.members.remove"}}
</div>
<div class="content">
<p>{{$.locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataOrganizationName"></span>` | Safe}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl
index 69e226f410..e8a8f5b185 100644
--- a/templates/org/settings/delete.tmpl
+++ b/templates/org/settings/delete.tmpl
@@ -29,14 +29,14 @@
</div>
</div>
-<div class="ui small basic delete modal">
- <div class="ui icon header">
+<div class="ui gitea-confirm-modal delete modal">
+ <div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "org.settings.delete_org_title"}}
</div>
<div class="content">
<p>{{.locale.Tr "org.settings.delete_org_desc"}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl
index bb975c0c4d..e387090b3b 100644
--- a/templates/org/team/members.tmpl
+++ b/templates/org/team/members.tmpl
@@ -64,14 +64,13 @@
</div>
</div>
</div>
-<div class="ui small basic delete modal" id="remove-team-member">
- <div class="ui icon header">
- {{svg "octicon-x" 16 "close inside"}}
+<div class="ui gitea-confirm-modal delete modal" id="remove-team-member">
+ <div class="header">
{{$.locale.Tr "org.members.remove"}}
</div>
<div class="content">
<p>{{$.locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataTeamName"></span>` | Safe}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
index 2e65d63580..2860ea497b 100644
--- a/templates/org/team/new.tmpl
+++ b/templates/org/team/new.tmpl
@@ -148,14 +148,14 @@
</div>
</div>
-<div class="ui small basic delete modal">
- <div class="ui icon header">
+<div class="ui gitea-confirm-modal delete modal">
+ <div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "org.teams.delete_team_title"}}
</div>
<div class="content">
<p>{{.locale.Tr "org.teams.delete_team_desc"}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl
index 0ffd50226f..41561da311 100644
--- a/templates/org/team/repositories.tmpl
+++ b/templates/org/team/repositories.tmpl
@@ -64,26 +64,26 @@
</div>
</div>
-<div class="ui small basic delete modal" id="org-team-remove-all-repo">
- <div class="ui icon header">
+<div class="ui gitea-confirm-modal delete modal" id="org-team-remove-all-repo">
+ <div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "org.teams.remove_all_repos_title"}}
</div>
<div class="content">
<p>{{.locale.Tr "org.teams.remove_all_repos_desc"}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
-<div class="ui small basic addall modal" id="org-team-add-all-repo">
- <div class="ui icon header">
+<div class="ui gitea-confirm-modal addall modal" id="org-team-add-all-repo">
+ <div class="header">
{{svg "octicon-globe"}}
{{.locale.Tr "org.teams.add_all_repos_title"}}
</div>
<div class="content">
<p>{{.locale.Tr "org.teams.add_all_repos_desc"}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl
index cecd8ddee6..f265255256 100644
--- a/templates/org/team/sidebar.tmpl
+++ b/templates/org/team/sidebar.tmpl
@@ -83,13 +83,12 @@
</div>
{{end}}
</div>
-<div class="ui small basic delete modal" id="leave-team-sidebar">
- <div class="ui icon header">
- {{svg "octicon-x" 16 "close inside"}}
+<div class="ui gitea-confirm-modal delete modal" id="leave-team-sidebar">
+ <div class="header">
{{$.locale.Tr "org.teams.leave"}}
</div>
<div class="content">
<p>{{$.locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl
index 27bbe80a3c..c31b6caf1c 100644
--- a/templates/org/team/teams.tmpl
+++ b/templates/org/team/teams.tmpl
@@ -43,14 +43,13 @@
</div>
</div>
</div>
-<div class="ui small basic delete modal" id="leave-team">
- <div class="ui icon header">
- {{svg "octicon-x" 16 "close inside"}}
+<div class="ui gitea-confirm-modal delete modal" id="leave-team">
+ <div class="header">
{{$.locale.Tr "org.teams.leave"}}
</div>
<div class="content">
<p>{{$.locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p>
</div>
- {{template "base/delete_modal_actions" .}}
+ {{template "base/modal_actions_confirm" .}}
</div>
{{template "base/footer" .}}
port/48030/stable30'>backport/48030/stable30 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/DAV/FSExt/File.php
blob: b93ce5aee2108bfbdb5bebf3a3a6619b7eda458b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php

/**
 * File class
 *
 * @package Sabre
 * @subpackage DAV
 * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
 * @author Evert Pot (http://www.rooftopsolutions.nl/)
 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
 */
class Sabre_DAV_FSExt_File extends Sabre_DAV_FSExt_Node implements Sabre_DAV_IFile {

    /**
     * Updates the data
     *
     * data is a readable stream resource.
     *
     * @param resource $data
     * @return void
     */
    public function put($data) {

        file_put_contents($this->path,$data);
        return '"' . md5_file($this->path) . '"';

    }

    /**
     * Returns the data
     *
     * @return string
     */
    public function get() {

        return fopen($this->path,'r');

    }

    /**
     * Delete the current file
     *
     * @return bool
     */
    public function delete() {

        unlink($this->path);
        return parent::delete();

    }

    /**
     * Returns the ETag for a file
     *
     * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
     * The ETag is an arbitrary string, but MUST be surrounded by double-quotes.
     *
     * Return null if the ETag can not effectively be determined
     *
     * @return string|null
     */
    public function getETag() {

        return '"' . md5_file($this->path). '"';

    }

    /**
     * Returns the mime-type for a file
     *
     * If null is returned, we'll assume application/octet-stream
     *
     * @return string|null
     */
    public function getContentType() {

        return null;

    }

    /**
     * Returns the size of the file, in bytes
     *
     * @return int
     */
    public function getSize() {

        return filesize($this->path);

    }

}