Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase size of plain text editor #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ckanext/pages/theme/resources/styles/pages.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.page-list-item .image {
width: 168px;
/* hack for default theme */

}
.page-list-item .image a {
display: block;
Expand All @@ -15,3 +14,6 @@
.page-list-item h3 a {
display: block;
}
.page-simple-form-height {
height: 400px !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of !important. Wouldn't it be better to target the form via its ID (#field-content) in addition with a custom class?

Also, page-simple-form-height as a name doesn't tell me much. I'd also prefer a pages prefix for namespacing. How about pages-text-editor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has nothing to do with the other editors. In fact there the pixel heights are set and for the plain text editor no height is set which is what I am trying to improve.

I think !important here is justified as we are overriding the normal CKAN behaviour as we are using this form in a weird way. It might have been/be better overall to not use this macro to create the form.

With page vs. pages - I am following the convention in the existing CSS. Simple-form-height seems a lot more precise to me vs. text-editor (see comment above).

Regarding the first commit, that is me pulling in the latest ckanext-pages changes, but in a rather stupid way via. the GitHub UI.

}
3 changes: 3 additions & 0 deletions ckanext/pages/theme/resources/styles/pages.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
.page-list-item h3 a {
display:block;
}
.page-simple-form-height {
height: 400px !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h1>{{ _('Edit page') }}</h1>
</div>
<textarea id="field-content-ck" name="content" placeholder="{{_('My content')}}" data-module="ckedit" style="height:400px" data-module-site_url="{{ h.dump_json(h.url('/', locale='default', qualified=true)) }}"> {{ data.content }}</textarea>
{% else %}
{{ form.markdown('content', id='field-content', label=_('Content'), placeholder=_('Enter content here'), value=data.content, error=errors.content) }}
{{ form.markdown('content', id='field-content', attrs={'class': 'form-control page-simple-form-height'}, label=_('Content'), placeholder=_('Enter content here'), value=data.content, error=errors.content) }}
{% endif %}

<div class="form-actions">
Expand Down