Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar Issue #236

Merged
merged 13 commits into from
May 2, 2018
Merged

Avatar Issue #236

merged 13 commits into from
May 2, 2018

Conversation

joooseb
Copy link
Contributor

@joooseb joooseb commented May 1, 2018

Added the logic to set avatar to user

@nabeelio
Copy link
Owner

nabeelio commented May 1, 2018

I'm looking to see why the build failed

/**
* Return a File model
*/
public function getAvatarAttribute()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need this so we can call $user->avatar->url, which will form the correct URL (look at Models/File.php)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s me check again to make other commit please

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. It's just so the URL is formed correctly and if they want to use the Laravel file storage going to a different place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see File model, so that logic didn't make me sense, but now I have corrected these lines.

<div class="input-group form-group-no-border{{ $errors->has('avatar') ? ' has-danger' : '' }}">
{{ Form::file('avatar', null) }}
</div>
<p class="small">This avatar will be rezise to {{ config('phpvms.avatar.width'). ' x '. config('phpvms.avatar.height') }}</p>
Copy link
Owner

@nabeelio nabeelio May 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should read as "resized"

@if ($user->avatar == null)
<img src="{{ $user->gravatar(512) }}" style="width: 123px;">
@else
<img src="{{ url($user->avatar) }}" style="width: 123px;">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be $user->avatar->url. Or public_asset($user->avatar), if the path to the profile image is uploads/avatar/ etc

@nabeelio
Copy link
Owner

nabeelio commented May 1, 2018

Can you also comment out this line: tests/MetarTest.php:41 . That's what's failing the tests

refactoring other methods this will work
corrected string
Changed src call for user avatar, this will return the correct url based on avatar attribute of User Model
corrected the path to user avatar based on get avatar attribute on user model
@joooseb
Copy link
Contributor Author

joooseb commented May 1, 2018

Should work now

Resize method only works with numbers as a parameter, is not necessary to put px at the end.
@nabeelio nabeelio merged commit 6430225 into nabeelio:dev May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants