Skip to content

Commit f0cf0f7

Browse files
author
Aaron Delaney
authored
Merge pull request #594 from CPSSD/a/fixroguefollowbutton
Fix a few random small bugs
2 parents 4bda091 + 67dd10a commit f0cf0f7

9 files changed

Lines changed: 33 additions & 15 deletions

File tree

chump/rabble_config.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,16 @@
6060
"denied_follow": "Follow denied",
6161
"read_more_text": "Read more",
6262
"reblog_success": "Post reblogged",
63-
"incorrect_credentials": "Incorrect credentials"
63+
"incorrect_credentials": "Incorrect credentials",
64+
"profile": "Profile",
65+
"follow_nav": "Follow",
66+
"like": "Like",
67+
"unlike": "Unlike",
68+
"reblog": "Reblog",
69+
"reblogged": "Reblogged",
70+
"add_tag": "Add a tag",
71+
"blank_fields": "Blank fields are left unchanged",
72+
"current_password": "Enter your current password",
73+
"custom_css": "Custom CSS",
74+
"edit": "Edit"
6475
}

chump/src/components/account_edit.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class AccountEdit extends RootComponent<IAccountEditProps, IAccountEditSt
127127
onSubmit={this.handleUpdate}
128128
>
129129
<fieldset>
130-
<legend>Blank fields are left unchanged</legend>
130+
<legend>{config.blank_fields}</legend>
131131
<div className="pure-control-group">
132132
<label htmlFor="newPassword">{config.new_password}</label>
133133
<input
@@ -170,7 +170,7 @@ export class AccountEdit extends RootComponent<IAccountEditProps, IAccountEditSt
170170
/>
171171
</div>
172172
<div className="pure-control-group">
173-
<label htmlFor="name">{"Custom CSS"}</label>
173+
<label htmlFor="name">{config.custom_css}</label>
174174
<textarea
175175
id="custom_css"
176176
placeholder=".article-title { color: red }"
@@ -191,7 +191,7 @@ export class AccountEdit extends RootComponent<IAccountEditProps, IAccountEditSt
191191
/>
192192
</div>
193193

194-
<legend>Enter your current user account</legend>
194+
<legend>{config.current_password}</legend>
195195
<div className="pure-control-group">
196196
<label htmlFor="name">{config.password}</label>
197197
<input

chump/src/components/create_article_form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export class CreateArticleForm extends RootComponent<IFormProps, IFormState> {
158158
onChange={this.handleTagInputChange}
159159
onlyUnique={true}
160160
maxTags={7}
161+
inputProps={{ className: "react-tagsinput-input", placeholder: config.add_tag }}
161162
/>
162163
<textarea
163164
name="blogText"

chump/src/components/edit_button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class EditButton extends RootComponent<IEditProps, IEditState> {
4040
className="pure-button pure-input-1-3 pure-button-primary primary-button"
4141
onClick={this.handleEdit}
4242
>
43-
<Edit/> Edit
43+
<Edit/> {config.edit}
4444
</button>
4545
</div>
4646
);

chump/src/components/follow_button.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ export class FollowButton extends RootComponent<IFormProps, IFormState> {
5757
}
5858

5959
public render() {
60-
const sameUser = (this.props.follower === this.props.followed &&
61-
this.props.followed_host === "");
62-
if (this.props.follower === "" || sameUser) {
60+
const noFollower = (typeof this.props.follower === "undefined" ||
61+
this.props.follower === "");
62+
63+
const noHost = (typeof this.props.followed_host === "undefined" ||
64+
this.props.followed_host === "");
65+
66+
if (noFollower || (this.props.follower === this.props.followed && noHost)) {
6367
return null;
6468
}
6569
return (

chump/src/components/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class Header extends React.Component<IHeaderProps, IHeaderState> {
140140
</li>
141141
<li className="pure-menu-item">
142142
<Link to="/follow" className="pure-menu-link nav-action">
143-
<UserPlus size="1em"/> {config.follow_text}
143+
<UserPlus size="1em"/> {config.follow_nav}
144144
</Link>
145145
</li>
146146
</ul>
@@ -173,7 +173,7 @@ class Header extends React.Component<IHeaderProps, IHeaderState> {
173173
<ul id="dropdown" className="menu-dropdown pure-menu-children" style={{display: this.state.display}}>
174174
<li className="pure-menu-item">
175175
<Link to={`/@${this.props.username}`} className="pure-menu-link" onClick={this.resetDropdown}>
176-
Profile
176+
{config.profile}
177177
</Link>
178178
</li>
179179
<li className="pure-menu-item">

chump/src/components/like_button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class LikeButton extends RootComponent<ILikeButtonProps, ILikeButtonState
5050
className="pure-button pure-input-1-3 pure-button-primary primary-button"
5151
onClick={this.handleClick}
5252
>
53-
{this.state.likesCount} <ThumbsUp/> Like
53+
{this.state.likesCount} <ThumbsUp/> {config.like}
5454
</button>
5555
);
5656
}
@@ -61,7 +61,7 @@ export class LikeButton extends RootComponent<ILikeButtonProps, ILikeButtonState
6161
className="pure-button pure-input-1-3 pure-button-primary primary-button"
6262
onClick={this.handleClick}
6363
>
64-
{this.state.likesCount} <ThumbsUp/> Unlike
64+
{this.state.likesCount} <ThumbsUp/> {config.unlike}
6565
</button>
6666
);
6767
}

chump/src/components/reblog_button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class Reblog extends RootComponent<IReblogProps, IReblogState> {
6363
type="submit"
6464
className="pure-button pure-button-primary primary-button"
6565
>
66-
{this.state.sharesCount} <Repeat size="1em"/> Reblog
66+
{this.state.sharesCount} <Repeat size="1em"/> {config.reblog}
6767
</button>
6868
);
6969
}
@@ -75,7 +75,7 @@ export class Reblog extends RootComponent<IReblogProps, IReblogState> {
7575
className="pure-button pure-button-primary primary-button"
7676
disabled={true}
7777
>
78-
{this.state.sharesCount} <Repeat size="1em"/> | Reblogged
78+
{this.state.sharesCount} <Repeat size="1em"/> | {config.reblogged}
7979
</button>
8080
);
8181
}

services/utils/users.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def parse_actor_details(self, actor_uri):
5656
self._logger.warning(f'No actor doc found for user {actor_uri}.')
5757
return None, None, None
5858
handle = actor_doc['preferredUsername']
59-
summary = actor_doc['summary']
59+
summary = ""
60+
if 'summary' in actor_doc:
61+
summary = actor_doc['summary']
6062
host = self._activ_util.normalise_hostname(urlparse(actor_uri).netloc)
6163
return host, handle, summary
6264

0 commit comments

Comments
 (0)