Exemplo n.º 1
0
def showDownloadStats(request):

    context = {"downloadsJSON": getDownloadsStatsToJSON()}

    context = base_grid(request, context)

    return render_to_response('home/download_stats.html', context)
Exemplo n.º 2
0
def download_form(request):
    
    desktop_utils = django_settings.STATIC_URL + "js/download_utils.js"
    context = {"download_utils": desktop_utils }
    context = base_grid(request, context)
    context.update(csrf(request))
    return render_to_response('home/download_form.html', context)
Exemplo n.º 3
0
def download_form(request):

    desktop_utils = django_settings.STATIC_URL + "js/download_utils.js"
    context = {"download_utils": desktop_utils}
    context = base_grid(request, context)
    context.update(csrf(request))
    return render_to_response('home/download_form.html', context)
Exemplo n.º 4
0
def download_form(request):
    # Load the downloadables data
    downloadables = loadDownloadables()

    context = {
        "download_utils": getResource("js/download_utils.js"),
        "downloadables": downloadables
    }
    context = base_grid(request, context)
    context.update(csrf(request))
    return render_to_response('home/download_form.2.html', context)
Exemplo n.º 5
0
def service_movies(request):

    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    movies_utils = join(django_settings.STATIC_URL, "js/", "movies_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'movies_utils': movies_utils,
               }
    
    context = base_grid(request, context)
    return render_to_response('movies_projects.html', context)
Exemplo n.º 6
0
def service_movies(request):

    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    movies_utils = join(django_settings.STATIC_URL, "js/", "movies_utils.js")

    context = {
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
        'scipion_mail': getResourceIcon('scipion_mail'),
        'movies_utils': movies_utils,
    }

    context = base_grid(request, context)
    return render_to_response('movies_projects.html', context)
Exemplo n.º 7
0
def resmap_projects(request):
   
    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    myresmap_utils = join(django_settings.STATIC_URL, "js/", "myresmap_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'myresmap_utils': myresmap_utils,
               'hiddenTreeProt': True,
               }
    
    context = base_grid(request, context)
    return render_to_response('resmap_projects.html', context)
Exemplo n.º 8
0
def resmap_projects(request):
   
    if 'projectName' in request.session: request.session['projectName'] = ""
    if 'projectPath' in request.session: request.session['projectPath'] = ""

    myresmap_utils = join(django_settings.STATIC_URL, "js/", "myresmap_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'myresmap_utils': myresmap_utils,
               'hiddenTreeProt': True,
               }
    
    context = base_grid(request, context)
    return render_to_response('resmap_projects.html', context)
Exemplo n.º 9
0
def service_movies(request):
    if CTX_PROJECT_NAME in request.session:
        request.session[CTX_PROJECT_NAME] = ""
    if CTX_PROJECT_PATH in request.session:
        request.session[CTX_PROJECT_PATH] = ""

    movies_utils = getResource("js/movies_utils.js")

    context = {
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
        'scipion_mail': getResourceIcon('scipion_mail'),
        'movies_utils': movies_utils,
    }

    context = base_grid(request, context)
    return render_to_response('movies_projects.html', context)
Exemplo n.º 10
0
def service_projects(request):
   
    if CTX_PROJECT_NAME in request.session: request.session[CTX_PROJECT_NAME] = ""
    if CTX_PROJECT_PATH in request.session: request.session[CTX_PROJECT_PATH] = ""

    myfirstmap_utils = getResource("js/myfirstmap_utils.js")

    context = {'projects_css': getResourceCss('projects'),
               'project_utils_js': getResourceJs('project_utils'),
               'scipion_mail': getResourceIcon('scipion_mail'),
               'myfirstmap_utils': myfirstmap_utils,
               'hiddenTreeProt': True,
               SERVICE_NAME: MYFIRSTMAP_SERVICE
               }
    
    context = base_grid(request, context)
    return render_to_response('service_projects.html', context)
Exemplo n.º 11
0
def particleValidation_projects(request):
    if CTX_PROJECT_NAME in request.session:
        request.session[CTX_PROJECT_NAME] = ""
    if CTX_PROJECT_PATH in request.session:
        request.session[CTX_PROJECT_PATH] = ""

    mypval_utils = getResource("js/mypval_utils.js")

    context = {
        'projects_css': getResourceCss('projects'),
        'project_utils_js': getResourceJs('project_utils'),
        'scipion_mail': getResourceIcon('scipion_mail'),
        'mypval_utils': mypval_utils,
        'hiddenTreeProt': True,
    }

    context = base_grid(request, context)
    return render_to_response('pval_projects.html', context)
Exemplo n.º 12
0
def home(request):
    context = {}
    context = base_grid(request, context)
    return render_to_response('home/index.html', context)
Exemplo n.º 13
0
def home(request):
    context = {}
    context = base_grid(request, context)
    return render_to_response('home/index.html', context)
Exemplo n.º 14
0
def startDownload(request):
    fullName = request.POST.get('fullName')
    organization = request.POST.get('organization')
    email = request.POST.get('email')
    mailoption = request.POST.get('mailoption')
    country = request.POST.get('country')
    bundle = request.POST.get('file')

    errors = ""

    # If full name is None it's a direct access..
    if fullName is None:
        return redirect('app.views_home.download_form')

    if not len(fullName) > 0:
        errors += "Please fill in the fullName field.\n"
    if not len(organization) > 0:
        errors += "Please fill in the Organization field.\n"
    if not len(email) > 0 and validateEmail(email):
        errors += "Please fill in the Email field.\n"
    # if not len(mailoption) > 0:
    #         errors += "Please choose one into the Country field.\n"
    if not len(bundle) > 0:
        errors += "Please fill in the Scipion Version field.\n"

    if len(errors) == 0:

        fileSplit = bundle.split("~")
        version = fileSplit[0]
        platform = fileSplit[1]
        fileName = fileSplit[2]

        mapper = getDownloadsMapper()
        mapper.enableAppend()
        download = DownloadRecord(fullName=fullName,
                                  organization=organization,
                                  email=email,
                                  subscription=mailoption,
                                  country=country,
                                  version=version,
                                  platform=platform)

        mapper.store(download)
        mapper.commit()
        mapper.close()

        # If the user want's to be subscribed
        if mailoption == '0': subscribeToUsersList(email)

        # Return a response with the scipion download file
        path = getInstallPath(fileName)

        if not os.path.exists(path):
            return HttpResponseNotFound('Path not found: %s' % path)

        request.session[FILE_TO_DOWNLOAD] = fileName

        context = {"fileToDownload": fileName}
        context = base_grid(request, context)
        context.update(csrf(request))

        return render_to_response('home/startdownload.html', context)

    else:
        redirect(download_form)