Skip to content

Commit

Permalink
Merge pull request #164 from itk-dev/hotfix/post-question-fixes
Browse files Browse the repository at this point in the history
LOOP-981: Fixed templating issues
  • Loading branch information
martinyde authored Jul 14, 2021
2 parents efcca8b + 74bc660 commit 369c848
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
justify-content: space-between;
margin-bottom: $spacer;
$icon-size: 40px;
$icon-size: 30px;

.header {
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,26 @@
{% import '@os2loop_theme/macros.html.twig' as macros %}

<article{{ attributes.addClass("os2loop-content os2loop-post") }}>
{{ macros.title(label, "post", node, content) }}
{{ macros.title(label, "post", node, content, false) }}
{% include '@os2loop_theme/field/user-info.html.twig' with {user: drupal_entity('user', node.uid.target_id)} %}
<div{{ content_attributes.addClass('bg-secondary-loop') }}>
<div{{ content_attributes.addClass('mt-3 mb-5 px-3') }}>
{{ content.os2loop_post_content }}
{{ content.os2loop_shared_tags }}
{{ content.os2loop_shared_subject }}
{{ content.os2loop_shared_profession }}
{{ content.os2loop_post_file }}
<div class="row mt-3 mt-md-5 py-2 bg-light">
<div class="col-12 col-md-auto">
{{ content.os2loop_shared_tags }}
</div>
<div class="col-12 col-md-auto">
{{ content.os2loop_shared_subject }}
</div>
<div class="col-12 col-md-auto">
{{ content.os2loop_shared_profession }}
</div>
</div>
<div class="row border-top pt-2 pb-3 bg-light rounded-bottom">
<div class="col">
{{ content.os2loop_post_file }}
</div>
</div>
</div>
{{ content.os2loop_post_comments }}
</article>
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
{% import '@os2loop_theme/macros.html.twig' as macros %}

<article{{ attributes.addClass("os2loop-content os2loop-question") }}>
{{ macros.title(label, "question", node, content) }}
{{ macros.title(label, "question", node, content, false) }}
{% include '@os2loop_theme/field/user-info.html.twig' with {user: drupal_entity('user', node.uid.target_id)} %}
<div{{ content_attributes.addClass('mt-3 mt-md-5 mb-5 px-3') }}>
<div{{ content_attributes.addClass('mt-3 mb-5 px-3') }}>
{{ content.os2loop_question_content }}
<div class="row mt-3 mt-md-5 py-2 bg-light">
<div class="col-12 col-md-auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
<section{{ attributes }}>
{% if comments and not label_hidden %}
{{ title_prefix }}
<h2{{ title_attributes }}>{{ label }}</h2>
<h3{{ title_attributes }}>{{ label }}</h3>
{{ title_suffix }}
{% endif %}
{{ comments }}
{% if comment_form %}
<h2{{ content_attributes }}>{{ 'Add new comment'|t }}</h2>
<h3{{ content_attributes }}>{{ 'Add new comment'|t }}</h3>
{% include '@os2loop_theme/field/user-info.html.twig' with {user: drupal_entity('user', user.account.id)} %}
<div class="bg-secondary-loop comment-write-reply">
{{ comment_form }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
<section{{ attributes.addClass('mt-3') }}>
{% if comments and not label_hidden %}
{{ title_prefix }}
<h2{{ title_attributes }}>{{ label }}</h2>
<h3{{ title_attributes }}>{{ label }}</h3>
{{ title_suffix }}
{% endif %}
{{ comments }}
{% if comment_form %}
<h2{{ content_attributes }}>{{ 'Add new comment'|t }}</h2>
<h3{{ content_attributes }}>{{ 'Add new comment'|t }}</h3>
{% include '@os2loop_theme/field/user-info.html.twig' with {user: drupal_entity('user', user.account.id)} %}
<div class="bg-secondary-loop comment-write-reply">
{{ comment_form }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
{% set file_id = media.field_media_image.value[0].target_id %}
{% endif %}
{% set file = drupal_entity('file', file_id)['#file'] %}
<a href="{{ file_url(file.getFileUri()) }}" class="btn btn-sm btn-dark"><i class="bi bi-file-earmark-arrow-down-fill mr-1"></i>{{ file.getFileName() }}</a>
<a href="{{ file_url(file.getFileUri()) }}" class="mb-1 btn btn-sm btn-dark"><i class="bi bi-file-earmark-arrow-down-fill mr-1"></i>{{ file.getFileName() }}</a>
{% endfor %}
{% if multiple %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="title d-flex justify-content-between my-3">
<div class="header">
{{ title_prefix }}
<h1{{ title_attributes }} class="{{ class }}">
<h1{{ title_attributes }} class="{{ class }} h3">
{{ title }}
</h1>
{{ title_suffix }}
Expand Down

0 comments on commit 369c848

Please sign in to comment.