1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

Allow writing short rich descriptions for each subscription plan

This commit is contained in:
Sylvain 2021-03-08 14:09:11 +01:00
parent 303c0a0ba8
commit 10fbea9289
7 changed files with 90 additions and 52 deletions

View File

@ -1,10 +1,12 @@
# Changelog Fab-manager
## Next release
- Allow writing short rich descriptions for each subscription plan
- Allow inserting hyperlinks in customized info messages
- Improved scripts for mounting volumes
- Increased verbosity of upgrade script
- Fix a bug: mounting the payment-schedules volume in the docker-compose file results in an invalid file
- [TODO DEPLOY] `rails fablab:maintenance:rebuild_stylesheet`
## v4.7.3 2021 March 03
- Improved the setup script
@ -19,7 +21,7 @@
- Fix a bug: unable to upgrade using the easy upgrade command
- Fix a security issue: possible SQL injection when dropping the database
- Fix a security issue: restrict allowed keys when creating/updating credits
- [TODO DEPLOY] `bundle exec rails fablab:openlab:bulk_export` if you have enabled OpenLab (projects sharing)
- [TODO DEPLOY] `rails fablab:openlab:bulk_export` if you have enabled OpenLab (projects sharing)
## v4.7.1 2021 February 24
- Fix a security issue: updated axios to 0.21.1 to fix [CVE-2020-28168](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-28168)

View File

@ -106,26 +106,28 @@ const PlanCard: React.FC<PlanCardProps> = ({ plan, userId, subscribedPlanId, ope
</div>
</div>}
</div>
{hasDescription() && <div className="plan-description" dangerouslySetInnerHTML={{__html: plan.description}}/>}
{hasAttachment() && <a className="info-link" href={ plan.plan_file_url } target="_blank">{ t('app.public.plans.more_information') }</a>}
{canSubscribeForMe() && <div className="cta-button">
{!hasSubscribedToThisPlan() && <button className={`subscribe-button ${isSelected ? 'selected-card' : ''}`}
onClick={handleSelectPlan}
disabled={!_.isNil(subscribedPlanId)}>
{userId && <span>{t('app.public.plans.i_choose_that_plan')}</span>}
{!userId && <span>{t('app.public.plans.i_subscribe_online')}</span>}
</button>}
{hasSubscribedToThisPlan() && <button className="subscribe-button selected-card" disabled>
{ t('app.public.plans.i_already_subscribed') }
</button>}
</div>}
{canSubscribeForOther() && <div className="cta-button">
<button className={`subscribe-button ${isSelected ? 'selected-card' : ''}`}
onClick={handleSelectPlan}
disabled={_.isNil(userId)}>
<span>{ t('app.public.plans.i_choose_that_plan') }</span>
</button>
</div>}
<div className="card-footer">
{hasDescription() && <div className="plan-description" dangerouslySetInnerHTML={{__html: plan.description}}/>}
{hasAttachment() && <a className="info-link" href={ plan.plan_file_url } target="_blank">{ t('app.public.plans.more_information') }</a>}
{canSubscribeForMe() && <div className="cta-button">
{!hasSubscribedToThisPlan() && <button className={`subscribe-button ${isSelected ? 'selected-card' : ''}`}
onClick={handleSelectPlan}
disabled={!_.isNil(subscribedPlanId)}>
{userId && <span>{t('app.public.plans.i_choose_that_plan')}</span>}
{!userId && <span>{t('app.public.plans.i_subscribe_online')}</span>}
</button>}
{hasSubscribedToThisPlan() && <button className="subscribe-button selected-card" disabled>
{ t('app.public.plans.i_already_subscribed') }
</button>}
</div>}
{canSubscribeForOther() && <div className="cta-button">
<button className={`subscribe-button ${isSelected ? 'selected-card' : ''}`}
onClick={handleSelectPlan}
disabled={_.isNil(userId)}>
<span>{ t('app.public.plans.i_choose_that_plan') }</span>
</button>
</div>}
</div>
</div>
);
}

View File

@ -64,6 +64,14 @@ class PlanController {
return file._destroy = true;
}
};
/**
* Check and limit
* @param content
*/
$scope.limitDescriptionSize = function (content) {
alert(content);
};
}
}

View File

@ -281,6 +281,13 @@
@include border-radius(0 3px 3px 0);
}
.plan-card {
height: 100%;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.title {
margin: 10px 0;
font-size: rem-calc(16);
@ -348,31 +355,38 @@
}
}
.plan-description {
max-height: 5.2em;
overflow: hidden;
}
.card-footer {
display: flex;
flex-direction: column;
justify-content: space-around;
height: 100%;
.cta-button {
margin: 20px 0;
.subscribe-button {
@extend .btn;
@extend .rounded;
outline: 0;
font-weight: 600;
font-size: rem-calc(16);
background-color: white;
padding-left: 30px;
padding-right: 30px;
.plan-description {
max-height: 5.2em;
overflow: hidden;
}
button.subscribe-button:focus, button.subscribe-button:hover {
outline: 0;
.cta-button {
margin: 20px 0;
.subscribe-button {
@extend .btn;
@extend .rounded;
outline: 0;
font-weight: 600;
font-size: rem-calc(16);
background-color: white;
padding-left: 30px;
padding-right: 30px;
}
button.subscribe-button:focus, button.subscribe-button:hover {
outline: 0;
}
}
.info-link {
margin-top: 1em;
}
}
.info-link {
margin-top: 1em;
}
}

View File

@ -686,3 +686,12 @@ body.container {
text-align: center;
vertical-align: middle;
}
.plan-description-input .medium-editor-input div[medium-editor] {
max-height: 5.2em;
overflow: hidden;
& p:nth-child(2n+3), p:nth-child(2n+4) {
display: none;
}
}

View File

@ -127,7 +127,7 @@
<span class="help-block" translate>{{ 'app.shared.plan.monthly_payment_info' }}</span>
</div>
<div class="input-group m-t-md">
<div class="input-group m-t-md plan-description-input">
<label for="plan[description]" class="control-label m-r-md" translate>{{ 'app.shared.plan.description' }}</label>
<div class="medium-editor-input">
<div ng-model="plan.description" medium-editor options='{"placeholder": "{{ "app.shared.plan.type_a_short_description" | translate }}",

View File

@ -259,9 +259,9 @@ h5:after {
border-color: $secondary;
}
.pricing-panel .cta-button .btn:hover,
.pricing-panel .cta-button .custom-invoice .modal-body .elements li:hover,
.custom-invoice .modal-body .elements .pricing-panel .cta-button li:hover {
.pricing-panel .card-footer .cta-button .btn:hover,
.pricing-panel .card-footer .cta-button .custom-invoice .modal-body .elements li:hover,
.custom-invoice .modal-body .elements .pricing-panel .card-footer .cta-button li:hover {
background-color: $secondary !important;
color: $secondary-text-color;
}
@ -302,11 +302,14 @@ section#cookies-modal div.cookies-consent .cookies-actions button.accept {
}
.pricing-panel {
.cta-button {
button.subscribe-button {
border-color: $secondary;
&.selected-card {
background-color: $secondary;
.card-footer {
.cta-button {
button.subscribe-button {
border-color: $secondary;
&.selected-card {
background-color: $secondary;
}
}
}
}