diff --git a/apiserver/apiserver/api/utils.py b/apiserver/apiserver/api/utils.py index 1d54865..9440d6b 100644 --- a/apiserver/apiserver/api/utils.py +++ b/apiserver/apiserver/api/utils.py @@ -157,7 +157,7 @@ def gen_search_strings(): start = time.time() search_strings = {} - for m in models.Member.objects.order_by('-expire_date'): + for m in models.Member.objects.order_by('-expire_date').prefetch_related('user__storage'): string = '{} {} | {} {}'.format( m.preferred_name, m.last_name, @@ -166,11 +166,18 @@ def gen_search_strings(): ) string += ' | ' + m.user.email - string += ' | ' + m.discourse_username + + if m.discourse_username: + string += ' | ' + m.discourse_username + string += ' | ' + str(m.id) + for s in m.user.storage.all(): + string += ' | ' + s.shelf_id + string = string.lower() search_strings[string] = m.id + cache.set('search_strings', search_strings) logger.info('Generated search strings in %s s.', time.time() - start) diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index 824c1ec..74f78e9 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -99,9 +99,9 @@ class SearchViewSet(Base, Retrieve): queryset = queryset.order_by('-vetted_date', '-id') elif sort == 'newest_active': queryset = queryset.filter(paused_date__isnull=True) - queryset = queryset.order_by('-application_date', '-id') + queryset = queryset.order_by('-current_start_date', '-id') elif sort == 'newest_overall': - queryset = queryset.order_by('-application_date', '-id') + queryset = queryset.order_by('-current_start_date', '-id') elif sort == 'oldest_active': queryset = queryset.filter(paused_date__isnull=True) queryset = queryset.order_by('application_date', 'id') @@ -1605,7 +1605,7 @@ class ProtocoinViewSet(Base): memo = 'Protocoin - Purchase spent ₱ {} printing {}'.format( total_cost, - request.data['job_name'], + request.data['job_name'][:100], ) tx = models.Transaction.objects.create( diff --git a/webclient/src/App.js b/webclient/src/App.js index 58ca07b..892e72b 100644 --- a/webclient/src/App.js +++ b/webclient/src/App.js @@ -198,6 +198,11 @@ function App() { as={Link} to='/classes' /> + LCARS2 Display

-
Storage
- - - - ); }; diff --git a/webclient/src/Members.js b/webclient/src/Members.js index 08b3a6e..1deab4f 100644 --- a/webclient/src/Members.js +++ b/webclient/src/Members.js @@ -178,7 +178,7 @@ export function Members(props) {
Member List
-

Search by name, email, Spacebar username, or member ID:

+

Search by name, email, Spacebar username, member ID, or member shelf:

- Joined: {x.member.application_date || 'Unknown'} + {sort === 'newest_active' ? + Started: {x.member.current_start_date || 'Unknown'} + : + Joined: {x.member.application_date || 'Unknown'} + } } diff --git a/webclient/src/Storage.js b/webclient/src/Storage.js index 1f08d54..7e43328 100644 --- a/webclient/src/Storage.js +++ b/webclient/src/Storage.js @@ -47,7 +47,6 @@ function EditStorage(props) { const [loading, setLoading] = useState(false); const [success, setSuccess] = useState(false); const { id } = useParams(); - const history = useHistory(); const handleSubmit = (e) => { if (loading) return; @@ -69,25 +68,11 @@ function EditStorage(props) { }); }; - const saveAndNext = (e) => { - e.preventDefault(); - - handleSubmit(e) - .then(res => { - setStorage(false); - history.push('/storage/' + (parseInt(id) + 1)); - }); - }; - return (
Edit Storage {storage.shelf_id}
- - Save and edit next - -