Skip to content

Commit

Permalink
Fix the drop downs in the edit post and edit draft interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
MetroWind committed Sep 29, 2024
1 parent 41a8f1d commit bde0126
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/post.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ std::string Post::markupToStr(Markup m)
switch(m)
{
case COMMONMARK:
return "commonmark";
return "CommonMark";
case ASCIIDOC:
return "asciidoc";
return "AsciiDoc";
}
std::unreachable();
}
Expand Down
12 changes: 8 additions & 4 deletions templates/edit_draft.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ <h1>{{ blog_title }}</h1>
</tr>
<tr>
<td><label for="language">Language</label></td>
<td><select name="language" id="DropDownLanguage" value="{{ post.language }}">
<td><select name="language" id="DropDownLanguage">
{% for lang in languages %}
{% if lang == post.language %}
<option value="{{ lang }}" selected>{{ lang }}</option>
{% else %}
<option value="{{ lang }}">{{ lang }}</option>
{% endif %}
{% endfor %}
</select></td>
</tr>
<tr>
<td><label for="markup">Markup</label></td>
<td><select name="markup" id="DropDownMarkup" value="{{ post.markup }}">
<option value="CommonMark">CommonMark</option>
<option value="AsciiDoc">AsciiDoc</option>
<td><select name="markup" id="DropDownMarkup">
<option value="CommonMark" {% if post.markup == "CommonMark" %}selected{% endif %}>CommonMark</option>
<option value="AsciiDoc"{% if post.markup == "AsciiDoc" %}selected{% endif %}>AsciiDoc</option>
</select></td>
</tr>
</table>
Expand Down
12 changes: 8 additions & 4 deletions templates/edit_post.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,21 @@ <h1>{{ blog_title }}</h1>
</tr>
<tr>
<td><label for="language">Language</label></td>
<td><select name="language" id="DropDownLanguage" value="{{ post.language }}">
<td><select name="language" id="DropDownLanguage">
{% for lang in languages %}
{% if lang == post.language %}
<option value="{{ lang }}" selected>{{ lang }}</option>
{% else %}
<option value="{{ lang }}">{{ lang }}</option>
{% endif %}
{% endfor %}
</select></td>
</tr>
<tr>
<td><label for="markup">Markup</label></td>
<td><select name="markup" id="DropDownMarkup" value="{{ post.markup }}">
<option value="CommonMark">CommonMark</option>
<option value="AsciiDoc">AsciiDoc</option>
<td><select name="markup" id="DropDownMarkup">
<option value="CommonMark" {% if post.markup == "CommonMark" %}selected{% endif %}>CommonMark</option>
<option value="AsciiDoc"{% if post.markup == "AsciiDoc" %}selected{% endif %}>AsciiDoc</option>
</select></td>
</tr>
</table>
Expand Down

0 comments on commit bde0126

Please sign in to comment.