IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

51 行
1.3KB

  1. import dash_bootstrap_components as dbc
  2. import dash_html_components as html
  3. from .users import get_user
  4. def list_projects(arv, parent):
  5. res = arv.groups().list(where={
  6. 'owner_uuid': parent,
  7. 'group_class': 'project'
  8. }).execute()['items']
  9. return res
  10. def list_projects_html(arv, parent):
  11. projects = list_projects(arv, parent)
  12. header = html.Tr([
  13. html.Th('Name'),
  14. html.Th('Description'),
  15. html.Th('Owner')
  16. ])
  17. header = [ html.Thead(header) ]
  18. rows = []
  19. for a in projects:
  20. owner = get_user(arv, a['owner_uuid'])
  21. rows.append(
  22. html.Tr([
  23. html.Td([
  24. html.Div(html.A(href='/projects/' + a['uuid'],
  25. children=a['name'])),
  26. html.Div(a['uuid'])
  27. ]),
  28. html.Td(a['description'] or 'Project'),
  29. html.Td([
  30. html.Div(html.A(href='mailto:' + owner['email'],
  31. children=owner['first_name'] + ' ' + owner['last_name'])),
  32. html.Div(a['owner_uuid'])
  33. ])
  34. ]))
  35. rows = [ html.Tbody(rows) ]
  36. res = dbc.Table(header + rows,
  37. striped=True,
  38. hover=True,
  39. responsive=True)
  40. return res