Skip to content

Commit

Permalink
UI update with button sand icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ingridh committed Apr 27, 2015
1 parent 1193781 commit 3856321
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 26 deletions.
Binary file added app/assets/images/export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/graystar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/yellowstar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,31 @@
h1, p {
margin: 10px;
padding: 0px;
text-align: center;
font-family: 'Open Sans';
font-family: 'Open Sans', Helvetica, Arial, sans-serif;
font-weight: 700;
}

.message{
color: red;
}

.col-md-10 {
// width: 100%;
}

a {
text-decoration: none;
}

p.collectioncontrols {
display: inline;
margin: 0;
}

.btn {
font-family: 'Open Sans', Helvetica, Arial, sans-serif
}

a:link, a:visited, a:hover, a:active {
text-decoration: none;
}
Expand All @@ -55,6 +71,10 @@ a {

}

.title {
text-align: center;
}

ul#navbar {
list-style: none;
}
Expand Down Expand Up @@ -90,6 +110,7 @@ li#navbar {
background: #EBF4FA;
padding: 10px;
}

#thetextarea {
height: 100%;
width: 100%;
Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/problems.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
transition: all 0.5s ease;
}



ol.questions { list-style-type: none; }
li.question { page-break-inside: avoid; }
li.multiplechoice ol.answers { list-style-type: lower-alpha; }
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def destroy
def export
@html_code = Collection.find(params[:id]).export
if not @html_code
flash[:notice] = 'Cannot export an empty collection! Add some questions to your collection'
flash[:notice] = 'Cannot export an empty collection! Add some questions to your collection first!'
flash.keep
redirect_to edit_collection_path( id: params[:id])
end
Expand Down
15 changes: 7 additions & 8 deletions app/views/collections/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
%h3= "Your collection #{@collection.name}"
%h3= "Your collection: #{@collection.name}"
=render :partial=> 'form', locals: {collection: @collection}
%p
Delete this collection?
=link_to(image_tag('trashcan.png', width: 21), collection_path(@collection), method: :delete, :confirm => 'Delete this collection?')
%p
Export this collection:
=link_to 'export button', export_path(:id => @collection)
= render :partial => "shared/problems_table", locals: {problems_index: false, collection: @collection, problems: @collection.problems}
%p.collectioncontrols
=link_to "Delete Collection", collection_path(@collection), :class => 'btn btn-danger', method: :delete, :confirm => 'Delete this collection?'
%p.collectioncontrols
=link_to "Export Collection", export_path(:id => @collection), :class => 'btn btn-info'

= render :partial => "shared/problems_table", locals: {problems_index: false, collection: @collection, problems: @collection.problems}
7 changes: 3 additions & 4 deletions app/views/collections/finalize_upload.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
-@collections.each do |collection|
%tr
=render :partial=> 'form', locals: {collection: collection}
%p
Delete this collection?
=link_to 'assets/images/trashcan.png', collection_path(collection), method: :delete, :confirm => 'Delete this collection?'
%p
%p.collectioncontrols
=link_to(image_tag('trashcan.png', width: 21), collection_path(@collection), method: :delete, :confirm => 'Delete this collection?')
%p.collectioncontrols
Export this collection:
=link_to 'export button', export_path(:id => collection)
= render :partial => "shared/problems_table", locals: {problems_index: false, collection: collection, problems: collection.problems}
2 changes: 1 addition & 1 deletion app/views/collections/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%h1 Create New Collection
%h2 Create New Collection


= render "form", :collection => @collection
19 changes: 11 additions & 8 deletions app/views/instructor/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-# in app/views/show.html.haml
%h2 Dashboard #{@current_user.name}
%h2 #{@current_user.name}'s Dashboard

-if @collections.empty?
%h3 You have no collections! Start one now.
Expand All @@ -17,20 +17,23 @@
%table.table.table-striped#collections
%thead
%tr
%th
%th Name
%th No. of Questions
%th # Questions
%th Description
%th Last Used
%th Mark as current

%tbody
- @collections.each do |collection|
%tr
%td
-if @current_user.current_collection == collection.id
=link_to image_tag('yellowstar.png', width: 30), mark_as_current_path(:id => collection.id)
-else
=link_to image_tag('graystar.png', width: 30), mark_as_current_path(:id => collection.id)
%td= link_to collection.name, edit_collection_path(:id => collection.id)
%td= collection.problems.length
%td= collection.description
%td= collection.last_used
%td
-if @current_user.current_collection == collection.id
=link_to 'should be gold star', mark_as_current_path(:id => collection.id)
-else
=link_to 'should be grey star', mark_as_current_path(:id => collection.id)


1 change: 1 addition & 0 deletions app/views/problems/_filter.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

= form_tag problems_path, :method => :get, :id => "filter_form" do

%div.form-group
= label_tag(:search, "Search Keywords:")
= text_field_tag(:search, params[:search], class: 'form-control', placeholder: "Search")
Expand Down
1 change: 1 addition & 0 deletions app/views/problems/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
%div.col-md-2#sidebar-filter
= render "filter"


= render :partial => "shared/problems_table", locals: {problems_index: true, problems: @problems}
Binary file added public/graystar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/yellowstar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3856321

Please sign in to comment.