Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ li a {
border: 1px solid #ccc;
border-radius: 7px;
margin-top: 10px;
margin-bottom: 20px;
}

.deck-btn {
Expand Down
46 changes: 26 additions & 20 deletions app/views/alldecks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,35 @@
</div>
<br>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<input class='deck-search-bar form-control' type='text', placeholder="Search Decks..."></input>
<div class='search-decks-container'></div>
<div class='decks-continer'>
<% @decks.each do |deck| %>
<br>
<div class='deck'>
<div class="questions">
<%= link_to deck.name, user_deck_path(user_id: deck.user_id, id: deck.id) %>
</div>
<div>
<p class="text-center">Created By: <%= link_to deck.user.username, user_path(id: deck.user_id) %></p>
</div>
<% if deck.user_id.to_i == current_user %>
<p class="text-center">(This is one of your decks)</p>
<% else %>
<%= button_to 'Copy Deck To Your Profile', copy_deck_user_deck_path(user_id: deck.user_id, id: deck.id), class: "btn btn-xl btn-default form-control" %>
<% end %>
</div>
<% end %>
<div class="col-lg-12 text-center">
<div class="col-md-4 col-md-offset-4">
<input class='deck-search-bar form-control' type='text', placeholder="Search Decks..."></input>
<div class='search-decks-container'></div>
<div class='decks-continer'></div>
</div>
</div>
</div>
<br><br>
<div class="row">
<% @decks.each do |deck| %>
<div class="col-md-4 col-sm-6">
<br>
<div class='deck'>
<div class="questions">
<%= link_to deck.name, user_deck_path(user_id: deck.user_id, id: deck.id) %>
</div>
<div>
<p class="text-center">Created By: <%= link_to deck.user.username, user_path(id: deck.user_id) %></p>
</div>
<% if deck.user_id.to_i == current_user %>
<p class="text-center">(This is one of your decks)</p>
<% else %>
<%= button_to 'Copy Deck To My Profile', copy_deck_user_deck_path(user_id: deck.user_id, id: deck.id), class: "btn btn-xl btn-default form-control" %>
<% end %>
</div>
</div>
<% end %>
</div>
</div>


Expand Down
4 changes: 2 additions & 2 deletions app/views/cards/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<h4 class="text-center">Correct Answer:</h4>
<%= f.text_field :answer_number, placeholder: "Correct Answer Number", class: "form-control" %><br>
<br><br>
<%= f.submit "Save", class: "btn btn-md btn-info form-control" %>
<%= f.submit "Save", class: "btn btn-md btn-primary form-control" %>
<br><br>
<%= link_to 'cancel', edit_user_deck_path(user_id: @user.id, id: @deck.id), class: "btn btn-md btn-default form-control" %>
<%= link_to 'Cancel', edit_user_deck_path(user_id: @user.id, id: @deck.id), class: "btn btn-md btn-danger form-control" %>
<% end %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/decks/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<br>
<%= link_to '+ Add Card', new_user_deck_card_path(user_id: @user.id, deck_id: @deck.id), class: "btn btn-xl btn-primary form-control" %>
<br><br>
<%= button_to "Delete Deck", { controller: :decks, action: 'destroy', id: @deck.id, user_id: @user.id }, method: :delete, data: {:confirm => 'Are you sure?'}, class: "btn btn-xl btn-danger form-control" %>
<%= link_to "Delete Deck", { controller: :decks, action: 'destroy', id: @deck.id, user_id: @user.id }, method: :delete, data: {:confirm => 'Are you sure?'}, class: "btn btn-xl btn-danger form-control" %>
<br>
<div class='cards-container'>
<br><br><br>
Expand Down
5 changes: 2 additions & 3 deletions app/views/decks/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
<form action='/users/<%= @user.id %>/decks' method='post'>
<input type='text' class="form-control" name='deck[name]', placeholder="Deck Name.."></input>
<br>
<input type='submit' class="btn btn-md btn-info form-control"></input>
<input value="Save" type='submit' class="btn btn-md btn-primary form-control"></input>
<%= hidden_field_tag :authenticity_token, form_authenticity_token %>
</form>
</div>
</div>
</div>

</div>
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>RegressionFitKnowledgeCards</title>
<title>Flash Genius</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
Expand Down
35 changes: 13 additions & 22 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
</div>
<br><br>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class='decks-container'>
<% @decks.each do |deck| %>
<% @decks.each do |deck| %>
<div class="col-md-4 col-sm-6">
<div class="single-deck">
<div class="questions">
<em><%= link_to "#{deck.name}", user_deck_path(user_id: deck.user_id, id: deck.id) %></em>
Expand All @@ -22,9 +21,9 @@
Optimal Number of Hours Until Next Review:
</em>
<% if deck.hours_until_deck_review == "indeterminate, need more data" %>
<%= deck.hours_until_deck_review %>
<%= deck.hours_until_deck_review %>
<% else %>
<%= ((deck.hours_until_deck_review.to_f * 60 * 60 - (DateTime.now.to_i - deck.updated_at.to_i) )/ 3600).round(2) %>
<%= ((deck.hours_until_deck_review.to_f * 60 * 60 - (DateTime.now.to_i - deck.updated_at.to_i) )/ 3600).round(2) %>
<% end %>
</h5>

Expand All @@ -33,30 +32,22 @@
Predicted Date of Mastery at Current Rate:
</em>
<% if deck.hour_mastery_is_attained == "indeterminate, need more data" %>
<%= deck.hour_mastery_is_attained %>
<%= deck.hour_mastery_is_attained %>
<% else %>
<span class='time'><%= deck.hour_mastery_is_attained.to_i %></span>
<span class='time'><%= deck.hour_mastery_is_attained.to_i %></span>
<% end %>
</h5>

<div class="deck-btns-container">
<% if @user.id == current_user %>
<div class="deck-btn"><%= link_to 'Take Quiz', take_quiz_user_deck_path(user_id: deck.user_id, id: deck.id), class: "btn btn-xl btn-primary form-control" %></div>
<div class="deck-btn"><%= link_to 'Edit Deck', edit_user_deck_path(user_id: deck.user_id, id: deck.id), class: "btn btn-xl btn-danger form-control" %></div>

<% else %>
| <%= button_to 'copy deck to your profile', copy_deck_user_deck_path(user_id: deck.user_id, id: deck.id) %>
<% end %>
<% if @user.id == current_user %>
<div class="deck-btn"><%= link_to 'Take Quiz', take_quiz_user_deck_path(user_id: deck.user_id, id: deck.id), class: "btn btn-xl btn-primary form-control" %></div>
<div class="deck-btn"><%= link_to 'Edit Deck', edit_user_deck_path(user_id: deck.user_id, id: deck.id), class: "btn btn-xl btn-danger form-control" %></div>
<% else %>
<%= button_to 'Copy Deck My Profile', copy_deck_user_deck_path(user_id: deck.user_id, id: deck.id), class: "btn btn-xl btn-default form-control" %>
<% end %>
</div>
</div>
<br><br>
<% end %>
</div>
</div>
<% end %>
</div>
</div>





1 change: 1 addition & 0 deletions webText.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ There is a great deal of debate about the neurobiology of memory, why our memori

There are so many wonderful things to learn and so little time to do it. This app

added to change commit