1
0

index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <template>
  2. <main>
  3. <Pinned />
  4. <!-- Projects list (only on smallest breakpoint) -->
  5. <div class="hidden mt-10 sm:hidden">
  6. <div class="px-4 sm:px-6">
  7. <h2 class="text-gray-500 text-xs font-medium uppercase tracking-wide">Projects</h2>
  8. </div>
  9. <ul role="list" class="mt-3 border-t border-gray-200 divide-y divide-gray-100">
  10. <li>
  11. <NuxtLink to="/projects/nexa" class="group flex items-center justify-between px-4 py-4 hover:bg-gray-50 sm:px-6">
  12. <span class="flex items-center truncate space-x-3">
  13. <span class="w-2.5 h-2.5 flex-shrink-0 rounded-full bg-pink-600" aria-hidden="true"></span>
  14. <span class="font-medium truncate text-sm leading-6">
  15. Wally Dice
  16. <span class="truncate font-normal text-gray-500">in Nexa</span>
  17. </span>
  18. </span>
  19. <!-- Heroicon name: solid/chevron-right -->
  20. <svg class="ml-4 h-5 w-5 text-gray-400 group-hover:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  21. <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
  22. </svg>
  23. </NuxtLink>
  24. </li>
  25. <!-- More projects... -->
  26. </ul>
  27. </div>
  28. <!-- Projects table (small breakpoint and up) -->
  29. <div class="hidden mt-8 sm:block mx-8 rounded border-2 border-pink-200">
  30. <div class="align-middle inline-block min-w-full border-b border-gray-200">
  31. <table class="min-w-full">
  32. <thead>
  33. <tr class="border-t border-gray-200">
  34. <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  35. <span class="lg:pl-2">Project</span>
  36. </th>
  37. <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  38. Members
  39. </th>
  40. <th class="hidden md:table-cell px-6 py-3 border-b border-gray-200 bg-gray-50 text-right text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap">
  41. Last updated
  42. </th>
  43. <th class="pr-6 py-3 border-b border-gray-200 bg-gray-50 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"></th>
  44. </tr>
  45. </thead>
  46. <tbody class="bg-white divide-y divide-gray-100">
  47. <tr v-for="project of projects" :key="project.id">
  48. <td class="px-6 py-3 max-w-0 w-full whitespace-nowrap text-sm font-medium text-gray-900">
  49. <div class="flex items-center space-x-3 lg:pl-2">
  50. <div class="flex-shrink-0 w-2.5 h-2.5 rounded-full bg-pink-600" aria-hidden="true"></div>
  51. <NuxtLink to="/projects/nexa" class="truncate hover:text-gray-600">
  52. <span>
  53. {{ project.title }}
  54. <span class="text-gray-500 font-normal text-xs">in {{ project.blockchain }}</span>
  55. </span>
  56. </NuxtLink>
  57. </div>
  58. </td>
  59. <td class="px-6 py-3 text-sm text-gray-500 font-medium">
  60. <div class="flex items-center space-x-2">
  61. <div class="flex flex-shrink-0 -space-x-1">
  62. <img
  63. class="max-w-none h-6 w-6 rounded-full ring-2 ring-white"
  64. src="https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
  65. alt="Dries Vincent"
  66. />
  67. <img
  68. class="max-w-none h-6 w-6 rounded-full ring-2 ring-white"
  69. src="https://images.unsplash.com/photo-1517841905240-472988babdf9?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
  70. alt="Lindsay Walton"
  71. />
  72. <img
  73. class="max-w-none h-6 w-6 rounded-full ring-2 ring-white"
  74. src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
  75. alt="Courtney Henry"
  76. />
  77. <img
  78. class="max-w-none h-6 w-6 rounded-full ring-2 ring-white"
  79. src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
  80. alt="Tom Cook"
  81. />
  82. </div>
  83. <span class="flex-shrink-0 text-xs leading-5 font-medium">+8</span>
  84. </div>
  85. </td>
  86. <td class="hidden md:table-cell px-6 py-3 whitespace-nowrap text-sm text-gray-500 text-right">
  87. <!-- January 1, 2023 -->
  88. {{ lastUpdated(project.updatedAt) }}
  89. </td>
  90. <td class="pr-6">
  91. <div class="relative flex justify-end items-center">
  92. <button
  93. type="button"
  94. class="w-8 h-8 bg-white inline-flex items-center justify-center text-gray-400 rounded-full hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500"
  95. id="project-options-menu-0-button"
  96. aria-expanded="false"
  97. aria-haspopup="true"
  98. >
  99. <span class="sr-only">Open options</span>
  100. <!-- Heroicon name: solid/dots-vertical -->
  101. <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  102. <path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
  103. </svg>
  104. </button>
  105. <!--
  106. Dropdown menu, show/hide based on menu state.
  107. Entering: "transition ease-out duration-100"
  108. From: "transform opacity-0 scale-95"
  109. To: "transform opacity-100 scale-100"
  110. Leaving: "transition ease-in duration-75"
  111. From: "transform opacity-100 scale-100"
  112. To: "transform opacity-0 scale-95"
  113. -->
  114. <div
  115. class="hidden mx-3 origin-top-right absolute right-7 top-0 w-48 mt-1 rounded-md shadow-lg z-10 bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-200 focus:outline-none"
  116. role="menu"
  117. aria-orientation="vertical"
  118. aria-labelledby="project-options-menu-0-button"
  119. tabindex="-1"
  120. >
  121. <div class="py-1" role="none">
  122. <!-- Active: "bg-gray-100 text-gray-900", Not Active: "text-gray-700" -->
  123. <a href="javascript://" class="text-gray-700 group flex items-center px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="project-options-menu-0-item-0">
  124. <!-- Heroicon name: solid/pencil-alt -->
  125. <svg class="mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  126. <path d="M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z" />
  127. <path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z" clip-rule="evenodd" />
  128. </svg>
  129. Edit
  130. </a>
  131. <a href="javascript://" class="text-gray-700 group flex items-center px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="project-options-menu-0-item-1">
  132. <!-- Heroicon name: solid/duplicate -->
  133. <svg class="mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  134. <path d="M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z" />
  135. <path d="M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z" />
  136. </svg>
  137. Duplicate
  138. </a>
  139. <a href="javascript://" class="text-gray-700 group flex items-center px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="project-options-menu-0-item-2">
  140. <!-- Heroicon name: solid/user-add -->
  141. <svg class="mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  142. <path d="M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z" />
  143. </svg>
  144. Share
  145. </a>
  146. </div>
  147. <div class="py-1" role="none">
  148. <a href="javascript://" class="text-gray-700 group flex items-center px-4 py-2 text-sm" role="menuitem" tabindex="-1" id="project-options-menu-0-item-3">
  149. <!-- Heroicon name: solid/trash -->
  150. <svg class="mr-3 h-5 w-5 text-gray-400 group-hover:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  151. <path
  152. fill-rule="evenodd"
  153. d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z"
  154. clip-rule="evenodd"
  155. />
  156. </svg>
  157. Delete
  158. </a>
  159. </div>
  160. </div>
  161. </div>
  162. </td>
  163. </tr>
  164. <!-- More projects... -->
  165. </tbody>
  166. </table>
  167. </div>
  168. </div>
  169. <!-- Page Section -->
  170. <section class="content hidden">
  171. <div class="container-fluid">
  172. <!-- Default box -->
  173. <div class="card">
  174. <div class="card-header">
  175. <h3 class="card-title">Projects</h3>
  176. <div class="card-tools">
  177. <button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
  178. <i class="fas fa-minus"></i></button>
  179. <button type="button" class="btn btn-tool" data-card-widget="remove" data-toggle="tooltip" title="Remove">
  180. <i class="fas fa-times"></i></button>
  181. </div>
  182. </div>
  183. <div class="card-body p-0">
  184. <table class="table table-striped projects">
  185. <thead>
  186. <tr>
  187. <th style="width: 1%">
  188. #
  189. </th>
  190. <th style="width: 20%">
  191. Project Name
  192. </th>
  193. <th style="width: 30%">
  194. Contributors
  195. </th>
  196. <th>
  197. Progress
  198. </th>
  199. <th style="width: 8%" class="text-center">
  200. Status
  201. </th>
  202. <th style="width: 20%" class="text-right">
  203. Links
  204. </th>
  205. </tr>
  206. </thead>
  207. <tbody>
  208. <tr @click="openProject('apecs-dev-62b422f9')">
  209. <td>
  210. 1
  211. </td>
  212. <td>
  213. <a>
  214. GeoDrop
  215. </a>
  216. <br/>
  217. <small>
  218. Created 2020.02.06
  219. </small>
  220. </td>
  221. <td>
  222. <ul class="list-inline">
  223. <li class="list-inline-item" @click.stop="openProfile('nyusternie')">
  224. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar.png">
  225. </li>
  226. <li class="list-inline-item">
  227. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar2.png">
  228. </li>
  229. <li class="list-inline-item">
  230. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar4.png">
  231. </li>
  232. <li class="list-inline-item">
  233. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar3.png">
  234. </li>
  235. <li class="list-inline-item">
  236. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar5.png">
  237. </li>
  238. <li class="list-inline-item">
  239. +4
  240. </li>
  241. </ul>
  242. </td>
  243. <td class="project_progress">
  244. <div class="progress progress-sm">
  245. <div class="progress-bar bg-yellow" role="progressbar" aria-volumenow="15" aria-volumemin="0" aria-volumemax="100" style="width: 15%">
  246. </div>
  247. </div>
  248. <small>
  249. 15% Complete
  250. </small>
  251. </td>
  252. <td class="project-state">
  253. <span class="badge badge-warning">Started</span>
  254. </td>
  255. <td class="project-actions text-right">
  256. <ProjectsLinks />
  257. </td>
  258. </tr>
  259. <tr>
  260. <td>
  261. 2
  262. </td>
  263. <td>
  264. <a>
  265. Unstoppable Web
  266. </a>
  267. <br/>
  268. <small>
  269. Created 2020.01.01
  270. </small>
  271. </td>
  272. <td>
  273. <ul class="list-inline">
  274. <li class="list-inline-item">
  275. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar.png">
  276. </li>
  277. <li class="list-inline-item">
  278. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar4.png">
  279. </li>
  280. </ul>
  281. </td>
  282. <td class="project_progress">
  283. <div class="progress progress-sm">
  284. <div class="progress-bar bg-green" role="progressbar" aria-volumenow="60" aria-volumemin="0" aria-volumemax="100" style="width: 60%">
  285. </div>
  286. </div>
  287. <small>
  288. 60% Complete
  289. </small>
  290. </td>
  291. <td class="project-state">
  292. <span class="badge badge-success">BUIDLing</span>
  293. </td>
  294. <td class="project-actions text-right">
  295. <ProjectsLinks />
  296. </td>
  297. </tr>
  298. <tr>
  299. <td>
  300. 3
  301. </td>
  302. <td>
  303. <a>
  304. Tommygun's Coin Slot
  305. </a>
  306. <br/>
  307. <small>
  308. Created 2019.10.23
  309. </small>
  310. </td>
  311. <td>
  312. <ul class="list-inline">
  313. <li class="list-inline-item">
  314. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar5.png">
  315. </li>
  316. </ul>
  317. </td>
  318. <td class="project_progress">
  319. <div class="progress progress-sm">
  320. <div class="progress-bar bg-green" role="progressbar" aria-volumenow="90" aria-volumemin="0" aria-volumemax="100" style="width: 90%">
  321. </div>
  322. </div>
  323. <small>
  324. 90% Complete
  325. </small>
  326. </td>
  327. <td class="project-state">
  328. <span class="badge badge-success">BUIDLing</span>
  329. </td>
  330. <td class="project-actions text-right">
  331. <ProjectsLinks />
  332. </td>
  333. </tr>
  334. <tr>
  335. <td>
  336. 4
  337. </td>
  338. <td>
  339. <a>
  340. Paytaca
  341. </a>
  342. <br/>
  343. <small>
  344. Created 2020.02.01
  345. </small>
  346. </td>
  347. <td>
  348. <ul class="list-inline">
  349. <li class="list-inline-item">
  350. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar.png">
  351. </li>
  352. <li class="list-inline-item">
  353. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar4.png">
  354. </li>
  355. <li class="list-inline-item">
  356. <img alt="Avatar" class="table-avatar" src="@/assets/img/avatar3.png">
  357. </li>
  358. </ul>
  359. </td>
  360. <td class="project_progress">
  361. <div class="progress progress-sm">
  362. <div class="progress-bar bg-red" role="progressbar" aria-volumenow="5" aria-volumemin="0" aria-volumemax="100" style="width: 12%">
  363. </div>
  364. </div>
  365. <small>
  366. 5% Complete
  367. </small>
  368. </td>
  369. <td class="project-state">
  370. <span class="badge badge-danger">Planning</span>
  371. </td>
  372. <td class="project-actions text-right">
  373. <ProjectsLinks />
  374. </td>
  375. </tr>
  376. </tbody>
  377. </table>
  378. </div>
  379. <!-- /.card-body -->
  380. </div>
  381. <!-- /.card -->
  382. </div><!--/. container-fluid -->
  383. </section>
  384. </main>
  385. </template>
  386. <script>
  387. /* Initialize vuex. */
  388. // import { mapState } from 'vuex'
  389. /* Import modules. */
  390. import moment from 'moment'
  391. /* Import (local) components. */
  392. import Pinned from './Pinned'
  393. export default {
  394. components: {
  395. Pinned,
  396. },
  397. data: () => {
  398. return {
  399. projects: null
  400. }
  401. },
  402. head: () => ({
  403. title: 'Projects — APECS Dev',
  404. meta: [
  405. {
  406. hid: 'description', // `vmid` for it as it will not work
  407. name: 'description',
  408. content: `Projects`
  409. }
  410. ]
  411. }),
  412. computed: {
  413. // ...mapState({
  414. // /* System */
  415. // apiUrl: state => state.system.apiUrl,
  416. // }),
  417. },
  418. methods: {
  419. openProfile(_profileId) {
  420. this.$router.push(`/u/${_profileId}`)
  421. },
  422. openProject(_projectId) {
  423. this.$router.push(`/p/${_projectId}`)
  424. },
  425. lastUpdated(_timestamp) {
  426. return moment.unix(_timestamp).fromNow()
  427. }
  428. },
  429. created: async function () {
  430. this.projects = []
  431. this.projects.push({
  432. id: '56f0ab0d-8e26-4c11-a582-fd5210344db4',
  433. title: 'Wally Dice',
  434. blockchain: 'Nexa',
  435. createdAt: 1672565691,
  436. updatedAt: 1672565691
  437. })
  438. this.projects.push({
  439. id: '58848682-e4df-4a3b-a1a8-3d8086b2330c',
  440. title: 'Use Cash',
  441. blockchain: 'Bitcoin Cash',
  442. createdAt: 1672565712,
  443. updatedAt: 1672565712
  444. })
  445. },
  446. mounted: function () {
  447. //
  448. }
  449. }
  450. </script>