Skip to content

Commit

Permalink
fixed #1049 added collect link and dropdown to cart show open
Browse files Browse the repository at this point in the history
added tooltips to library titles
  • Loading branch information
chiramiso authored and andreasknoepfle committed Nov 12, 2014
1 parent bf4bb67 commit ce6d937
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
@import "modules/payment"; // payment box
@import "modules/rating"; // rating box
@import "modules/line_item_group"; // line_item_group box
@import "modules/collect_button"; // collect button


// vendor changes
Expand Down
16 changes: 13 additions & 3 deletions app/assets/stylesheets/controller/carts.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,22 @@ form.change_quantity > .inputs > ol > li.input {
input { width: 4em; padding: 0.3em 0.5em;}
}

.delete_line_item {
.delete_line_item, .collect_line_item {
margin-left: 0.5em;
line-height: 2.3em;
}


form.change_quantity > .inputs > ol > li.action {
float:none;
}

.change_quantity,
.delete_line_item,
.collect_line_item,
.change_quantity > .inputs ,
.change_quantity > .inputs > ol > li,
.delete_line_item > div {
.delete_line_item, .collect_line_item > div {
display: inline-block;
overflow: visible;
float:left;
Expand All @@ -109,7 +111,8 @@ form.change_quantity > .inputs > ol > li.action {
@include at-breakpoint($bp-tablet-horizontal) {
.line_item_actions-inner { padding: 1.8em 1em; }
.change_quantity { @include span(2 of 6 0.1); }
.delete_line_item { @include span(2 of 6 0.1); margin-left: 0; }
.delete_line_item { @include span(1 of 6 0.1); margin-left: 0; }
.collect_line_item { @include span(1 of 6 0.1); margin-left: 0; }
.line_item_total { @include span(2 of 6 0.1); @include omega; }

.to_checkout > .Button {
Expand Down Expand Up @@ -349,4 +352,11 @@ form.change_quantity > .inputs > ol > li.action {
font-size: 1.2em;
}

#collect_link {
color: $blue !important;
&:hover {
text-decoration: underline;
}
}

/* --------------------- Post Checkout Cart --------------------- */
125 changes: 125 additions & 0 deletions app/assets/stylesheets/modules/_collect_button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
// Popup window behind the collect button, listing the libraries
#libraries_popup {
width: 21.1em;
display:none;
background-color:white;
box-shadow: $even-lighter-gray 0px 0px 2px 2px;
padding: 0.5em;
&.is-active {
display: block;
position: absolute;
z-index: 1;
}
}

// Fragezeichen-Button
#libraries_popup > span.sprite_helper {
position: absolute;
top: 0.5em;
right: 0.5em;
}

#libraries_popup > #libraries_list {
margin-top: 0.5em;
max-height: 30em;
overflow: auto;
}

#libraries_popup > #libraries_list > ul {
list-style: none;
padding: 0;
margin: 0;
}

#libraries_popup > #libraries_list > ul > li {
list-style: none;
word-wrap: break-word;
margin: 0 0.5em 1em 0.25em;
padding: 0;
}

#libraries_popup > #libraries_list > ul > li > i {
margin-right: 0.6em;
}

// Formular

#libraries_popup > .formtastic.library {
margin-top: 0.25em;

.inputs {
float: left;
}

// Plus-Button
.actions {
float: left;
margin: 0;
}
}


// Auge
#eye_checkbox {
color: $blue;
cursor: pointer;
margin: 0.1em 0.2em 0 0;
float: left;
}


// Textfeld
#library_name_input {
float: left;
margin: 0 0.2em;
padding: 0;

input, p {
width: 14.5em;
margin: 0;
}

p {
margin-top: 0.5em;
}
}

// Link zu Sammlungen
#libraries_popup > #libraries_links {
padding: 0.75em 0 0 0;
margin: 0;
list-style: none;
clear: left;

li {
margin: 0.25em 0.5em 0.25em 0.25em;
padding: 0;
text-align: right;
}
}

// Responsive Stuff

#libraries_popup {
@include at-breakpoint($bp-mobile) {
&.is-active {
left: 0em;
}
}
@include at-breakpoint($bp-mobile-horizontal) {
&.is-active {
left: 0em;
}
}
@include at-breakpoint($bp-tablet) {
&.is-active {
left: 0em;
}
}
@include at-breakpoint($bp-tablet-horizontal) {
&.is-active {
right: 0em;
left: auto;
}
}
}
3 changes: 2 additions & 1 deletion app/controllers/library_elements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def create
if @library_element.save
flash[:notice] = I18n.t('library_element.notice.success', name: @library_element.library_name)
end
redirect_to article_path(@library_element.article)

redirect_to :back
end

def destroy
Expand Down
2 changes: 1 addition & 1 deletion app/views/articles/show/_article_contents.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
h2.title
= resource.title
- if user_signed_in? && resource.active?
= render "libraries/shared/control_panel", article: resource, libraries: user_libraries
= render "libraries/shared/control_panel", article: resource, libraries: user_libraries, button: true
.details
- cache [resource, resource.seller, "basic_information"] do
h3.price
Expand Down
4 changes: 3 additions & 1 deletion app/views/libraries/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
/ along with Fairmondo. If not, see <http://www.gnu.org/licenses/>.
/
h1.Title-next-to-tab Sammlungen
h1.Title-next-to-tab
=> t('libraries.title')
span.sprite_helper title="#{ t('libraries.tooltip') }"

- if !user_focused? || @user == current_user
ul.Tabs
Expand Down
9 changes: 7 additions & 2 deletions app/views/libraries/shared/_control_panel.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.collect.JS-active-toggle--container
.Button.Button--gray.JS-active-toggle--trigger data={ clickable: true }
= t('common.actions.collect')
- if button
.Button.Button--gray.JS-active-toggle--trigger data={ clickable: true }
= t('common.actions.collect')
- else
.JS-active-toggle--trigger data={ clickable: true }
#collect_link
= t('common.actions.collect')
.libraries.JS-active-toggle--target#libraries_popup
= t('library.control.add')
span.sprite_helper*{ title: t('library.control.main_tooltip') }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
li
i.fa.fa-lg*{title: t("library.visibility.#{visibility}"), class: visibility == :public ? 'fa-eye' : 'fa-eye-slash'}
- if library.includes_article? article
= library.name
=> library.name
i.fa.fa-check*{title: t('library.control.check_title')}
- else
= link_to library.name, user_library_elements_path(user_id: current_user.id, library_element: {article_id: article.id, library_id: library.id}), method: :post
4 changes: 4 additions & 0 deletions app/views/line_items/shared/_line_item_list_view.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@

.delete_line_item
= link_to t('common.actions.destroy'), line_item_path(line_item.id), method: :delete
- if user_signed_in?
.collect_line_item
= render 'libraries/shared/control_panel', libraries: current_user.libraries, resource: article, article: article, button: false

.line_item_total
= money cart_abacus.line_item_totals[line_item]
5 changes: 4 additions & 1 deletion app/views/welcome/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@
- if @trending_libraries.to_a.any?
.teaser.teaser--full.libraries
.teaser-inner
h2= t('welcome.trending_libraries')
h2
=> t('welcome.trending_libraries')
span.sprite_helper title="#{ t('libraries.tooltip') }"

= render partial: "libraries/library", collection: @trending_libraries, locals: { header_comments: false }


Expand Down
2 changes: 2 additions & 0 deletions config/locales/library/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ de:
to_show_favorites: "um Deine Sammlungs-Favoriten zu sehen. Wenn Du noch keinen Account hast, musst Du Dich vorher"
sign_up: "registrieren"
create_new: "Neue Sammlung anlegen"
title: "Sammlungen"
tooltip: "In den Sammlungen zeigen andere Nutzer*innen, welche Artikel sie spannend und empfehlenswert finden. In Deinem Profil kannst Du eigene Sammlungen anlegen."
tabs:
trending: 'Trends'
updated: 'Neu'
Expand Down

0 comments on commit ce6d937

Please sign in to comment.