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

View File

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

View File

@ -18,6 +18,7 @@ return new class extends Migration
$table->string ("status")->nullable (); $table->string ("status")->nullable ();
$table->string ("mood")->nullable (); $table->string ("mood")->nullable ();
$table->string ("about_you")->nullable (); $table->string ("about_you")->nullable ();
$table->text ("blurbs")->nullable ();
// interests // interests
$table->string ("interests_general")->nullable (); $table->string ("interests_general")->nullable ();
@ -26,8 +27,6 @@ return new class extends Migration
$table->string ("interests_television")->nullable (); $table->string ("interests_television")->nullable ();
$table->string ("interests_books")->nullable (); $table->string ("interests_books")->nullable ();
$table->string ("interests_heroes")->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) { Schema::table('users', function (Blueprint $table) {
$table->dropColumn ("bio"); $table->dropColumn ("bio");
$table->dropColumn ("avatar"); $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 }}"> <input type="hidden" name="inReplyTo" value="{{ $inreplyto->note_id }}">
@endif @endif
<input type="text" name="summary" placeholder="Title" size="60"> <input type="text" name="summary" placeholder="Title" style="width: 100%">
<br> <br>
<textarea name="content" placeholder="What's on your mind?" cols="60" rows="5"></textarea> <textarea name="content" placeholder="What's on your mind?" style="width: 100%"></textarea>
<input type="file" name="files[]" accept="image/*" multiple> <input type="file" name="files[]" accept="image/*" multiple><br>
<button type="submit">Post</button> <button type="submit">Post</button>
<small>Markdown is supported</small> <small>Markdown is supported</small>

View File

@ -40,6 +40,23 @@
<br> <br>
<small>max limit: 256 characters</small> <small>max limit: 256 characters</small>
<br> <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> <h1>Interests:</h1>
<br> <br>
<label for="general">General:</label> <label for="general">General:</label>
@ -88,7 +105,7 @@
what you would normally paste into the 'Blurbs' section. Include HTML tags. what you would normally paste into the 'Blurbs' section. Include HTML tags.
</small> </small>
<br> <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> <br>
<input type="submit" value="Save"> <input type="submit" value="Save">
</form> </form>

View File

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