mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Add "powered by Astuto" (#298)
This commit is contained in:
committed by
GitHub
parent
ea694508bb
commit
a700c07394
@@ -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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
|
||||
12
app/javascript/components/common/PoweredByLink.tsx
Normal file
12
app/javascript/components/common/PoweredByLink.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user