55@section (' title' , ' Version Manager Dashboard' )
66
77@section (' content' )
8- <div id = " dashboard-app " class =" max-w-7xl mx-auto px-4 sm:px-6 lg:px-8" >
8+ <div class =" max-w-7xl mx-auto px-4 sm:px-6 lg:px-8" >
99 <!-- Page Header -->
1010 <div class =" mb-8" >
1111 <div class =" flex items-center justify-between" >
3737 <div class =" ml-5 w-0 flex-1" >
3838 <dl >
3939 <dt class =" text-sm font-medium text-gray-500 truncate" >Total Versions</dt >
40- <dd class =" text-lg font-medium text-gray-900" >@ {{ statistics. total_versions }}</dd >
40+ <dd class =" text-lg font-medium text-gray-900" >{{ $ statistics[ ' total_versions' ] ?? 0 } } </dd >
4141 </dl >
4242 </div >
4343 </div >
5555 <div class =" ml-5 w-0 flex-1" >
5656 <dl >
5757 <dt class =" text-sm font-medium text-gray-500 truncate" >Active Versions</dt >
58- <dd class =" text-lg font-medium text-gray-900" >@ {{ statistics. active_versions }}</dd >
58+ <dd class =" text-lg font-medium text-gray-900" >{{ $ statistics[ ' active_versions' ] ?? 0 } } </dd >
5959 </dl >
6060 </div >
6161 </div >
7373 <div class =" ml-5 w-0 flex-1" >
7474 <dl >
7575 <dt class =" text-sm font-medium text-gray-500 truncate" >Total Users</dt >
76- <dd class =" text-lg font-medium text-gray-900" >@ {{ statistics. total_users }}</dd >
76+ <dd class =" text-lg font-medium text-gray-900" >{{ $ statistics[ ' total_users' ] ?? 0 } } </dd >
7777 </dl >
7878 </div >
7979 </div >
9191 <div class =" ml-5 w-0 flex-1" >
9292 <dl >
9393 <dt class =" text-sm font-medium text-gray-500 truncate" >This Month</dt >
94- <dd class =" text-lg font-medium text-gray-900" >@ {{ statistics. versions_this_month }}</dd >
94+ <dd class =" text-lg font-medium text-gray-900" >{{ $ statistics[ ' versions_this_month' ] ?? 0 } } </dd >
9595 </dl >
9696 </div >
9797 </div >
109109 </a >
110110 </div >
111111 <div class =" flow-root" >
112- <ul class =" -mb-8" >
113- <li v-for =" version in recentVersions" :key =" version.id" >
114- <div class =" relative pb-8" >
115- <span class =" absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden =" true" ></span >
116- <div class =" relative flex space-x-3" >
117- <div >
118- <span class =" h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white" >
119- <svg class =" h-5 w-5 text-white" xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
120- <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
121- </svg >
122- </span >
123- </div >
124- <div class =" min-w-0 flex-1 pt-1.5 flex justify-between space-x-4" >
125- <div >
126- <p class =" text-sm text-gray-500" >
127- Version <span class =" font-medium text-gray-900" >@ {{ version.version }}</span >
128- <span class =" font-medium text-gray-900" >@ {{ version.title }}</span >
129- </p >
130- <p class =" text-sm text-gray-500" >@ {{ version.description }}</p >
131- </div >
132- <div class =" text-right text-sm whitespace-nowrap text-gray-500" >
133- <time :datetime =" version.released_at" >@ {{ formatDate(version.released_at) }}</time >
112+ @if ($recentVersions -> count () > 0 )
113+ <ul class =" -mb-8" >
114+ @foreach ($recentVersions as $index => $version )
115+ <li >
116+ <div class =" relative pb-8" >
117+ @if ($index < $recentVersions -> count () - 1 )
118+ <span class =" absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200" aria-hidden =" true" ></span >
119+ @endif
120+ <div class =" relative flex space-x-3" >
121+ <div >
122+ <span class =" h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center ring-8 ring-white" >
123+ <svg class =" h-5 w-5 text-white" xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
124+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
125+ </svg >
126+ </span >
127+ </div >
128+ <div class =" min-w-0 flex-1 pt-1.5 flex justify-between space-x-4" >
129+ <div >
130+ <p class =" text-sm text-gray-500" >
131+ Version <span class =" font-medium text-gray-900" >{{ $version -> version } } </span >
132+ <span class =" font-medium text-gray-900" >{{ $version -> title } } </span >
133+ </p >
134+ <p class =" text-sm text-gray-500" >
135+ {{ $version -> whatsNew -> count () } } features
136+ @if ($version -> is_active )
137+ <span class =" inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800" >
138+ Active
139+ </span >
140+ @else
141+ <span class =" inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800" >
142+ Draft
143+ </span >
144+ @endif
145+ </p >
146+ </div >
147+ <div class =" text-right text-sm whitespace-nowrap text-gray-500" >
148+ <time datetime =" {{ $version -> released_at } }" >{{ $version -> released_at ? $version -> released_at -> format (' M j, Y' ) : ' No date' } } </time >
149+ </div >
150+ </div >
134151 </div >
135152 </div >
136- </div >
153+ </li >
154+ @endforeach
155+ </ul >
156+ @else
157+ <div class =" text-center py-8" >
158+ <svg class =" mx-auto h-12 w-12 text-gray-400" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
159+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10" />
160+ </svg >
161+ <h3 class =" mt-2 text-sm font-medium text-gray-900" >No versions yet</h3 >
162+ <p class =" mt-1 text-sm text-gray-500" >Get started by creating your first version.</p >
163+ <div class =" mt-6" >
164+ <a href =" {{ route (' version-manager.versions.create' ) } }" class =" inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" >
165+ <svg class =" w-4 h-4 mr-2" xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
166+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M12 4v16m8-8H4" />
167+ </svg >
168+ Create Version
169+ </a >
137170 </div >
138- </li >
139- </ ul >
171+ </div >
172+ @endif
140173 </div >
141174 </div >
142175 </div >
143176</div >
144-
145- <script >
146- const { createApp } = Vue;
147-
148- createApp ({
149- data () {
150- return {
151- statistics: @json ($statistics ?? [] ),
152- recentVersions: @json ($recentVersions ?? [] ),
153- }
154- },
155- methods: {
156- formatDate (dateString ) {
157- if (! dateString) return ' ' ;
158- return new Date (dateString).toLocaleDateString ();
159- }
160- }
161- }).mount (' #dashboard-app' );
162- </script >
163177@endsection
0 commit comments