diff --git a/organizations/templates/organizations/personal.html b/organizations/templates/organizations/personal.html index 2f2bbd51b6..fa959c94f9 100644 --- a/organizations/templates/organizations/personal.html +++ b/organizations/templates/organizations/personal.html @@ -9,21 +9,8 @@ {% endblock %} {% block left_panel %} -

我的小组

-{% if groups %} - -{% else %} -

暂无

-{% endif %} + +{% include "snippets/my_groups.html" %} {% endblock %} {% block right_panel %} @@ -37,36 +24,10 @@ {% endautoescape %} {% endif %} -

我拥有的同步目录

- -{% if owned_repos %} - - - - - - - - {% for repo in owned_repos %} - - - - {% if repo.latest_modify %} - - {% else %} - - {% endif %} - - - {% endfor %} -
名字描述更新时间操作
{{ repo.props.name }}{{ repo.props.desc }}{{ repo.latest_modify|translate_commit_time }}-- - 同步 - 共享 - 删除 -
-{% endif %} + +{% include "snippets/my_owned_repos.html" %} -

共享给我的同步目录

+ {% include "snippets/shared_in_repos.html" %} {% url 'org_repo_share' org.url_prefix as repo_share_url %} diff --git a/templates/myhome.html b/templates/myhome.html index 6296d07190..6831d8d108 100644 --- a/templates/myhome.html +++ b/templates/myhome.html @@ -39,21 +39,8 @@

已用空间

{{ quota_usage|filesizeformat }} {% if cloud_mode %}/ 2 GB {% endif %}

-

我的小组

-{% if groups %} - -{% else %} -

暂无

-{% endif %} + +{% include "snippets/my_groups.html" %} {% endblock %} {% block right_panel %} @@ -67,36 +54,10 @@ {% endautoescape %} {% endif %} -

我拥有的同步目录

- -{% if owned_repos %} - - - - - - - - {% for repo in owned_repos %} - - - - {% if repo.latest_modify %} - - {% else %} - - - {% endfor %} -
名字描述更新时间操作
{{ repo.props.name }}{{ repo.props.desc }}{{ repo.latest_modify|translate_commit_time }}-- - {% endif %} - - 同步 - 共享 - 删除 -
-{% endif %} + +{% include "snippets/my_owned_repos.html" %} -

共享给我的同步目录

+ {% include "snippets/shared_in_repos.html" %} {% url 'share_repo' as repo_share_url %} diff --git a/templates/snippets/my_groups.html b/templates/snippets/my_groups.html new file mode 100644 index 0000000000..8f92c1a701 --- /dev/null +++ b/templates/snippets/my_groups.html @@ -0,0 +1,16 @@ +{% load group_avatar_tags %} +

我的小组

+{% if groups %} + +{% else %} +

暂无

+{% endif %} diff --git a/templates/snippets/my_owned_repos.html b/templates/snippets/my_owned_repos.html new file mode 100644 index 0000000000..fc8e12f55b --- /dev/null +++ b/templates/snippets/my_owned_repos.html @@ -0,0 +1,29 @@ +{% load seahub_tags %} +

我拥有的同步目录

+ +{% if owned_repos %} + + + + + + + + {% for repo in owned_repos %} + + + + {% if repo.latest_modify %} + + {% else %} + + {% endif %} + + + {% endfor %} +
名字描述更新时间操作
{{ repo.props.name }}{{ repo.props.desc }}{{ repo.latest_modify|translate_commit_time }}-- + 同步 + 共享 + 删除 +
+{% endif %} diff --git a/templates/snippets/shared_in_repos.html b/templates/snippets/shared_in_repos.html index 86f5fe8005..ccbd79e120 100644 --- a/templates/snippets/shared_in_repos.html +++ b/templates/snippets/shared_in_repos.html @@ -1,4 +1,5 @@ {% load seahub_tags %} +

共享给我的同步目录

{% if in_repos %}