diff --git a/app/assets/stylesheets/_rating.scss b/app/assets/stylesheets/_rating.scss new file mode 100644 index 00000000..63ff73c2 --- /dev/null +++ b/app/assets/stylesheets/_rating.scss @@ -0,0 +1,26 @@ +.rating-container { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + gap: 12px; +} + +.rating-item { + display: flex; + align-items: center; +} + +.interactive-star { + transition: transform 0.25s ease; + + &:hover { + transform: scale(1.3); + } +} + +.login-container { + display: flex; + gap: 4px; + align-items: center; +} diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 2de04ccc..2511eda0 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -7,6 +7,8 @@ def index end def show + @user_review = current_user.reviews.find_by(subject:) if current_user + respond_to do |format| format.html { subject } end diff --git a/app/views/subjects/_rating.html.erb b/app/views/subjects/_rating.html.erb new file mode 100644 index 00000000..d6626b53 --- /dev/null +++ b/app/views/subjects/_rating.html.erb @@ -0,0 +1,33 @@ + diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index ea003271..3720dfae 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -19,6 +19,8 @@ Grupo: Desconocido <% end %> + + <%= render 'rating' %>