Skip to content

Commit

Permalink
fixed styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutvikrj26 committed May 11, 2024
1 parent bbf261c commit 70b7a7c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 19 deletions.
4 changes: 3 additions & 1 deletion physionet-django/console/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@
path('process_pages/<process_slug>/show/', views.process_pages_show, name='process_pages_show'),
path('process_pages/step_details/<int:step_pk>/show/', views.step_details_show, name='step_details_show'),
path('process_pages/step_details/<int:step_details_pk>/edit/', views.step_details_edit, name='step_details_edit'),
path('process_pages/step_details/<int:step_details_pk>/delete/', views.step_details_delete, name='step_details_delete'),
path('process_pages/step_details/<int:step_details_pk>/delete/',
views.step_details_delete, name='step_details_delete'),

path('licenses/', views.license_list, name='license_list'),
path('licenses/<int:pk>/', views.license_detail, name='license_detail'),
Expand Down Expand Up @@ -195,6 +196,7 @@
'step_pk': 1,
'step_details_pk': 1,
}

TEST_CASES = {
'manage_published_project': {
'project_slug': 'demoeicu',
Expand Down
5 changes: 5 additions & 0 deletions physionet-django/console/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2860,6 +2860,7 @@ def static_page_sections_edit(request, page_pk, section_pk):
{'section_form': section_form, 'page': static_page, 'section': section},
)


@console_permission_required('physionet.change_staticpage')
def process_pages(request):
"""
Expand All @@ -2872,6 +2873,7 @@ def process_pages(request):
'console/process_pages/index.html',
{'processes': processes})


@console_permission_required('physionet.change_staticpage')
def process_pages_show(request, process_slug):
"""
Expand All @@ -2884,6 +2886,7 @@ def process_pages_show(request, process_slug):
'console/process_pages/show.html',
{'steps': steps, 'process_name': process.title})


@console_permission_required('physionet.change_staticpage')
def step_details_show(request, step_pk):
"""
Expand All @@ -2897,6 +2900,7 @@ def step_details_show(request, step_pk):
'console/process_pages/step_details/index.html',
{'step': step, 'step_details': step_details})


@console_permission_required('physionet.change_staticpage')
def step_details_edit(request, step_details_pk):
"""
Expand All @@ -2917,6 +2921,7 @@ def step_details_edit(request, step_details_pk):
'console/process_pages/step_details/edit.html',
{'step_detail': step_detail, 'step_details_form': step_details_form})


@console_permission_required('physionet.change_staticpage')
def step_details_delete(request, step_details_pk):
step_detail = get_object_or_404(StepDetails, pk=step_details_pk)
Expand Down
25 changes: 14 additions & 11 deletions physionet-django/project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ def project_overview(request, project_slug, **kwargs):

project_overview_step = Step.objects.get(slug='create_project_overview')
project_overview_step_details = StepDetails.objects.filter(step=project_overview_step)
step_details_dict = { step_detail.slug: step_detail for step_detail in project_overview_step_details }
step_details_dict = {step_detail.slug: step_detail for step_detail in project_overview_step_details}

return render(request, 'project/project_overview.html',
{'project':project, 'is_submitting':is_submitting,
'under_submission':under_submission,
'submitting_author':kwargs['authors'].get(is_submitting=True),
'under_submission': under_submission,
'submitting_author': kwargs['authors'].get(is_submitting=True),
'step_details_dict': step_details_dict})


Expand Down Expand Up @@ -649,7 +649,7 @@ def project_authors(request, project_slug, **kwargs):
edit_affiliations_url = reverse('edit_affiliation', args=[project.slug])
project_authors_step = Step.objects.get(slug='create_project_authors')
project_authors_step_details = StepDetails.objects.filter(step=project_authors_step)
step_details_dict = { step_detail.slug: step_detail for step_detail in project_authors_step_details }
step_details_dict = {step_detail.slug: step_detail for step_detail in project_authors_step_details}


return render(
Expand Down Expand Up @@ -787,7 +787,7 @@ def project_content(request, project_slug, **kwargs):

project_content_step = Step.objects.get(slug='create_project_content')
project_content_step_details = StepDetails.objects.filter(step=project_content_step)
step_details_dict = { step_detail.slug: step_detail for step_detail in project_content_step_details }
step_details_dict = {step_detail.slug: step_detail for step_detail in project_content_step_details}

response = render(request, 'project/project_content.html', {'project':project,
'description_form':description_form, 'reference_formset':reference_formset,
Expand Down Expand Up @@ -893,11 +893,14 @@ def project_discovery(request, project_slug, **kwargs):
step_details_dict = {step_detail.slug: step_detail for step_detail in project_discovery_step_details}

return render(request, 'project/project_discovery.html',
{'project': project, 'discovery_form': discovery_form,
'publication_formset': publication_formset,
'step_details_dict': step_details_dict,
'topic_formset': topic_formset, 'add_item_url': edit_url,
'remove_item_url': edit_url, 'is_submitting': is_submitting})
{'project': project,
'discovery_form': discovery_form,
'publication_formset': publication_formset,
'step_details_dict': step_details_dict,
'topic_formset': topic_formset,
'add_item_url': edit_url,
'remove_item_url': edit_url,
'is_submitting': is_submitting})


class ProjectAutocomplete(autocomplete.Select2QuerySetView):
Expand Down Expand Up @@ -1372,7 +1375,7 @@ def project_proofread(request, project_slug, **kwargs):
step_details_dict = {step_detail.slug: step_detail for step_detail in project_proofread_step_details}

return render(request, 'project/project_proofread.html',
{'project':kwargs['project'], 'step_details_dict': step_details_dict})
{'project': kwargs['project'], 'step_details_dict': step_details_dict})


@project_auth(auth_mode=0)
Expand Down
2 changes: 1 addition & 1 deletion physionet-django/user/management/commands/loaddemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def handle(self, *args, **options):

# load Copy for create project process
project_copy_fixtures = os.path.join(settings.BASE_DIR, 'physionet',
'fixtures', 'project_copy.json')
'fixtures', 'project_copy.json')
call_command('loaddata', project_copy_fixtures, verbosity=1)

# Load SSO login instruction static page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@
"""
import os

import sys
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand


class Command(BaseCommand):

def handle(self, *args, **options):
# If not in development, prompt warning messages twice
if 'development' not in settings.ENVIRONMENT:
warning_messages = ['You are NOT in the development environment. Are you sure you want to insert demo data? [y/n]',
'The demo data will be mixed with existing data. Are you sure? [y/n]',
'Final warning. Are you ABSOLUTELY SURE? [y/n]']
warning_messages = [
'You are NOT in the development environment. Are you sure you want to insert demo data? [y/n]',
'The demo data will be mixed with existing data. Are you sure? [y/n]',
'Final warning. Are you ABSOLUTELY SURE? [y/n]'
]
for i in range(3):
choice = input(warning_messages[i]).lower()
if choice != 'y':
Expand All @@ -30,5 +33,5 @@ def handle(self, *args, **options):

# Load licences and software languages
sections_fixtures = os.path.join(settings.BASE_DIR, 'physionet',
'fixtures', 'steps.json')
call_command('loaddata', sections_fixtures, verbosity=1)
'fixtures', 'project_copy.json')
call_command('loaddata', sections_fixtures, verbosity=1)

0 comments on commit 70b7a7c

Please sign in to comment.