Initial fixes

This commit is contained in:
2021-12-22 11:58:48 +00:00
parent 77fa2cca67
commit 9d971a5654
10 changed files with 98 additions and 9 deletions

View File

@@ -1,5 +1,7 @@
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %} {% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
{% load markdown_tags %}
{% block content %} {% block content %}
<div class="row my-3 py-3"> <div class="row my-3 py-3">
{% if not request.is_ajax %} {% if not request.is_ajax %}
@@ -43,7 +45,7 @@
{% if perms.RIGS.view_event %} {% if perms.RIGS.view_event %}
<h4>Notes</h4> <h4>Notes</h4>
<hr> <hr>
<p class="dont-break-out">{{ event.notes|linebreaksbr }}</p> <p class="dont-break-out">{{ event.notes|markdown }}</p>
{% endif %} {% endif %}
<br> <br>
{% include 'partials/item_table.html' %} {% include 'partials/item_table.html' %}

View File

@@ -8,11 +8,13 @@
{% block css %} {% block css %}
{{ block.super }} {{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static 'css/selects.css' %}"/> <link rel="stylesheet" type="text/css" href="{% static 'css/selects.css' %}"/>
<link rel="stylesheet" href="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
{% endblock %} {% endblock %}
{% block preload_js %} {% block preload_js %}
{{ block.super }} {{ block.super }}
<script src="{% static 'js/selects.js' %}"></script> <script src="{% static 'js/selects.js' %}"></script>
<script src="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
{% endblock %} {% endblock %}
{% block js %} {% block js %}
@@ -63,6 +65,16 @@
{% endif %} {% endif %}
}); });
$(document).ready(function () { $(document).ready(function () {
setupMDE('#id_description');
setupMDE('#id_notes');
setupMDE('#item_description');
$('#itemModal').on('shown.bs.modal', function (e) {
$('#item_description').data('mde_editor').value(
$('#item_description').val()
);
});
setupItemTable($("#{{ form.items_json.id_for_label }}").val()); setupItemTable($("#{{ form.items_json.id_for_label }}").val());
}); });
$(function () { $(function () {
@@ -345,7 +357,7 @@
<div class="col-sm-12"> <div class="col-sm-12">
<div class="form-group" data-toggle="tooltip" title="Notes on the event. This is only visible to keyholders, and is not displayed on the paperwork"> <div class="form-group" data-toggle="tooltip" title="Notes on the event. This is only visible to keyholders, and is not displayed on the paperwork">
<label for="{{ form.notes.id_for_label }}">{{ form.notes.label }}</label> <label for="{{ form.notes.id_for_label }}">{{ form.notes.label }}</label>
{% render_field form.notes class+="form-control" %} {% render_field form.notes class+="form-control md-enabled" %}
</div> </div>
</div> </div>
{% include 'partials/item_table.html' %} {% include 'partials/item_table.html' %}

View File

@@ -74,6 +74,14 @@
<lineStyle kind="linebelow" start="3,0" stop="3,0" colorName="black"/> <lineStyle kind="linebelow" start="3,0" stop="3,0" colorName="black"/>
<lineStyle kind="linebelow" start="5,0" stop="5,0" colorName="black"/> <lineStyle kind="linebelow" start="5,0" stop="5,0" colorName="black"/>
</blockTableStyle> </blockTableStyle>
<listStyle name="ol"
bulletFormat="%s."
bulletFontSize="10" />
<listStyle name="ul"
start="bulletchar"
bulletFontSize="10"/>
</stylesheet> </stylesheet>
<template > {# Note: page is 595x842 points (1 point=1/72in) #} <template > {# Note: page is 595x842 points (1 point=1/72in) #}

View File

@@ -13,9 +13,7 @@
</para> </para>
<keepInFrame> <keepInFrame>
<para style="style.event_description"> {{ object.description|default_if_none:""|markdown:"rml" }}
{{ object.description|default_if_none:""|markdown:"rml"|linebreaksxml }}
</para>
</keepInFrame> </keepInFrame>
</td> </td>
<td> <td>
@@ -186,7 +184,7 @@
{% if item.description %} {% if item.description %}
</para> </para>
<para style="item_description"> <para style="item_description">
<em>{{ item.description|markdown:"rml"|linebreaksxml }}</em> <em>{{ item.description|markdown:"rml" }}</em>
</para> </para>
<para> <para>
{% endif %} {% endif %}

View File

@@ -1,4 +1,5 @@
{% load namewithnotes from filters %} {% load namewithnotes from filters %}
{% load markdown_tags %}
<div class="card card-info"> <div class="card card-info">
<div class="card-header">Event Info</div> <div class="card-header">Event Info</div>
<div class="card-body"> <div class="card-body">
@@ -46,7 +47,7 @@
<dd class="col-sm-12">&nbsp;</dd> <dd class="col-sm-12">&nbsp;</dd>
<dt class="col-sm-6">Event Description</dt> <dt class="col-sm-6">Event Description</dt>
<dd class="dont-break-out col-sm-12">{{ event.description|linebreaksbr }}</dd> <dd class="dont-break-out col-sm-12">{{ event.description|markdown }}</dd>
<dd class="col-sm-12">&nbsp;</dd> <dd class="col-sm-12">&nbsp;</dd>

View File

@@ -1,8 +1,9 @@
{% load markdown_tags %}
<tr id="item-{{item.pk}}" data-pk="{{item.pk}}" class="item_row"> <tr id="item-{{item.pk}}" data-pk="{{item.pk}}" class="item_row">
<th scope="row"> <th scope="row">
<span class="name">{{ item.name }}</span> <span class="name">{{ item.name }}</span>
<div class="item-description"> <div class="item-description">
<em class="description">{{item.description|linebreaksbr}}</em> <em class="description">{{item.description|markdown}}</em>
</div> </div>
</th> </th>
{% if perms.RIGS.view_event %} {% if perms.RIGS.view_event %}

View File

@@ -27,7 +27,9 @@ function styles(done) {
'node_modules/fullcalendar/main.css', 'node_modules/fullcalendar/main.css',
'node_modules/bootstrap-select/dist/css/bootstrap-select.css', 'node_modules/bootstrap-select/dist/css/bootstrap-select.css',
'node_modules/ajax-bootstrap-select/dist/css/ajax-bootstrap-select.css', 'node_modules/ajax-bootstrap-select/dist/css/ajax-bootstrap-select.css',
'node_modules/flatpickr/dist/flatpickr.css',]) 'node_modules/flatpickr/dist/flatpickr.css',
'node_modules/simplemde/dist/simplemde.min.css'
])
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError)) .pipe(sass().on('error', sass.logError))
.pipe(gulpif(function(file) { return bs_select.includes(file.relative);}, con('selects.css'))) .pipe(gulpif(function(file) { return bs_select.includes(file.relative);}, con('selects.css')))
@@ -62,6 +64,7 @@ function scripts() {
'node_modules/fullcalendar/main.js', 'node_modules/fullcalendar/main.js',
'node_modules/bootstrap-select/dist/js/bootstrap-select.js', 'node_modules/bootstrap-select/dist/js/bootstrap-select.js',
'node_modules/ajax-bootstrap-select/dist/js/ajax-bootstrap-select.js', 'node_modules/ajax-bootstrap-select/dist/js/ajax-bootstrap-select.js',
'node_modules/simplemde/dist/simplemde.min.js',
'node_modules/konami/konami.js', 'node_modules/konami/konami.js',
'pipeline/source_assets/js/**/*.js',]) 'pipeline/source_assets/js/**/*.js',])
.pipe(gulpif(function(file) { return base_scripts.includes(file.relative);}, con('base.js'))) .pipe(gulpif(function(file) { return base_scripts.includes(file.relative);}, con('base.js')))

33
package-lock.json generated
View File

@@ -965,6 +965,19 @@
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
}, },
"codemirror": {
"version": "5.65.0",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.0.tgz",
"integrity": "sha512-gWEnHKEcz1Hyz7fsQWpK7P0sPI2/kSkRX2tc7DFA6TmZuDN75x/1ejnH/Pn8adYKrLEA1V2ww6L00GudHZbSKw=="
},
"codemirror-spell-checker": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz",
"integrity": "sha1-HGYPkIlIPMtRE7m6nKGcP0mTNx4=",
"requires": {
"typo-js": "*"
}
},
"collection-map": { "collection-map": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz",
@@ -3691,6 +3704,11 @@
"object-visit": "^1.0.0" "object-visit": "^1.0.0"
} }
}, },
"marked": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/marked/-/marked-4.0.8.tgz",
"integrity": "sha512-dkpJMIlJpc833hbjjg8jraw1t51e/eKDoG8TFOgc5O0Z77zaYKigYekTDop5AplRoKFGIaoazhYEhGkMtU3IeA=="
},
"matchdep": { "matchdep": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz",
@@ -5641,6 +5659,16 @@
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
"integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==" "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ=="
}, },
"simplemde": {
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/simplemde/-/simplemde-1.11.2.tgz",
"integrity": "sha1-ojo12XjSxA7wfewAjJLwcNjggOM=",
"requires": {
"codemirror": "*",
"codemirror-spell-checker": "*",
"marked": "*"
}
},
"snapdragon": { "snapdragon": {
"version": "0.8.2", "version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@@ -6445,6 +6473,11 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
}, },
"typo-js": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/typo-js/-/typo-js-1.2.1.tgz",
"integrity": "sha512-bTGLjbD3WqZDR3CgEFkyi9Q/SS2oM29ipXrWfDb4M74ea69QwKAECVceYpaBu0GfdnASMg9Qfl67ttB23nePHg=="
},
"ua-parser-js": { "ua-parser-js": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz",

View File

@@ -31,6 +31,7 @@
"node-sass": "^7.0.0", "node-sass": "^7.0.0",
"popper.js": "^1.16.1", "popper.js": "^1.16.1",
"postcss": "^8.4.5", "postcss": "^8.4.5",
"simplemde": "^1.11.2",
"uglify-js": "^3.14.5" "uglify-js": "^3.14.5"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -226,3 +226,33 @@ html.embedded {
max-width: 3em; max-width: 3em;
} }
} }
.markdown {
h1 {
font-size: $h1-font-size * 0.75;
}
h2 {
font-size: $h2-font-size * 0.8;
}
h3 {
font-size: $h3-font-size * 0.85;
}
h4 {
font-size: $h4-font-size * 0.9;
}
h5 {
font-size: $h5-font-size * 0.95;
}
img {
max-width: 100%;
}
}
#rigboard {
.markdown {
img {
max-width: 30rem;
}
}
}