Skip to content

Commit

Permalink
finished app
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrobert committed Jun 24, 2020
1 parent bbbbd4e commit a2c27c1
Show file tree
Hide file tree
Showing 36 changed files with 502 additions and 478 deletions.
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# rubocop:disable Style/FrozenStringLiteralComment
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

Expand Down Expand Up @@ -43,9 +44,9 @@ group :development do
gem 'listen', '~> 3.2'
gem 'web-console', '>= 3.3.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'bullet'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem "bullet"
end

group :test do
Expand All @@ -58,3 +59,5 @@ end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

# rubocop: enable Style/FrozenStringLiteralComment
63 changes: 63 additions & 0 deletions app/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
AllCops:
Exclude:
- "db/**/*"
- "bin/*"
- "test/*"
- "config/**/*"
- "Guardfile"
- "Rakefile"
- "README.md"
- "node_modules/**/*"

DisplayCopNames: true

Layout/LineLength:
Max: 120
Metrics/MethodLength:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 20
Metrics/AbcSize:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 50
Metrics/ClassLength:
Max: 150
Metrics/BlockLength:
ExcludedMethods: ['describe']
Max: 30

Style/Documentation:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/EachForSimpleLoop:
Enabled: false
Style/AndOr:
Enabled: false
Style/DefWithParentheses:
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: never
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false


Layout/HashAlignment:
EnforcedColonStyle: key
Layout/ExtraSpacing:
AllowForAlignment: false
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented

Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
23 changes: 23 additions & 0 deletions app/.stickler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# add the linters you want stickler to use for this project
linters:
rubocop:
display_cop_names: true
# indicate where is the config file for stylelint
config: './rubocop.yml'

# add the files here you want to be ignored by stylelint
files:
ignore:
- "bin/*"
- "test/*"
- "db/*"
- "config/*"
- "Guardfile"
- "Rakefile"
- "README.md"
- "node_modules/**/*"

# PLEASE DO NOT enable auto fixing options
# if you need extra support from you linter - do it in your local env as described in README for this config

# find full documentation here: https://stickler-ci.com/docs
28 changes: 12 additions & 16 deletions app/views/groups/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<%= form_for @group do |f| %>

<% if @group.errors.any? %>
<ul>
<% @group.errors.full_messages.each do |msg| %>
<li class="error"><%= msg %></li>
<% end %>
<% if @group.errors.any? %>
<ul>
<% @group.errors.full_messages.each do |msg| %>
<li class="error"><%= msg %></li>
<% end %>
</ul>
<% end %>
<%= f.label :name %><br />
<%= f.text_field :name %><br />

<p class = "icons_grp">
<% end %>
<%= f.label :name %><br />
<%= f.text_field :name %><br />
<p class = "icons_grp">
<b >Icon</b><br />
<%= f.radio_button :icon, 'fa fa-bus' %><i class="fa fa-bus" aria-hidden="true"></i><br />
<%= f.radio_button :icon, 'fa fa-briefcase' %> <i class="fa fa-briefcase" aria-hidden="true"></i><br />
<%= f.radio_button :icon, 'fa fa-calculator' %> <i class="fa fa-calculator" aria-hidden="true"></i><br />
</p>


<%= f.submit class: "submit text-center btn btn-primary" %>
<% end %>
</p>
<%= f.submit class: "submit text-center btn btn-primary" %>
<% end %>
6 changes: 3 additions & 3 deletions app/views/groups/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form_app container">
<h2>edit group</h2>
<%= render 'form', group: @group %>
</div>
<h2>edit group</h2>
<%= render 'form', group: @group %>
</div>
92 changes: 36 additions & 56 deletions app/views/groups/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,61 +1,41 @@
<section class="transaction_header">
<div class="container t-d">
<div class="button">

<%= link_to root_path do %>
<i class="fa fa-bars" aria-hidden="true"></i>
<% end %>

</div>
<div class="title">
Groups
</div>

<div class="search">
<i class="fa fa-search" aria-hidden="true"></i>
</div>
</div>

<h3 class ="text-center">most recent</h3>

</section>
<section class="transaction_body">

<div class="container t-c">

<% @groups.each do |g| %>
<a href= "groups/<%=g.id%>" >
<div class="card mb-3">

<div class="row no-gutters">
<div class="col-md-4 grp-icn">
<i class= "<%= g.icon %>" ></i>
<div class="container t-d">
<div class="button">
<%= link_to root_path do %>
<i class="fa fa-bars" aria-hidden="true"></i>
<% end %>
</div>
<div class="title">
Groups
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title"> <%= g.name %> </h5>

<p class="card-text"><small class="text-muted"><%= g.created_at %></small></p>
<%= edit_delete_btn(current_user, g) %>




</div>
<div class="search">
<i class="fa fa-search" aria-hidden="true"></i>
</div>
</div>
</div>
</a>
<% end %>
</div>

<br>


<br>
<%= link_to "Add new", new_group_path , :class => "btn btn-success new_trans" %>
<h3 class ="text-center">most recent</h3>
</section>
<section class="transaction_body">
<div class="container t-c">
<% @groups.each do |g| %>
<a href= "groups/<%=g.id%>" >
<div class="card mb-3">
<div class="row no-gutters">
<div class="col-md-4 grp-icn">
<i class= "<%= g.icon %>" ></i>
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title"> <%= g.name %> </h5>
<p class="card-text"><small class="text-muted"><%= g.created_at %></small></p>
<%= edit_delete_btn(current_user, g) %>
</div>
</div>
</div>
</div>
</a>
<% end %>
</div>
<br>
<br>
<%= link_to "Add new", new_group_path , :class => "btn btn-success new_trans" %>
</section>




6 changes: 3 additions & 3 deletions app/views/groups/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form_app container">
<h2>new group</h2>
<%= render 'form', group: @group %>
</div>
<h2>new group</h2>
<%= render 'form', group: @group %>
</div>
100 changes: 42 additions & 58 deletions app/views/groups/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,64 +1,48 @@
<section class="transaction_header">
<div class="container t-d">
<div class="button">
<%= link_to root_path do %>
<i class="fa fa-bars" aria-hidden="true"></i>
<% end %>
</div>
<div class="title">
Transactions for a specific group
</div>

<div class="search">
<i class="fa fa-search" aria-hidden="true"></i>
</div>
</div>

<h3 class ="text-center">most recent</h3>

<div class="container t-d">
<div class="button">
<%= link_to root_path do %>
<i class="fa fa-bars" aria-hidden="true"></i>
<% end %>
</div>
<div class="title">
Transactions for a specific group
</div>
<div class="search">
<i class="fa fa-search" aria-hidden="true"></i>
</div>
</div>
<h3 class ="text-center">most recent</h3>
</section>

<section class="transaction_body">
<div class="total_amount_sec">
<div class="amount_title">
total amount
</div>

<div class="actual_total_amount">
$ <%= @total %>
</div>
</div>
<div class="container t-c">

<% @transaction.each do |t| %>

<div class="card mb-3">
<div class="row no-gutters">
<div class="col-md-4 grp-icn">
<i class= "<%= t.group.icon %>" ></i>

<section class="transaction_body">
<div class="total_amount_sec">
<div class="amount_title">
total amount
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title trns"> <%= t.name %> </h5>
<p class="card-text style-up"> <span>$</span> <%= t.amount %></p>
<p class="card-text"> <span>created by</span> <%= t.user.name %></p>
<p class="card-text"><small class="text-muted"><%= t.created_at %></small></p>

</div>
<div class="actual_total_amount">
$ <%= @total %>
</div>
</div>
</div>
<% end %>
</div>

<br>


<br>
<%= link_to "Add new", new_transaction_path , :class => "btn btn-success new_trans" %>
<div class="container t-c">
<% @transaction.each do |t| %>
<div class="card mb-3">
<div class="row no-gutters">
<div class="col-md-4 grp-icn">
<i class= "<%= t.group.icon %>" ></i>
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title trns"> <%= t.name %> </h5>
<p class="card-text style-up"> <span>$</span> <%= t.amount %></p>
<p class="card-text"> <span>created by</span> <%= t.user.name %></p>
<p class="card-text"><small class="text-muted"><%= t.created_at %></small></p>
</div>
</div>
</div>
</div>
<% end %>
</div>
<br>
<br>
<%= link_to "Add new", new_transaction_path , :class => "btn btn-success new_trans" %>
</section>




Loading

0 comments on commit a2c27c1

Please sign in to comment.