Add "powered by Astuto" (#298)

This commit is contained in:
Riccardo Graziosi
2024-02-27 18:32:14 +01:00
committed by GitHub
parent ea694508bb
commit a700c07394
15 changed files with 72 additions and 7 deletions

View File

@@ -5,15 +5,16 @@ import SearchFilter from './SearchFilter';
import PostStatusFilter from './PostStatusFilter';
import PostList from './PostList';
import Sidebar from '../common/Sidebar';
import SortByFilter from './SortByFilter';
import DateFilter from './DateFilter';
import PoweredByLink from '../common/PoweredByLink';
import IBoard from '../../interfaces/IBoard';
import ITenantSetting from '../../interfaces/ITenantSetting';
import { PostsState } from '../../reducers/postsReducer';
import { PostStatusesState } from '../../reducers/postStatusesReducer';
import SortByFilter from './SortByFilter';
import { SortByFilterValues } from '../../actions/changeFilters';
import DateFilter from './DateFilter';
interface Props {
board: IBoard;
@@ -138,6 +139,8 @@ class BoardP extends React.Component<Props> {
currentFilter={filters.postStatusIds}
handleFilterClick={handlePostStatusFilterChange}
/>
{ tenantSetting.show_powered_by && <PoweredByLink /> }
</Sidebar>
<PostList

View File

@@ -16,6 +16,7 @@ import PostBoardLabel from '../common/PostBoardLabel';
import PostStatusLabel from '../common/PostStatusLabel';
import Comments from '../../containers/Comments';
import Sidebar from '../common/Sidebar';
import PoweredByLink from '../common/PoweredByLink';
import { LikesState } from '../../reducers/likesReducer';
import { CommentsState } from '../../reducers/commentsReducer';
@@ -194,6 +195,8 @@ class PostP extends React.Component<Props> {
isLoggedIn={isLoggedIn}
/>
{ tenantSetting.show_powered_by && <PoweredByLink /> }
</Sidebar>
<div className="postAndCommentsContainer">

View File

@@ -25,6 +25,7 @@ export interface ISiteSettingsGeneralForm {
locale: string;
showVoteCount: boolean;
showVoteButtonInBoard: boolean;
showPoweredBy: boolean;
rootBoardId?: string;
showRoadmapInHeader: boolean;
collapseBoardsInHeader: string;
@@ -48,6 +49,7 @@ interface Props {
collapseBoardsInHeader: string,
showVoteCount: boolean,
showVoteButtonInBoard: boolean,
showPoweredBy: boolean,
authenticityToken: string
): Promise<any>;
}
@@ -73,6 +75,7 @@ const GeneralSiteSettingsP = ({
locale: originForm.locale,
showVoteCount: originForm.showVoteCount,
showVoteButtonInBoard: originForm.showVoteButtonInBoard,
showPoweredBy: originForm.showPoweredBy,
rootBoardId: originForm.rootBoardId,
showRoadmapInHeader: originForm.showRoadmapInHeader,
collapseBoardsInHeader: originForm.collapseBoardsInHeader,
@@ -90,6 +93,7 @@ const GeneralSiteSettingsP = ({
data.collapseBoardsInHeader,
data.showVoteCount,
data.showVoteButtonInBoard,
data.showPoweredBy,
authenticityToken
).then(res => {
if (res?.status !== HttpStatus.OK) return;
@@ -235,6 +239,15 @@ const GeneralSiteSettingsP = ({
<br />
<div className="formGroup">
<div className="checkboxSwitch">
<input {...register('showPoweredBy')} type="checkbox" id="show_powered_by_checkbox" />
<label htmlFor="show_powered_by_checkbox">{ getLabel('tenant_setting', 'show_powered_by') }</label>
</div>
</div>
<br />
<Button onClick={() => null} disabled={!isDirty}>
{I18n.t('common.buttons.update')}
</Button>

View File

@@ -0,0 +1,12 @@
import * as React from 'react';
import I18n from 'i18n-js';
const PoweredByLink = () => (
<div className="poweredBy">
<a href="http://astuto.io/?utm_campaign=poweredby" target="_blank">
{ I18n.t('common.powered_by') } Astuto
</a>
</div>
);
export default PoweredByLink;