Skip to content

Commit

Permalink
Merge pull request #583 from bolt/hotfix/distinguish-new-untitled
Browse files Browse the repository at this point in the history
Distinguish between editing "New Page" and "Untitled Page"
  • Loading branch information
bobdenotter authored Aug 16, 2019
2 parents 08abcad + 4e01234 commit 144e19f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 6 additions & 4 deletions templates/content/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
{% for key, fielddefinition in record.definition.fields %}
{% set alltypes = alltypes|merge([fielddefinition.type]) %}
{% endfor %}
{% set displayTitle = record|title|default(record.id ?
__('caption.untitled_contenttype', {'%contenttype%': record.definition.singular_name}) :
__('caption.new_contenttype', {'%contenttype%': record.definition.singular_name}) ) %}


{% block title %}
<span class="admin__header--title__prefix">
Expand All @@ -13,17 +17,15 @@
»
</span>
{{ icon(record) }}
{{ excerpt(record|title, 50)|default('New') }}
{{ displayTitle|excerpt(50) }}
{% endblock %}

{% block vue_id 'editor' %}

{# This 'topsection' gets output _before_ the main form, allowing `dump()`, without breaking Vue #}
{% block topsection %}

{# {{ dump(record.definition.relations) }}#}

{# {{ dump(record|related_all(true, null, false)) }}#}
{# {{ dump(record) }}#}

{% endblock %}

Expand Down
12 changes: 12 additions & 0 deletions translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1839,5 +1839,17 @@
<target>Search</target>
</segment>
</unit>
<unit id="QoeqyPT" name="caption.new_contenttype">
<segment>
<source>caption.new_contenttype</source>
<target>New %contenttype%</target>
</segment>
</unit>
<unit id="n.jOrkg" name="caption.untitled_contenttype">
<segment>
<source>caption.untitled_contenttype</source>
<target>Untitled %contenttype%</target>
</segment>
</unit>
</file>
</xliff>

0 comments on commit 144e19f

Please sign in to comment.