Skip to content

Commit

Permalink
Extract 'write a reponse/reply' into it's own button at the bottom of…
Browse files Browse the repository at this point in the history
… message threads
  • Loading branch information
wrightmartin committed Aug 11, 2021
1 parent f44ab48 commit 650da9f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/assets/stylesheets/responsive/_global_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ textarea{
.action-bar__make-request,
.action-bar__follow,
.action-bar__follow-button,
.action-bar__follower-count {
.action-bar__follower-count,
.action-bar__reply {
vertical-align: middle;
font-size: 16px;
margin: 1em 0;
Expand Down
15 changes: 14 additions & 1 deletion app/assets/stylesheets/responsive/_request_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@

.after-actions {
display: inline-block;
margin-bottom: 1em;
@include respond-min( $main_menu-mobile_menu_cutoff) {

margin: 0;
}
.action-menu__button {
width: 100%;
Expand All @@ -95,6 +96,7 @@
margin: 0;
@include respond-min( 30em ){
margin-left: 1em;

}
@include respond-min( $main_menu-mobile_menu_cutoff ){
text-align: right;
Expand All @@ -109,6 +111,17 @@
}
}

.action-bar__reply {
margin-bottom: -1em; //seems easier to do this here than completely override the whole action styles
@media (min-width: 30em){
display: inline-block;
margin: 0 1em 0 0;
}
.button {
line-height: 1.5em;
}
}

.request-header__action-bar__actions--narrow {
//we use --narrow when a profile photo is available
@media (min-width: 30em) {
Expand Down
9 changes: 9 additions & 0 deletions app/views/request/_reply.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="action-bar__reply">
<% if last_response.nil? %>
<%= link_to _("Send a followup"), new_request_followup_path(:request_id => info_request.id, :anchor => 'followup'),
:class => "action-bar__reply-button" %>
<% else %>
<%= link_to _("Write a reply"), new_request_incoming_followup_path(:request_id => info_request.id, :incoming_message_id => last_response.id, :anchor => 'followup'),
:class => "action-bar__reply-button" %>
<% end %>
</div>
7 changes: 6 additions & 1 deletion app/views/request/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,22 @@
<div class="request-footer__action-bar-container">
<div class="request-footer__action-bar__actions">
<% if @in_pro_area %>
<%= render partial: 'request/reply',
locals: { info_request: @info_request,
last_response: @last_response } %>
<%= render partial: 'alaveteli_pro/info_requests/after_actions',
locals: { info_request: @info_request,
last_response: @last_response } %>
<% else %>
<%= render partial: 'request/reply',
locals: { info_request: @info_request,
last_response: @last_response } %>
<%= render partial: 'request/after_actions',
locals: { info_request: @info_request,
track_thing: @track_thing,
show_owner_update_status_action: @show_owner_update_status_action,
show_other_user_update_status_action: @show_other_user_update_status_action,
last_response: @last_response } %>

<%= render partial: 'track/tracking_links_simple',
locals: { track_thing: @track_thing,
user: @user,
Expand Down

0 comments on commit 650da9f

Please sign in to comment.