now users can add blurbs

This commit is contained in:
Ghostie 2025-01-05 15:53:09 -05:00
parent ca797a59a8
commit f7b9ff9b8b
6 changed files with 55 additions and 11 deletions

View File

@ -56,12 +56,16 @@ class ProfileController extends Controller
$incoming_fields = $request->validate ([
"avatar" => "image|max:4096",
"bio" => "sometimes|nullable|string",
"about_you" => "sometimes|nullable|string",
"status" => "sometimes|nullable|string",
"mood" => "sometimes|nullable|string",
"general" => "sometimes|nullable|string",
"music" => "sometimes|nullable|string",
"movies" => "sometimes|nullable|string",
"television" => "sometimes|nullable|string",
"books" => "sometimes|nullable|string",
"heroes" => "sometimes|nullable|string"
"heroes" => "sometimes|nullable|string",
"blurbs" => "sometimes|nullable|string"
]);
$user = auth ()->user ();
@ -84,12 +88,18 @@ class ProfileController extends Controller
}
$user->bio = $incoming_fields["bio"];
$user->about_you = $incoming_fields["about_you"];
$user->status = $incoming_fields["status"];
$user->mood = $incoming_fields["mood"];
$user->interests_general = $incoming_fields["general"];
$user->interests_music = $incoming_fields["music"];
$user->interests_movies = $incoming_fields["movies"];
$user->interests_television = $incoming_fields["television"];
$user->interests_books = $incoming_fields["books"];
$user->interests_heroes = $incoming_fields["heroes"];
$user->blurbs = $incoming_fields["blurbs"];
$user->save ();
$user->actor->summary = $user->bio;

View File

@ -24,10 +24,11 @@ class User extends Authenticatable
'password',
"bio",
"avatar",
"status",
"mood",
"about_you",
"mood",
"avatar",
// interests
"interests_general",
@ -35,7 +36,9 @@ class User extends Authenticatable
"interests_movies",
"interests_television",
"interests_books",
"interests_heroes"
"interests_heroes",
"blurbs"
];
/**

View File

@ -18,6 +18,7 @@ return new class extends Migration
$table->string ("status")->nullable ();
$table->string ("mood")->nullable ();
$table->string ("about_you")->nullable ();
$table->text ("blurbs")->nullable ();
// interests
$table->string ("interests_general")->nullable ();
@ -26,8 +27,6 @@ return new class extends Migration
$table->string ("interests_television")->nullable ();
$table->string ("interests_books")->nullable ();
$table->string ("interests_heroes")->nullable ();
$table->integer ("friends")->default (0);
});
}
@ -39,7 +38,18 @@ return new class extends Migration
Schema::table('users', function (Blueprint $table) {
$table->dropColumn ("bio");
$table->dropColumn ("avatar");
$table->dropColumn ("friends");
$table->dropColumn ("status");
$table->dropColumn ("mood");
$table->dropColumn ("about_you");
$table->dropColumn ("blurbs");
$table->dropColumn ("interests_general");
$table->dropColumn ("interests_music");
$table->dropColumn ("interests_movies");
$table->dropColumn ("interests_television");
$table->dropColumn ("interests_books");
$table->dropColumn ("interests_heroes");
});
}
};

View File

@ -5,12 +5,12 @@
<input type="hidden" name="inReplyTo" value="{{ $inreplyto->note_id }}">
@endif
<input type="text" name="summary" placeholder="Title" size="60">
<input type="text" name="summary" placeholder="Title" style="width: 100%">
<br>
<textarea name="content" placeholder="What's on your mind?" cols="60" rows="5"></textarea>
<input type="file" name="files[]" accept="image/*" multiple>
<textarea name="content" placeholder="What's on your mind?" style="width: 100%"></textarea>
<input type="file" name="files[]" accept="image/*" multiple><br>
<button type="submit">Post</button>
<small>Markdown is supported</small>

View File

@ -40,6 +40,23 @@
<br>
<small>max limit: 256 characters</small>
<br>
<br>
<label for="about_you">About you:</label>
<input type="text" name="about_you" id="about_you" value="{{ $user->about_you ? $user->about_you : '' }}">
@error("about_you")
<p class="error">{{ $message }}</p>
@enderror
<br>
<br>
<label for="status">Status:</label>
<input type="text" name="status" id="status" value="{{ $user->status ? $user->status : '' }}">
@error("status")
<p class="error">{{ $message }}</p>
@enderror
<br>
<br>
<label for="mood">Mood:</label>
<input type="text" name="mood" id="mood" value="{{ $user->mood ? $user->mood : '' }}">
<h1>Interests:</h1>
<br>
<label for="general">General:</label>
@ -88,7 +105,7 @@
what you would normally paste into the 'Blurbs' section. Include HTML tags.
</small>
<br>
<textarea name="layout" id="layout" cols="58" placeholder="Layout" disabled></textarea>
<textarea name="blurbs" id="layout" cols="58" placeholder="Layout">{{ $user->blurbs ? $user->blurbs : '' }}</textarea>
<br>
<input type="submit" value="Save">
</form>

View File

@ -257,6 +257,10 @@
<div class="inner">
<div class="section">
<p>{!! $actor->summary !!}</p>
@if ($user)
{!! $user->blurbs !!}
@endif
</div>
</div>
</div>