summaryrefslogtreecommitdiff
path: root/public/views/codimd/body.ejs
blob: 5fe3d6bb940ffda7ce8dc90fcd0407105fd22bf3 (plain)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<div class="row ui-content" style="display: none;">
    <div class="ui-edit-area unselectable">
        <textarea id="textit"></textarea>
    </div>
    <div class="ui-view-area">
        <div class="ui-infobar container-fluid unselectable hidden-print">
            <small>
                <span>
                    <span class="ui-lastchangeuser" style="display: none;">&thinsp;<i class="ui-user-icon small" data-toggle="tooltip" data-placement="right"></i></span>
                    <span class="ui-no-lastchangeuser">&thinsp;<i class="fa fa-clock-o fa-fw" style="width: 18px;"></i></span>
                    &nbsp;<span class="text-uppercase ui-status-lastchange"></span>
                    <span class="ui-lastchange text-uppercase"></span>
                </span>
                <span class="ui-permission dropdown pull-right">
                    <a id="permissionLabel" class="ui-permission-label text-uppercase" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                    </a>
                    <ul class="dropdown-menu" aria-labelledby="permissionLabel">
                        <li class="ui-permission-freely"<% if(!allowAnonymous && !allowAnonymousEdits) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> <%= __('Freely - Anyone can edit') %></a></li>
                        <li class="ui-permission-editable"><a><i class="fa fa-shield fa-fw"></i> <%= __('Editable - Signed-in people can edit') %></a></li>
                        <li class="ui-permission-limited"><a><i class="fa fa-id-card fa-fw"></i> <%= __('Limited - Signed-in people can edit (forbid guests)') %></a></li>
                        <li class="ui-permission-locked"><a><i class="fa fa-lock fa-fw"></i> <%= __('Locked - Only owner can edit') %></a></li>
                        <li class="ui-permission-protected"><a><i class="fa fa-umbrella fa-fw"></i> <%= __('Protected - Only owner can edit (forbid guests)') %></a></li>
                        <li class="ui-permission-private"><a><i class="fa fa-hand-stop-o fa-fw"></i> <%= __('Private - Only owner can view & edit') %></a></li>
                        <li class="divider"></li>
                        <li class="ui-delete-note"><a><i class="fa fa-trash-o fa-fw"></i> Delete this note</a></li>
                    </ul>
                </span>
                <br>
                <span class="ui-owner" style="display: none;">
                    &thinsp;<i class="ui-user-icon small" data-toggle="tooltip" data-placement="right"></i>
                    &nbsp;<span class="text-uppercase">owned this note</span>
                </span>
            </small>
        </div>
        <div id="doc" class="markdown-body container-fluid"></div>
        <div class="ui-toc dropup unselectable hidden-print" style="display:none;">
            <div class="pull-right dropdown">
                <a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
                    <i class="fa fa-bars"></i>
                </a>
                <ul id="ui-toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
                </ul>
            </div>
        </div>
        <div id="ui-toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:51px;display:none;"></div>
    </div>
</div>
<!-- clipboard modal -->
<div class="modal fade" id="clipboardModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"><%= __('Import from clipboard') %></h4>
            </div>
            <div class="modal-body">
                <div contenteditable data-ph="<%= __('Paste your markdown or webpage here...') %>" id="clipboardModalContent" style="overflow:auto;max-height:50vh"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
                <button type="button" class="btn btn-danger" id="clipboardModalClear"><%= __('Clear') %></button>
                <button type="button" class="btn btn-primary" id="clipboardModalConfirm"><%= __('Import') %></button>
            </div>
        </div>
    </div>
</div>
<!-- locked modal -->
<div class="modal fade locked-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"><i class="fa fa-lock"></i> <%= __('This note is locked') %></h4>
            </div>
            <div class="modal-body" style="color:black;">
                <h5><%= __('Sorry, only owner can edit this note.') %></h5>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" data-dismiss="modal"><%= __('OK') %></button>
            </div>
        </div>
    </div>
</div>
<!-- limit modal -->
<div class="modal fade limit-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"><i class="fa fa-exclamation-triangle"></i> <%= __('Reach the limit') %></h4>
            </div>
            <div class="modal-body" style="color:black;">
                <h5><%= __("Sorry, you've reached the max length this note can be.") %></h5>
                <strong><%= __('Please reduce the content or divide it to more notes, thank you!') %></strong>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-warning" data-dismiss="modal"><%= __('OK') %></button>
            </div>
        </div>
    </div>
</div>
<!-- message modal -->
<div class="modal fade message-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"></h4>
            </div>
            <div class="modal-body" style="color:black;">
                <h5></h5>
                <a target="_blank" rel="noopener" style="word-break: break-all;"></a>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('OK') %></button>
            </div>
        </div>
    </div>
</div>
<!-- gist import modal -->
<div class="modal fade" id="gistImportModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"><%= __('Import from Gist') %></h4>
            </div>
            <div class="modal-body">
                <input type="url" class="form-control" placeholder="<%= __('Paste your gist url here...') %> (like: https://gist.github.com/username/gistid)" id="gistImportModalContent">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
                <button type="button" class="btn btn-danger" id="gistImportModalClear"><%= __('Clear') %></button>
                <button type="button" class="btn btn-primary" id="gistImportModalConfirm"><%= __('Import') %></button>
            </div>
        </div>
    </div>
</div>
<!-- snippet import modal -->
<div class="modal fade" id="snippetImportModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"><%= __('Import from Snippet') %></h4>
            </div>
            <div class="modal-body">
                <input type="hidden" id="snippetImportModalAccessToken" />
                <input type="hidden" id="snippetImportModalBaseURL" />
                <input type="hidden" id="snippetImportModalVersion" />
                <div class="ui-field-contain" style="display:table;margin-bottom:10px;width:100%;">
                    <div style="display:table-row;margin-bottom:5px;">
                        <label style="display:table-cell;">Project:</label>
                        <select class="form-control" id="snippetImportModalProjects" style="display:table-cell;" disabled="disabled">
                            <option value="init" selected="selected" disabled="disabled"><%= __('Select From Available Projects') %></option>
                        </select>
                    </div>
                    <div style="display:table-row;">
                        <label style="display:table-cell;">Snippet</label>
                        <select class="form-control" id="snippetImportModalSnippets" style="display:table-cell;" disabled="disabled">
                            <option value="init" selected="selected" disabled="disabled"><%= __('Select From Available Snippets') %></option>
                        </select>
                    </div>
                </div>
                <p class="snippet-import-or"><%= __('OR') %></p>
                <input type="url" class="form-control" placeholder="/projects/:id/snippets/:snippet_id" id="snippetImportModalContent" disabled="disabled">
            </div>
            <div class="modal-footer">
                <span id="snippetImportModalLoading"><i class="fa fa-refresh fa-spin fa-fw"></i></span>
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
                <button type="button" class="btn btn-danger" id="snippetImportModalClear"><%= __('Clear') %></button>
                <button type="button" class="btn btn-primary" id="snippetImportModalConfirm" disabled="disabled"><%= __('Import') %></button>
            </div>
        </div>
    </div>
</div>
<!-- snippet export modal -->
<div class="modal fade" id="snippetExportModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"><%= __('Export to Snippet') %></h4>
            </div>
            <div class="modal-body">
                <input type="hidden" id="snippetExportModalAccessToken" />
                <input type="hidden" id="snippetExportModalBaseURL" />
                <input type="hidden" id="snippetExportModalVersion" />
                <div class="ui-field-contain" style="display:table;margin-bottom:10px;width:100%;">
                    <div style="display:table-row;margin-bottom:5px;">
                        <label style="display:table-cell;">Title:</label>
                        <input class="form-control" placeholder="new snippet" type="text" id="snippetExportModalTitle" />
                    </div>
                    <div style="display:table-row;margin-bottom:5px;">
                        <label style="display:table-cell;">File Name:</label>
                        <input class="form-control" placeholder="new_snippet.md" type="text" id="snippetExportModalFileName" />
                    </div>
                    <div style="display:table-row;margin-bottom:5px;">
                        <label style="display:table-cell;">Project:</label>
                        <select class="form-control" id="snippetExportModalProjects" style="display:table-cell;">
                            <option value="init" selected="selected" disabled="disabled"><%= __('Select From Available Projects') %></option>
                        </select>
                    </div>
                    <div style="display:table-row;margin-bottom:5px;">
                        <label style="display:table-cell;">Visibility:</label>
                        <select class="form-control" id="snippetExportModalVisibility" style="display:table-cell;">
                            <option value="" selected="selected" disabled="disabled"><%= __('Select Visibility Level') %></option>
                            <option value="0">Private</option>
                            <option value="10">Internal</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <span id="snippetExportModalLoading"><i class="fa fa-refresh fa-spin fa-fw"></i></span>
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
                <button type="button" class="btn btn-primary" id="snippetExportModalConfirm"><%= __('Export') %></button>
            </div>
        </div>
    </div>
</div>
<!-- delete modal -->
<div class="modal fade delete-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel"><%= __('Are you sure?') %></h4>
            </div>
            <div class="modal-body">
                <h5 class="ui-delete-modal-msg"><%= __('Do you really want to delete this note?') %></h5>
                <strong class="ui-delete-modal-item"><%= __('All users will lose their connection.') %></strong>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><%= __('Cancel') %></button>
                <button type="button" class="btn btn-danger ui-delete-modal-confirm"><%= __('Yes, do it!') %></button>
            </div>
        </div>
    </div>
</div>
<%- include ../shared/refresh-modal %>
<%- include ../shared/signin-modal %>
<%- include ../shared/help-modal %>
<%- include ../shared/revision-modal %>