Skip to content

Commit

Permalink
[DT-262] Fix button colors are not consistent (#254)
Browse files Browse the repository at this point in the history
* [DT-262] Fix button colors are not consistent

- [x] Align back button to the left (I think it's more user friendly)
- [x] [Tried to follow Ariel's convention colors](#99 (comment))

[DT-262](https://ombulabs.atlassian.net/browse/DT-262)

* Fix merge conflict
  • Loading branch information
JuanVqz committed Jun 9, 2023
1 parent 5465ec0 commit 4684eac
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 29 deletions.
3 changes: 1 addition & 2 deletions app/assets/stylesheets/4-molecules/_floors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
justify-content: center;
width: 100%;
overflow: hidden;
background-color: #D9F1F1;
height: calc(100vh - 160px);
margin: -100px 0;
}
}
}
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), class: "button", id:"back", method: :post %><br />
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), class: "button green", id:"back", method: :post %><br />
<% end -%>
<% end -%>
</div>
2 changes: 1 addition & 1 deletion app/views/estimates/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>

<div class="btn-group">
<%= f.submit t(".button_text"), value: t(".button_text"), class: "button", id: "edit" %>
<%= f.submit t(".button_text"), value: t(".button_text"), class: "button green", id: "edit" %>
</div>

<% if estimate.persisted? %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="fluid-container center floor signin">
<h1>Welcome to the Points App</h1>
<%= link_to "Sign in", new_user_session_path, class: "button", id: "edit" %>
<%= link_to "Sign in", new_user_session_path, class: "button green", id: "edit" %>
</div>
2 changes: 1 addition & 1 deletion app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<% if current_user %>
<%= link_to "Sign out", destroy_user_session_path, method: :delete, class: "button magenta" %>
<% else %>
<%= link_to "Sign in", new_user_session_path, class: "button" %>
<%= link_to "Sign in", new_user_session_path, class: "button green" %>
<% end %>
</ul>
</nav>
Expand Down
6 changes: 4 additions & 2 deletions app/views/projects/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
<div class="field">
<%= f.label :title %>
<%= f.text_field :title, placeholder: "Project Title", class: "project-story-title", autofocus: true %>
</div><div class="btn-group">
<%= f.submit yield(:button_text), class: "button", id: "edit" %>
</div>

<div class="btn-group">
<%= f.submit yield(:button_text), class: "button green", id: "edit" %>
</div>
<% end %>
4 changes: 2 additions & 2 deletions app/views/projects/_import_export.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<%= form_with(url: import_project_stories_path(@project), method: :patch, remote: false) do |f| %>
<%= f.file_field :file %>
<div class="btn-group">
<%= f.submit 'Import', class: 'button magenta' %>
<%= f.submit 'Import', class: 'button green' %>
</div>
<% end %>
</div>
Expand All @@ -31,7 +31,7 @@
<h4 class="my-0 font-weight-normal">Export CSV</h4>
</div>
<div class="card-body">
<%= link_to 'Export', export_project_stories_path(@project), class:"button magenta" %>
<%= link_to 'Export', export_project_stories_path(@project), class: "button green" %>
</div>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions app/views/projects/_sub_project_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<%= f.label :title %>
<%= f.text_field :title, placeholder: "Subproject Title", class: "project-story-title", autofocus: true %>
<%= f.hidden_field :parent_id, value: parent.id %>
</div><div class="btn-group">
<%= f.submit yield(:button_text), class: "button", id: "edit" %>
</div>

<div class="btn-group">
<%= f.submit yield(:button_text), class: "button green", id: "edit" %>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/views/projects/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<% end %>

<div class="btn-group">
<%= link_to "Add a Project", new_project_path, class: "button", id: "create-button" %>
<%= link_to "Add a Project", new_project_path, class: "button green", id: "create-button" %>
<% if params[:archived] == "true" %>
<%= link_to "Hide Archived Projects", projects_path, class: "button" %>
<% else %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/projects/new_clone.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<% end %>

<div class="actions">
<%= button_tag "Clone", class: "button", type: "submit" %>
<%= link_to 'Back', project_path(@original.id), id:"back", class: "button" %>
<%= button_tag "Clone", class: "button green", type: "submit" %>
<%= link_to 'Back', project_path(@original.id), id: "back", class: "button" %>
</div>
<% end %>
</div>
</div>
18 changes: 9 additions & 9 deletions app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<th class="project-table__cell">Best<br />Estimate</th>
<th class="project-table__cell">Worst<br />Estimate</th>
<th class="project-table__cell story_actions">
<%= link_unless_archived(@project, "Add a Story", new_project_story_path(@project), classes: "magenta") if is_unlocked?(@project) %>
<%= link_unless_archived(@project, "Add a Story", new_project_story_path(@project), classes: "green") if is_unlocked?(@project) %>
<button id="bulk_delete" class="button magenta" aria-disabled="true" disabled>Bulk Delete</button>
</th>
</tr>
Expand All @@ -38,7 +38,7 @@
<% if estimated(story) %>
<%= link_unless_archived(@project, "Edit Estimate", edit_project_story_estimate_path(@project.id, story, @estimate_id), classes: "edit-estimate", remote: true) %>
<% else %>
<%= link_unless_archived(@project, "Add Estimate", new_project_story_estimate_path(@project.id, story), classes: "add-estimate", remote: true) %>
<%= link_unless_archived(@project, "Add Estimate", new_project_story_estimate_path(@project.id, story), classes: "add-estimate green", remote: true) %>
<% end %>

<div class="dropdown-wrapper more-actions">
Expand Down Expand Up @@ -101,23 +101,23 @@
<%= render partial: "projects/import_export" if is_unlocked?(@project) %>

<div class="btn-group actions">
<%= link_to 'Return to Projects Page', projects_path, id: :back, class: "button" %>
<% if current_user.admin? %>
<%= button_to is_unlocked?(@project) ? 'Lock Project' : 'Unlock Project', toggle_locked_project_path(@project.id), method: :patch, class: "button magenta ", id: "lock-btn", remote: true %>
<%= button_to is_unlocked?(@project) ? 'Lock Project' : 'Unlock Project', toggle_locked_project_path(@project.id), method: :patch, class: "button magenta", id: "lock-btn", remote: true %>
<% end %>
<% if is_unlocked?(@project) %>
<%= link_unless_archived(@project, "Delete Project", project_path(@project.id), classes: "delete", method: :delete, remote: true, data_attr: { confirm: 'Are you sure?' }, id: "delete")%>
<%= link_to 'Clone Project', new_clone_project_path(@project.id), class: "button green" %>
<%= link_unless_archived(@project, "Add Sub-Project", project_new_sub_project_path(@project), classes: :magenta) unless @project.parent_id.present? %>
<% if is_unlocked?(@project) %>
<%= link_unless_archived(@project, "Add Sub-Project", project_new_sub_project_path(@project), classes: :green) unless @project.parent_id.present? %>
<%= link_unless_archived(@project, "Delete Project", project_path(@project.id), classes: "delete magenta", method: :delete, remote: true, data_attr: { confirm: 'Are you sure?' }, id: "delete") %>
<% end %>
<%= link_to 'Clone Project', new_clone_project_path(@project.id), class: "button magenta" %>
<% unless @project.parent_id %>
<%= link_to "#{@project.archived? ? 'Unarchive' : 'Archive'} Project", toggle_archive_project_path(@project.id), method: "patch", id: "toggle_archive", class: "button magenta", remote: true %>
<% end %>
<%= link_to "Generate Action Plan", project_action_plan_path(@project.id), class: "button" %>
<%= link_to "Generate Action Plan", project_action_plan_path(@project.id), class: "button green" %>
<%= link_to "View Report", project_report_path(@project.id), class: "button" if current_user.admin? %>
<%= link_to 'Return to Projects Page', projects_path, id:"back", class: "button" %>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/real_scores/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
<% end %>

<div class="btn-group">
<%= link_to 'Back', reports_index_path, id:"back", class: "button" %>
<%= link_to 'Back', reports_index_path, id: "back", class: "button" %>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/reports/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div class="btn-group">
<%= link_to 'Back', reports_index_path, id:"back", class: "button" %>
<%= link_to 'Edit Real Scores', real_scores_project_stories_path(@project), class: "button" %>
<%= link_to_if @can_generate_estimate_report, 'Download Average Estimate Report', project_report_path(@project, format: 'csv'), class: "button" do %>
<%= link_to_if @can_generate_estimate_report, 'Download Average Estimate Report', project_report_path(@project, format: 'csv'), class: "button green" do %>
Stories need at least 2 estimates to generate report
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/stories/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@


<div class="btn-group">
<%= f.submit yield(:button_text), class: "button", id: "edit" %>
<%= f.submit yield(:button_text), class: "button green", id: "edit" %>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/views/stories/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<%= render "shared/story", story: @story %>

<div class="btn-group">
<%= link_to 'Back', project_path(@project), id: "back", class: "button" %>
<% if is_unlocked?(@project) %>
<%= link_unless_archived(@project, "Edit", edit_project_story_path(@project), classes: "magenta", id: "back") %>
<%= link_to "Delete", project_story_path(@project.id, @story), method: :delete, data: { confirm: "Are you sure?", story_id: @story.id }, class: "button red", remote: true , title: "Delete" %>
<% end %>
<%= link_to 'Back', project_path(@project), id:"back", class: "button" %>
</div>
</div>

0 comments on commit 4684eac

Please sign in to comment.