From d3c58f41ed6c47b1f317bb4f3dbde2284e80ab6b Mon Sep 17 00:00:00 2001 From: Benoit Alessandroni <benoit@happy-dev.fr> Date: Wed, 18 Mar 2020 22:59:26 +0100 Subject: [PATCH] Fixing the style of the related resources --- src/includes/components/widgets.pug | 36 +++++++++++++++++-- .../entrepreneur/resources/detail.pug | 19 +++++----- src/includes/mentor/dashboard.pug | 21 +++++++++++ src/includes/mentor/resources/detail.pug | 13 ------- src/includes/public/resources/detail.pug | 24 ++++++------- src/styles/index.scss | 10 +++++- 6 files changed, 83 insertions(+), 40 deletions(-) diff --git a/src/includes/components/widgets.pug b/src/includes/components/widgets.pug index 4e771484..c409ff24 100644 --- a/src/includes/components/widgets.pug +++ b/src/includes/components/widgets.pug @@ -76,9 +76,41 @@ sib-widget(name='cs-display-checkbox') input(type='checkbox' name="instance_database_only") label(for="instance_database_only") Search in Coopstarter database only -sib-widget(name='cs-display-related-property') +sib-widget(name='cs-display-mentor-database-related') template - p #[a(href="${value.name}")] ${await value.name} + p + sib-link( + bind-resources + data-src="${await value}" + next="mentor-database-resource-detail" + ) ${await value.name} + +sib-widget(name='cs-display-mentor-related') + template + p + sib-link( + bind-resources + data-src="${await value}" + next="mentor-resource-detail" + ) ${await value.name} + +sib-widget(name='cs-display-public-related') + template + p + sib-link( + bind-resources + data-src="${await value}" + next="public-resource-detail" + ) ${await value.name} + +sib-widget(name='cs-display-entrepreneur-related') + template + p + sib-link( + bind-resources + data-src="${await value}" + next="entrepreneur-resource-detail" + ) ${await value.name} sib-widget(name='cs-display-multiple-property') template diff --git a/src/includes/entrepreneur/resources/detail.pug b/src/includes/entrepreneur/resources/detail.pug index b1c9509b..2246a924 100644 --- a/src/includes/entrepreneur/resources/detail.pug +++ b/src/includes/entrepreneur/resources/detail.pug @@ -120,18 +120,15 @@ nested-field="conversations" ) - //- h2.title_lead_avenir=`${data.RelatedResources}` + h2.title_lead_avenir=`${data.RelatedResources}` - //- sib-display( - //- bind-resources, - //- nested-field="related" - //- fields="name, detail" - - //- widget-name='cs-display-property' - //- label-detail='' - //- widget-detail='sib-action' - //- action-detail='entrepreneur-resource-detail' - //- ) + sib-display( + bind-resources + fields="related" + multiple-related + widget-related='cs-display-entrepreneur-related' + label-related='' + ) diff --git a/src/includes/mentor/dashboard.pug b/src/includes/mentor/dashboard.pug index f34fb096..d30d8763 100644 --- a/src/includes/mentor/dashboard.pug +++ b/src/includes/mentor/dashboard.pug @@ -37,8 +37,19 @@ section#home div#detail-mentor-loader hidden i.fas.fa-spinner.fa-spin + include resources/detail.pug + h2.title_lead_avenir=`${data.RelatedResources}` + + sib-display( + bind-resources + fields="related" + multiple-related + widget-related='cs-display-mentor-related' + label-related='' + ) + #mentor-database(hidden).no-sidebar.container include resources/database.pug @@ -55,6 +66,16 @@ section#home include resources/detail.pug + h2.title_lead_avenir=`${data.RelatedResources}` + + sib-display( + bind-resources + fields="related" + multiple-related + widget-related='cs-display-mentor-database-related' + label-related='' + ) + #mentor-resource-create(hidden).no-sidebar.container sib-link(class="backlink", next="mentor-resource-list")=`${data.BackToDashboard}` include resources/create.pug diff --git a/src/includes/mentor/resources/detail.pug b/src/includes/mentor/resources/detail.pug index f791b3c1..875da38f 100644 --- a/src/includes/mentor/resources/detail.pug +++ b/src/includes/mentor/resources/detail.pug @@ -110,18 +110,5 @@ sib-conversation( nested-field="conversations" ) -//- h2.title_lead_avenir=`${data.RelatedResources}` - -//- sib-display( -//- bind-resources, -//- nested-field="related" -//- fields="name, detail" - -//- widget-name='cs-display-property' -//- label-detail='' -//- widget-detail='sib-action' -//- action-detail='mentor-resource-detail' -//- ) - diff --git a/src/includes/public/resources/detail.pug b/src/includes/public/resources/detail.pug index be2e29e2..0caf2742 100644 --- a/src/includes/public/resources/detail.pug +++ b/src/includes/public/resources/detail.pug @@ -70,8 +70,8 @@ label-country.name=`${data.Country}` label-submitter.mentorProfile.organisation.name=`${data.Organisation}` label-author=`${data.Author}` - label-submitter=`${data.ResourcePostedBy}` - label-review.reviewer=`${data.ResourceValidatedBy}` + label-submitter=`${data.ResourcePostedBy}: ` + label-review.reviewer=`${data.ResourceValidatedBy}: ` action-broken='resource-report-broken-link-public' ) @@ -121,16 +121,14 @@ nested-field="conversations" ) - //- h2.title_lead_avenir=`${data.RelatedResources}` + + h2.title_lead_avenir=`${data.RelatedResources}` - //- sib-display( - //- bind-resources, - //- nested-field="related" - //- fields="name, detail" - - //- widget-name='cs-display-property' - //- label-detail='' - //- widget-detail='sib-action' - //- action-detail='public-resource-detail' - //- ) + sib-display( + bind-resources + fields="related" + multiple-related + widget-related='cs-display-public-related' + label-related='' + ) diff --git a/src/styles/index.scss b/src/styles/index.scss index 78e387a8..ddc6347f 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1668,7 +1668,9 @@ div#entrepreneur-resource-detail cs-display-property[name="name"].title_form p { } sib-set-default[name="specifications"]>cs-display-resource-property, -sib-set-default[name="specifications"]>sib-multiple { +sib-set-default[name="specifications"]>sib-multiple, +cs-display-entrepreneur-related, cs-display-mentor-related, +cs-display-mentor-database-related, cs-display-public-related { display: block; float: left; width: 33%; @@ -1684,6 +1686,12 @@ sib-set-default[name="specifications"]>sib-multiple { } } +cs-display-entrepreneur-related, cs-display-mentor-related, +cs-display-public-related { + cursor: pointer; + margin-left: 1px; +} + .sib-conversation div.conversation-form{ border: none; position: relative; -- GitLab