-
Notifications
You must be signed in to change notification settings - Fork 4
add new dashboard page using hotwired #349
base: master
Are you sure you want to change the base?
Conversation
| <div class="form-container mb-4"> | ||
| <!-- Form Header --> | ||
| <div class="d-flex justify-content-between align-items-baseline selected-days-container"> | ||
| <h6>Selecionado (<%= 0 %>)</h6> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n Selecionado
| disabled=<%= true %> | ||
| type="button" | ||
| > | ||
| Remover seleção <i class="fa fa-times-circle fa-sm"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n Remover seleção
| disabled=<%= true %> | ||
| type="button" | ||
| > | ||
| Apagar <i style='color: "#c61515"' class="fa fa-trash fa-sm"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n Apagar
| <div class="row p-3"> | ||
| <div class="col select-container"> | ||
| <%= f.select :project_id, Project.all, | ||
| include_blank: 'Projeto', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n Projeto
| </div> | ||
| </div> | ||
| <div class="col"> | ||
| <%= f.submit class: "w-100", value: "Salvar", data: { calendar_target: "deactivatable" } %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n Salvar
| end | ||
|
|
||
| def calendar | ||
| @selected_month = params[:month].present? && params[:year].present? ? "#{params[:year]}/#{params[:month]}/1".to_date : Date.current.beginning_of_month |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract to a method
| @punches = Punches::CalendarForm.new(punches_params) | ||
| @punches.validate | ||
| @punches_of_day = current_user.punches.group_by(&:date) | ||
| @current_month_by_weeks = (Date.current.beginning_of_month.beginning_of_week..Date.current.end_of_month.end_of_week).group_by do |date| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're also doing something similar at line 76. Can we abstract it?
|
|
||
|
|
||
| render :calendar | ||
| # @punch = Punch.new(punch_params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decidir se o código comentado fica ou não.
No description provided.