Skip to content

Commit

Permalink
fix: minor updates and access panel logic added
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Aug 9, 2024
1 parent ba43250 commit 346f292
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 51 deletions.
12 changes: 12 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ public function linkedSocialAccounts()
{
return $this->hasMany(LinkedSocialAccount::class);
}

/**
* Check if user can access a particular panel.
*/
public function canAccessPanel(Panel $panel): bool
{
if ($panel->getId() === 'control-panel') {
return $this->roles()->exists();
}

return true;
}
}
94 changes: 49 additions & 45 deletions resources/views/livewire/download.blade.php
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
<div class="mt-8 min-h-screen border-b py-16 isolate">
<div class="mx-auto mt-12 max-w-6xl px-6 lg:px-8">
<div class="mx-auto max-w-2xl lg:mx-0 lg:max-w-none">
<h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
Download
</h2>
<p class="mt-1 text-sm leading-6 text-gray-500">Version: August 2024</p>
<div class="mt-6 flex flex-col gap-x-8 gap-y-20 lg:flex-row">
<div class="lg:w-full lg:max-w-2xl lg:flex-auto">
<div>
<h2 class="text-base font-semibold leading-7 text-gray-900"></h2>
<p class="mt-1 text-sm leading-6 text-gray-500">The data is released under the Creative
Commons CC0 license, allowing for free use, modification, and distribution without any
restrictions. No attribution is required when utilizing this data.</p>
<div class="mx-auto h-screen mt-20 border-b pt-20 max-w-6xl px-6 lg:px-8">
<div class="mx-auto max-w-2xl lg:mx-0 lg:max-w-none">
<h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
Download
</h2>
<p class="mt-1 text-sm leading-6 text-gray-500">Version: August 2024</p>
<div class="mt-6 flex flex-col gap-x-8 gap-y-20 lg:flex-row">
<div class="lg:w-full lg:max-w-2xl lg:flex-auto">
<div>
<h2 class="text-base font-semibold leading-7 text-gray-900"></h2>
<p class="mt-1 text-sm leading-6 text-gray-500">The data is released under the Creative
Commons CC0 license, allowing for free use, modification, and distribution without any
restrictions. No attribution is required when utilizing this data.</p>

<dl class="mt-6 space-y-6 divide-y divide-gray-100 border-t border-gray-200 text-sm leading-6">
<div class="pt-6 sm:flex">
<dt class="font-medium text-gray-900 sm:w-64 sm:flex-none sm:pr-6">Download Natural
Products Structures in SDF</dt>
<dd class="mt-1 flex justify-between gap-x-6 sm:mt-0 sm:flex-auto">
<div class="text-gray-900">&emsp;</div>
<button type="button"
class="font-semibold text-indigo-600 hover:text-indigo-500">Download (coming soon)</button>
</dd>
</div>
<div class="pt-6 sm:flex">
<dt class="font-medium text-gray-900 sm:w-64 sm:flex-none sm:pr-6">Download the complete
COCONUT dataset as a PostgreSQL dump
</dt>
<dd class="mt-1 flex justify-between gap-x-6 sm:mt-0 sm:flex-auto">
<div class="text-gray-900">&emsp;</div>
<a href="https://coconut.s3.uni-jena.de/prod/downloads/coconut-08-2024.sql" type="button"
class="font-semibold text-indigo-600 hover:text-indigo-500">Download</a>
</dd>
</div>
<div class="pt-6 sm:flex">
<dt class="font-medium text-gray-900 sm:w-64 sm:flex-none sm:pr-6">Download Natural
Products Structures in CSV format</dt>
<dd class="mt-1 flex justify-between gap-x-6 sm:mt-0 sm:flex-auto">
<div class="text-gray-900">&emsp;</div>
<a href="https://coconut.s3.uni-jena.de/prod/downloads/coconut-08-2024.csv" type="button"
class="font-semibold text-indigo-600 hover:text-indigo-500">Download</a>
</dd>
</div>
</dl>
</div>
<dl class="mt-6 space-y-6 divide-y divide-gray-100 border-t border-gray-200 text-sm leading-6">
<div class="pt-6 sm:flex">
<dt class="font-medium text-gray-900 sm:w-64 sm:flex-none sm:pr-6">Download Natural
Products Structures in SDF</dt>
<dd class="mt-1 flex justify-between gap-x-6 sm:mt-0 sm:flex-auto text-right">
<div class="text-gray-900">&emsp;</div>
<a href="https://coconut.s3.uni-jena.de/prod/downloads/coconut-08-2024.sdf.zip"
type="button"
class="font-semibold text-indigo-600 hover:text-indigo-500">Download <br />
coconut-08-2024.sdf - 364.1 MB</a>
</dd>
</div>
<div class="pt-6 sm:flex">
<dt class="font-medium text-gray-900 sm:w-64 sm:flex-none sm:pr-6">Download the complete
COCONUT dataset as a PostgreSQL dump
</dt>
<dd class="mt-1 flex justify-between gap-x-6 sm:mt-0 sm:flex-auto text-right">
<div class="text-gray-900">&emsp;</div>
<a href="https://coconut.s3.uni-jena.de/prod/downloads/coconut-08-2024.sql"
type="button"
class="font-semibold text-indigo-600 hover:text-indigo-500">Download <br />
coconut-08-2024.sql - 20.94 GB</a>
</dd>
</div>
<div class="pt-6 sm:flex">
<dt class="font-medium text-gray-900 sm:w-64 sm:flex-none sm:pr-6">Download Natural
Products Structures in CSV format</dt>
<dd class="mt-1 flex justify-between gap-x-6 sm:mt-0 sm:flex-auto text-right">
<div class="text-gray-900">&emsp;</div>
<a href="https://coconut.s3.uni-jena.de/prod/downloads/coconut-08-2024.csv"
type="button"
class="font-semibold text-indigo-600 hover:text-indigo-500">Download <br />
coconut-08-2024.csv - 209.2 MB</a>
</dd>
</div>
</dl>
</div>
</div>
</div>
Expand Down
75 changes: 69 additions & 6 deletions resources/views/livewire/structure-editor.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class="z-20 inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-le
<div class="py-3">
<div id="structureSearchEditor" class="border mb-3" style="height: 400px; width: 100%">
</div>
<button @click="fetchClipboardText"
<a @click="fetchClipboardText"
class="mt-3 w-full inline-flex justify-center rounded-md shadow-sm px-4 py-2 bg-white-600 text-base font-medium hover:bg-white-700 focus:outline-none sm:w-auto sm:text-sm border">
Paste from Clipboard
</button>
</a>
</div>
<fieldset class="mt-1">
<legend class="contents text-base font-medium text-gray-900">
Expand Down Expand Up @@ -100,10 +100,73 @@ class="mt-3 w-full inline-flex justify-center rounded-md border border-transpare
@if ($mode && $mode == 'inline')
<button type="button" @click="isOpen = true"
class="rounded-md text-gray-900 bg-white mr-3 py-3 px-2 text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-secondary-dark focus:ring-offset-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="mr-3 ml-2 h-6 w-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75" />
<svg class="w-6 h-6 mx-2 mx-auto" viewBox="0 0 78 78" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_1_2)">
<path d="M70.1638 11.819L66.3621 23.4827" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M68.0431 32.4052L74.8966 41.819" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M68.0431 51.2586L74.8966 41.819" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M65.8448 49.6293L71.5086 41.819" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M61.0603 54.3621L48.6983 50.3793" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M48.6983 50.3793V33.2845" stroke="black" stroke-width="1.13386" stroke-linecap="round"
stroke-linejoin="round" />
<path d="M45.9828 48.8017V34.8621" stroke="black" stroke-width="1.13386" stroke-linecap="round"
stroke-linejoin="round" />
<path d="M61.0603 29.3017L48.6983 33.2845" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M48.6983 33.2845L33.9052 24.75" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M32.5345 25.5259V12.4397" stroke="black" stroke-width="1.13386" stroke-linecap="round"
stroke-linejoin="round" />
<path d="M35.2759 25.5259V12.4397" stroke="black" stroke-width="1.13386" stroke-linecap="round"
stroke-linejoin="round" />
<path d="M33.9052 24.75L22.7845 31.1638" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M19.1121 37.9397V50.3793" stroke="black" stroke-width="1.13386" stroke-linecap="round"
stroke-linejoin="round" />
<path d="M20.4828 51.1552L9.10345 57.7241" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M19.1121 48.8017L7.73276 55.3707" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M19.1121 50.3793L30.2069 56.7672" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M48.6983 50.3793L37.6034 56.7672" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path d="M33.9052 63.569V75.9828" stroke="black" stroke-width="1.13386" stroke-linecap="round"
stroke-linejoin="round" />
<path d="M15.4138 31.1638L4.31897 24.75" stroke="black" stroke-width="1.13386"
stroke-linecap="round" stroke-linejoin="round" />
<path
d="M62.5345 24.9569H63.6466L66.3879 30.1552V24.9569H67.2155V31.1638H66.0776L63.3362 25.9914V31.1638H62.5345V24.9569Z"
fill="black" />
<path
d="M62.5345 52.5H63.6466L66.3879 57.6983V52.5H67.2155V58.7069H66.0776L63.3362 53.5345V58.7069H62.5345V52.5Z"
fill="black" />
<path
d="M33.9052 5.12069C33.2845 5.12069 32.7931 5.34482 32.431 5.7931C32.069 6.24138 31.8879 6.86207 31.8879 7.65517C31.8879 8.43103 32.069 9.05172 32.431 9.51724C32.7931 9.96551 33.2845 10.1897 33.9052 10.1897C34.5086 10.1897 34.9914 9.96551 35.3535 9.51724C35.7155 9.06896 35.8966 8.44827 35.8966 7.65517C35.8966 6.87931 35.7155 6.25862 35.3535 5.7931C34.9914 5.34482 34.5086 5.12069 33.9052 5.12069ZM33.9052 4.44827C34.7672 4.44827 35.4569 4.74138 35.9741 5.32758C36.4914 5.91379 36.75 6.69827 36.75 7.68103C36.75 8.66379 36.4914 9.44827 35.9741 10.0345C35.4569 10.6207 34.7672 10.9138 33.9052 10.9138C33.0259 10.9138 32.3276 10.6207 31.8103 10.0345C31.2931 9.44827 31.0345 8.66379 31.0345 7.68103C31.0345 6.69827 31.2931 5.91379 31.8103 5.32758C32.3276 4.74138 33.0259 4.44827 33.9052 4.44827Z"
fill="black" />
<path
d="M16.7586 30.181H17.8707L20.6121 35.3793V30.181H21.4397V36.3879H20.3017L17.5603 31.2155V36.3879H16.7586V30.181Z"
fill="black" />
<path
d="M4.31897 56.3793C3.69828 56.3793 3.2069 56.6034 2.84483 57.0517C2.48276 57.5 2.30172 58.1207 2.30172 58.9138C2.30172 59.6897 2.48276 60.3103 2.84483 60.7759C3.2069 61.2241 3.69828 61.4483 4.31897 61.4483C4.92241 61.4483 5.40517 61.2241 5.76724 60.7759C6.12931 60.3276 6.31035 59.7069 6.31035 58.9138C6.31035 58.1379 6.12931 57.5172 5.76724 57.0517C5.40517 56.6034 4.92241 56.3793 4.31897 56.3793ZM4.31897 55.681C5.18103 55.681 5.87069 55.9741 6.38793 56.5603C6.90517 57.1465 7.16379 57.931 7.16379 58.9138C7.16379 59.8965 6.90517 60.681 6.38793 61.2672C5.87069 61.8534 5.18103 62.1465 4.31897 62.1465C3.43966 62.1465 2.74138 61.8534 2.22414 61.2672C1.7069 60.681 1.44828 59.8965 1.44828 58.9138C1.44828 57.931 1.7069 57.1465 2.22414 56.5603C2.74138 55.9741 3.43966 55.681 4.31897 55.681Z"
fill="black" />
<path
d="M31.5517 55.8103H32.6638L35.4052 61.0086V55.8103H36.2328V62.0172H35.0948L32.3535 56.8448V62.0172H31.5517V55.8103Z"
fill="black" />
<path fill-rule="evenodd" clip-rule="evenodd"
d="M61.194 0.892153L70.1146 9.91002C70.6816 10.4859 71 11.2659 71 12.0792C71 12.8924 70.6816 13.6724 70.1146 14.2483L65.1786 19.2692L51.9689 5.89107L56.932 0.892153C57.502 0.320612 58.2717 0 59.0739 0C59.876 0 60.6457 0.320612 61.2157 0.892153H61.194ZM43.5211 41.1808L32.7957 44.5391C25.2666 46.1907 25.3319 47.9249 26.729 40.7348L30.3385 27.8301L49.4682 8.42906L62.678 21.8072L43.532 41.1973L43.5211 41.1808ZM32.5891 30.1149L41.2869 38.9235L34.2199 41.1257C28.7023 42.8489 28.7295 43.9995 30.2298 38.6207L32.5891 30.1424V30.1149Z"
fill="black" />
</g>
<defs>
<clipPath id="clip0_1_2">
<rect width="77.5862" height="78" fill="white" />
</clipPath>
</defs>
</svg>
</button>
@else
Expand Down

0 comments on commit 346f292

Please sign in to comment.