Пример #1
0
def artists():
    TEMPLATE['title'] = 'Artists'
    artists = Database.get_artists_involved()
    TEMPLATE['artists'] = {
    'visitor' : Database.get_dict_of(artists['visitor'], name='visitor'),
    'local' : Database.get_dict_of(artists['local'], name='local'),
    }
    TEMPLATE['options'] = {
    'tilt' : ['rotate1','rotate-1', '', '', '', '']
    }
    TEMPLATE['description'] = "A list of over 100 local and visiting artists participating in WRMOTA's current exhibit."
    return render_template('site/artists.html', template=TEMPLATE)
Пример #2
0
def view_address_codes():
    TEMPLATE['tables'] = {}
    codes = Database.get_address_codes()

    TEMPLATE['tables']['codes'] = Database.get_dict_of(codes,
                                                       name='codes',
                                                       json=False)
    return render_template('admin/view/address-codes.html', template=TEMPLATE)
Пример #3
0
def readable_data(option):
    db = Database.get_db()
    data = db.execute('''
        SELECT
            color.code,
            address.id as id,
            address.address,
            address.brick,
            address.lat,
            address.lng,
            address.meta as address_meta_id,
            address_meta.installed,
            address.artist as artist_id,
            artist.artist,
            artist.website,
            artist.location,
            artist.meta as artist_meta_id,
            artist_meta.visitor,
            artist_meta.art_received,
            address.audio as audio_id,
            audio.directory as audio_directory,
            audio.name as audio,
            audio.original_filename as original_audio,
            audio.uploaded_by,
            address.image as image_id,
            image.directory as image_directory,
            image.name as image,
            image.original_filename as original_image,
            address.theme as theme_id,
            theme.theme as theme,
            address.story as story_id,
            story.story as story
        FROM
            address
        LEFT JOIN artist ON address.artist = artist.id
        LEFT JOIN media AS audio ON address.audio = audio.id
        LEFT JOIN media AS image ON address.image = image.id
        LEFT JOIN media AS story ON address.story = story.id
        LEFT JOIN color_code AS color ON color.address = address.id
        LEFT JOIN theme AS theme on address.theme = theme.id
        INNER JOIN artist_meta ON address.artist = artist_meta.id
        INNER JOIN address_meta ON address.meta = address_meta.id
    ''').fetchall()

    result = Database.get_dict_of(data)

    if not option or option != 'raw':
        for each in result['data']:
            each['brick'] = Sanitize.brick_as_letter(each['brick'])

            uploaded_by = Sanitize.email_sender(each['uploaded_by'])
            each['uploaded_by'] = uploaded_by['name'] if uploaded_by else each[
                'uploaded_by']

            each['visitor'] = Sanitize.visitor_status(each['visitor'])

    return jsonify(result)
Пример #4
0
def edit_artist_data():
    data = Database.get_dict_of(Database.get_data_artist(), name='artist')
    TEMPLATE['artist'] = data
    cols = ['id', 'artist', 'curator', 'art_received']
    TEMPLATE['tables'] = {'artist': Database.keep_cols_in_dict(data, cols)}

    form = Forms.EditArtistForm()
    form.curator.choices = Forms.get_curators()
    TEMPLATE['form'] = form
    return render_template('admin/task/edit_artist.html', template=TEMPLATE)
Пример #5
0
def view_print_map_data():
    paper = Database.get_dict_of(Database.get_print_map_data(), name='paper')
    for p in paper['data']:
        p['brick'] = Sanitize.brick_as_letter(p['brick'])
        p['visitor'] = Sanitize.visitor_status(p['visitor'])
        p['story'] = '' if p['story'] == None else p['story']

    TEMPLATE['tables'] = {'paper': paper}

    return render_template('admin/view/print-map-data.html', template=TEMPLATE)
Пример #6
0
def view_all_tables():
    TEMPLATE['tables'] = {}
    data = Database.get_all_data()

    for table in data:
        t = data[table]
        TEMPLATE['tables'][t['name']] = Database.get_dict_of(t['data'],
                                                             name=t['name'],
                                                             json=False)

    return render_template('admin/view/data.html', template=TEMPLATE)
Пример #7
0
def code_lookup_for_emails():
    TEMPLATE['tables'] = {}
    codes = Database.get_address_codes()

    codes = Database.get_dict_of(codes, name='codes', json=False)
    for c in codes['data']:
        uploaded_by = Sanitize.email_sender(c['uploaded by'])
        c['brick'] = Sanitize.brick_as_letter(c['brick'])
        c['uploaded by'] = uploaded_by['name'] if uploaded_by else c[
            'uploaded by']
    TEMPLATE['tables']['codes'] = codes
    return render_template('admin/task/find-codes.html', template=TEMPLATE)
Пример #8
0
def send_artist_emails():
    curators = Database.get_curators_list()
    curator_options = {'none': 'no', 'all': 'all'}
    for curator in curators:
        curator_options[curator] = "{}'s".format(curator)
    TEMPLATE['curators'] = curator_options

    filter_options = {
        'none': 'no filter',
        # 'confirmed': 'confirmed',
        'visitor': 'visitor',
        # 'touched_base': 'touched base',
        # 'art_received': 'art received',
    }
    TEMPLATE['options'] = filter_options

    data = Database.get_dict_of(Database.get_data_artist(), name='artist')
    TEMPLATE['artist'] = data

    return render_template('admin/task/send_email.html', template=TEMPLATE)
Пример #9
0
def photo_data():
    db = Database.get_db()
    data = db.execute('''
        SELECT
            color_code.code as code,
            address.id as address_id,
            address.address,
            artist.artist,
            address.image as artwork_id,
            artOriginal.id as artOriginal_id,
            artOriginal.directory as artOriginal_directory,
            artOriginal.name as artOriginal_filename,

            artInstalled1.id as artInstalled1_id,
            artInstalled1.directory as artInstalled1_directory,
            artInstalled1.name as artInstalled1_filename,

            artInstalled2.id as artInstalled2_id,
            artInstalled2.directory as artInstalled2_directory,
            artInstalled2.name as artInstalled2_filename,

            artInstalled3.id as artInstalled3_id,
            artInstalled3.directory as artInstalled3_directory,
            artInstalled3.name as artInstalled3_filename
        FROM
            address
        LEFT JOIN color_code ON color_code.address = address.id
        LEFT JOIN artist ON address.artist = artist.id
        LEFT JOIN artwork ON address.image = artwork.id
        LEFT JOIN address_meta as status on address.meta = status.id
        LEFT JOIN media AS artOriginal ON artwork.original = artOriginal.id
        LEFT JOIN media AS artInstalled1 ON artwork.installed1 = artInstalled1.id
        LEFT JOIN media AS artInstalled2 ON artwork.installed2 = artInstalled2.id
        LEFT JOIN media AS artInstalled3 ON artwork.installed3 = artInstalled3.id
        WHERE address.artist IS NOT NULL
        AND status.installed = 1
    ''').fetchall()

    result = Database.get_dict_of(data)
    return jsonify(result)
Пример #10
0
def print_color_codes():
    codes = Database.get_address_codes()
    TEMPLATE['codes'] = Database.get_dict_of(codes)
    return render_template('admin/task/print-colors.html', template=TEMPLATE)