Jake Vanderwerf
2026-02-10 607a0c1c65629e883859f0d17d79ced334ddec4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
 
use JVBase\meta\Form;
 
if (!defined('ABSPATH')) {
    exit;
}
/**
 * Template for replying to a respondable content
 * @return string
 */
function jvbGetReplyTemplate():string
{
    return '<template class="response">
    <details class="response" open>
            <summary class="row btw">
                <div class="header">
 
                </div>
                <div class="content"></div>
                <div class="footer">
                    <span class="created"></span>
                    <a class="artist"></a>
                    <a class="shop"></a>
                </div>
            </summary>
        </details>
    </template>';
}
 
/**
 * Template for replying to another response
 * @return string
 */
function jvbGetReplyToTemplate():string
{
 
 
    $textarea = Form::render('response', null, ['type' => 'textarea','quill' => true, 'label'=>'Your Response']);
    return sprintf('
        <dialog class="create-response">
            <div class="wrap col">
                <h2>Write your Response</h2>
                <div class="original"></div>
                <div class="reply">
                    %s
                </div>
                <div class="actions row">
                    <button type="button" class="cancel">%s</button>
                    <button type="submit" class="create">Reply</button>
                </div>
            </div>
        </dialog>
        ',
    $textarea,
    jvbIcon('x', ['title'=>'Cancel'])
    );
}
 
/**
 * Template for displaying a response
 * @return string
 */
function jvbGetCommentTemplate():string
{
    return '<template class="responses">
        <details class="responses">
            <summary class="row btw">
                Comments
            </summary>
        </details>
    </template>';
}
 
function jvbGetEmptyStateTemplate()
{
    return '<template class="emptyState">
        <div class="empty-state">
            <h3>Nothing here</h3>
            <p>It doesn\'t look like you have any <span></span> yet.</p>
            <p><small><i>Add some by uploading images above.</i></small></p>
        </div>
    </template>';
}
 
function jvbGetGalleryPreviewTemplate()
{
    return '<template class="galleryPreview">
        <div class="preview-item" draggable="true">
            <img \>
            <div class="upload-status">
                <div class="upload-progress"></div>
            </div>
            <button type="button" class="remove-preview" title="Remove Image">'.jvbIcon('trash').'</button>
            <button type="button" class="move-image" title="Reorder Image">'.jvbIcon('dots-six-vertical').'</button>
        </div>
    </template>';
}
 
 
function jvbCopyHoursTemplate()
{
    wp_enqueue_script('jvb-copy-hours');
    jvbInlineStyles('copy-hours');
 
    $out = '<template class="copyHours">
            <dialog id="copy-hours">
                <div class="wrap col">
                    <h3>'.__('Copy Hours', 'jvb').'</h3>
 
                    <div class="copy-hours-source">
                        <h4>'.__('From:', 'jvb').'</h4>
                        <div class="source-info col">
                            <div class="source-day"></div>
                            <div class="source-hours row start"></div>
                        </div>
                    </div>
 
                    <div class="copy-hours-targets">
                        <h4>'.__('Apply to:', 'jvb').'</h4>
                        <div class="day-checkboxes">';
 
    foreach (['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'] as $day) {
        $out .= '<input name="copy-to-day" id="copy-to-'.$day.'" value="'.$day.'" type="checkbox">
                            <label for="copy-to-'.$day.'">'.ucfirst($day).'</label>';
    }
    $out .=             '</div>
                    </div>
 
                    '.jvbModalActions().'
                </div>
            </dialog>
    </template>
    <template class="blankButton">
        <button></button>
    </template>';
 
    echo '<div class="feedback" id="copy-success-feedback">
            <p>'.jvbIcon('check').'<span>Hours copied to 1 day successfully!</span></p>
        </div>';
    return $out;
}