From 5f01c8bae17f2101f8ad0d3581b1f5977e73b50b Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 18:18:14 +0200 Subject: [PATCH 01/12] Bogus files removed This reverts commit 0b1a4eaaa545149dc00de42792543fdbe2c03949. --- app/views/devise/confirmations/new.html.erb | 16 -------- .../mailer/confirmation_instructions.html.erb | 5 --- .../devise/mailer/password_change.html.erb | 3 -- .../reset_password_instructions.html.erb | 8 ---- .../mailer/unlock_instructions.html.erb | 7 ---- app/views/devise/passwords/edit.html.erb | 25 ------------ app/views/devise/passwords/new.html.erb | 16 -------- app/views/devise/registrations/edit.html.erb | 39 ------------------- app/views/devise/registrations/new.html.erb | 29 -------------- app/views/devise/shared/_links.html.erb | 25 ------------ app/views/devise/unlocks/new.html.erb | 16 -------- 11 files changed, 189 deletions(-) delete mode 100644 app/views/devise/confirmations/new.html.erb delete mode 100644 app/views/devise/mailer/confirmation_instructions.html.erb delete mode 100644 app/views/devise/mailer/password_change.html.erb delete mode 100644 app/views/devise/mailer/reset_password_instructions.html.erb delete mode 100644 app/views/devise/mailer/unlock_instructions.html.erb delete mode 100644 app/views/devise/passwords/edit.html.erb delete mode 100644 app/views/devise/passwords/new.html.erb delete mode 100644 app/views/devise/registrations/edit.html.erb delete mode 100644 app/views/devise/registrations/new.html.erb delete mode 100644 app/views/devise/shared/_links.html.erb delete mode 100644 app/views/devise/unlocks/new.html.erb diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb deleted file mode 100644 index 826672f..0000000 --- a/app/views/devise/confirmations/new.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Resend confirmation instructions

- -<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> -
- -
- <%= f.submit "Resend confirmation instructions" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb deleted file mode 100644 index dc55f64..0000000 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

Welcome <%= @email %>!

- -

You can confirm your account email through the link below:

- -

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/password_change.html.erb b/app/views/devise/mailer/password_change.html.erb deleted file mode 100644 index b41daf4..0000000 --- a/app/views/devise/mailer/password_change.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -

Hello <%= @resource.email %>!

- -

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb deleted file mode 100644 index f667dc1..0000000 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

Hello <%= @resource.email %>!

- -

Someone has requested a link to change your password. You can do this through the link below.

- -

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

- -

If you didn't request this, please ignore this email.

-

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb deleted file mode 100644 index 41e148b..0000000 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

Hello <%= @resource.email %>!

- -

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

- -

Click the link below to unlock your account:

- -

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index 6a796b0..0000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -

Change your password

- -<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> - -
- <%= f.label :password, "New password" %>
- <% if @minimum_password_length %> - (<%= @minimum_password_length %> characters minimum)
- <% end %> - <%= f.password_field :password, autofocus: true, autocomplete: "off" %> -
- -
- <%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %> -
- -
- <%= f.submit "Change my password" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 3d6d11a..0000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Forgot your password?

- -<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.submit "Send me reset password instructions" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index 3ea40f0..0000000 --- a/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -

Edit <%= resource_name.to_s.humanize %>

- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> -
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
- <% end %> - -
- <%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password, autocomplete: "off" %> -
- -
- <%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %> -
- -
- <%= f.label :current_password %> (we need your current password to confirm your changes)
- <%= f.password_field :current_password, autocomplete: "off" %> -
- -
- <%= f.submit "Update" %> -
-<% end %> - -

Cancel my account

- -

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>

- -<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index 5a238ce..0000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -

Sign up

- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.label :password %> - <% if @minimum_password_length %> - (<%= @minimum_password_length %> characters minimum) - <% end %>
- <%= f.password_field :password, autocomplete: "off" %> -
- -
- <%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, autocomplete: "off" %> -
- -
- <%= f.submit "Sign up" %> -
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb deleted file mode 100644 index e6a3e41..0000000 --- a/app/views/devise/shared/_links.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%- if controller_name != 'sessions' %> - <%= link_to "Log in", new_session_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
-<% end -%> - -<%- 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) %>
- <% end -%> -<% end -%> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index 16586bc..0000000 --- a/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Resend unlock instructions

- -<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.submit "Resend unlock instructions" %> -
-<% end %> - -<%= render "devise/shared/links" %> From 6eae1d99848b2eddf4e1c3b20075ca27dd49a5fc Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 18:19:41 +0200 Subject: [PATCH 02/12] Zurb Foundation update --- app/assets/stylesheets/_settings.scss | 128 ++++++++++-------- .../stylesheets/foundation_and_overrides.scss | 31 +++-- 2 files changed, 86 insertions(+), 73 deletions(-) diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index 8c556ac..a4a83db 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -25,19 +25,20 @@ // 20. Label // 21. Media Object // 22. Menu -// 23. Off-canvas -// 24. Orbit -// 25. Pagination -// 26. Progress Bar -// 27. Reveal -// 28. Slider -// 29. Switch -// 30. Table -// 31. Tabs -// 32. Thumbnail -// 33. Title Bar -// 34. Tooltip -// 35. Top Bar +// 23. Meter +// 24. Off-canvas +// 25. Orbit +// 26. Pagination +// 27. Progress Bar +// 28. Reveal +// 29. Slider +// 30. Switch +// 31. Table +// 32. Tabs +// 33. Thumbnail +// 34. Title Bar +// 35. Tooltip +// 36. Top Bar @import 'util/util'; @@ -54,12 +55,13 @@ $debian-color: #c70338; $global-font-size: 100%; $global-width: rem-calc(1200); $global-lineheight: 1.5; -$primary-color: #808080; -//$primary-color: $debian-color; -$secondary-color: #777; -$success-color: #3adb76; -$warning-color: #ffae00; -$alert-color: #ec5840; +$foundation-palette: ( + primary: #2199e8, + secondary: #777, + success: #3adb76, + warning: #ffae00, + alert: #ec5840, +); $light-gray: #e6e6e6; $medium-gray: #cacaca; $dark-gray: #8a8a8a; @@ -75,6 +77,10 @@ $global-weight-normal: normal; $global-weight-bold: bold; $global-radius: 0; $global-text-direction: ltr; +$global-flexbox: false; +$print-transparent-backgrounds: true; + +@include add-foundation-colors; // 2. Breakpoints // -------------- @@ -185,9 +191,9 @@ $stat-font-size: 2.5rem; $abide-inputs: true; $abide-labels: true; -$input-background-invalid: $alert-color; -$form-label-color-invalid: $alert-color; -$input-error-color: $alert-color; +$input-background-invalid: map-get($foundation-palette, alert); +$form-label-color-invalid: map-get($foundation-palette, alert); +$input-error-color: map-get($foundation-palette, alert); $input-error-font-size: rem-calc(12); $input-error-font-weight: $global-weight-bold; @@ -201,7 +207,7 @@ $accordion-item-background-hover: $light-gray; $accordion-item-padding: 1.25rem 1rem; $accordion-content-background: $white; $accordion-content-border: 1px solid $light-gray; -$accordion-content-color: foreground($accordion-background, $primary-color); +$accordion-content-color: foreground($accordion-content-background, $body-font-color); $accordion-content-padding: 1rem; // 8. Accordion Menu @@ -239,8 +245,8 @@ $button-margin: 0 0 $global-margin 0; $button-fill: solid; $button-background: $primary-color; $button-background-hover: scale-color($button-background, $lightness: -15%); -$button-color: #fff; -$button-color-alt: #000; +$button-color: $white; +$button-color-alt: $black; $button-radius: $global-radius; $button-sizes: ( tiny: 0.6rem, @@ -296,8 +302,7 @@ $drilldown-background: $white; $dropdown-padding: 1rem; $dropdown-border: 1px solid $medium-gray; $dropdown-font-size: 1rem; -// $dropdown-width: 300px; -$dropdown-width: 400px; +$dropdown-width: 300px; $dropdown-radius: $global-radius; $dropdown-sizes: ( tiny: 100px, @@ -329,7 +334,7 @@ $fieldset-padding: rem-calc(20); $fieldset-margin: rem-calc(18 0); $legend-padding: rem-calc(0 3); $form-spacing: rem-calc(16); -$helptext-color: #333; +$helptext-color: $black; $helptext-font-size: rem-calc(13); $helptext-font-style: italic; $input-prefix-color: $black; @@ -341,9 +346,10 @@ $form-label-font-size: rem-calc(14); $form-label-font-weight: $global-weight-normal; $form-label-line-height: 1.8; $select-background: $white; -$select-triangle-color: #333; +$select-triangle-color: $dark-gray; $select-radius: $global-radius; $input-color: $black; +$input-placeholder-color: $medium-gray; $input-font-family: inherit; $input-font-size: rem-calc(16); $input-background: $white; @@ -353,7 +359,7 @@ $input-border: 1px solid $medium-gray; $input-border-focus: 1px solid $dark-gray; $input-shadow: inset 0 1px 2px rgba($black, 0.1); $input-shadow-focus: 0 0 5px $medium-gray; -$input-cursor-disabled: default; +$input-cursor-disabled: not-allowed; $input-transition: box-shadow 0.5s, border-color 0.25s ease-in-out; $input-number-spinners: true; $input-radius: $global-radius; @@ -379,12 +385,22 @@ $mediaobject-image-width-stacked: 100%; $menu-margin: 0; $menu-margin-nested: 1rem; -//$menu-item-padding: 0.7rem 1rem; -$menu-item-padding: 1.2rem 1rem; +$menu-item-padding: 0.7rem 1rem; +$menu-item-color-active: $white; +$menu-item-background-active: map-get($foundation-palette, primary); $menu-icon-spacing: 0.25rem; -$menu-expand-max: 6; -// 23. Off-canvas +// 23. Meter +// --------- + +$meter-height: 1rem; +$meter-radius: $global-radius; +$meter-background: $medium-gray; +$meter-fill-good: $success-color; +$meter-fill-medium: $warning-color; +$meter-fill-bad: $alert-color; + +// 24. Off-canvas // -------------- $offcanvas-size: 250px; @@ -397,7 +413,7 @@ $offcanvas-exit-background: rgba($white, 0.25); $maincontent-class: 'off-canvas-content'; $maincontent-shadow: 0 0 10px rgba($black, 0.5); -// 24. Orbit +// 25. Orbit // --------- $orbit-bullet-background: $medium-gray; @@ -412,7 +428,7 @@ $orbit-control-background-hover: rgba($black, 0.5); $orbit-control-padding: 1rem; $orbit-control-zindex: 10; -// 25. Pagination +// 26. Pagination // -------------- $pagination-font-size: rem-calc(14); @@ -429,34 +445,33 @@ $pagination-ellipsis-color: $black; $pagination-mobile-items: false; $pagination-arrows: true; -// 26. Progress Bar +// 27. Progress Bar // ---------------- -// $progress-height: 1rem; -$progress-height: 2rem; +$progress-height: 1rem; $progress-background: $medium-gray; $progress-margin-bottom: $global-margin; $progress-meter-background: $primary-color; $progress-radius: $global-radius; -// 27. Reveal +// 28. Reveal // ---------- $reveal-background: $white; $reveal-width: 600px; $reveal-max-width: $global-width; -$reveal-offset: rem-calc(100); $reveal-padding: $global-padding; $reveal-border: 1px solid $medium-gray; $reveal-radius: $global-radius; $reveal-zindex: 1005; $reveal-overlay-background: rgba($black, 0.45); -// 28. Slider +// 29. Slider // ---------- +$slider-width-vertical: 0.5rem; +$slider-transition: all 0.2s ease-in-out; $slider-height: 0.5rem; -$slider-width-vertical: $slider-height; $slider-background: $light-gray; $slider-fill-background: $medium-gray; $slider-handle-height: 1.4rem; @@ -464,9 +479,8 @@ $slider-handle-width: 1.4rem; $slider-handle-background: $primary-color; $slider-opacity-disabled: 0.25; $slider-radius: $global-radius; -$slider-transition: all 0.2s ease-in-out; -// 29. Switch +// 30. Switch // ---------- $switch-background: $medium-gray; @@ -482,7 +496,7 @@ $switch-paddle-offset: 0.25rem; $switch-paddle-radius: $global-radius; $switch-paddle-transition: all 0.25s ease-out; -// 30. Table +// 31. Table // --------- $table-background: $white; @@ -499,14 +513,13 @@ $table-foot-background: smart-scale($table-background, $table-color-scale); $table-head-font-color: $body-font-color; $show-header-for-stacked: false; -// 31. Tabs +// 32. Tabs // -------- $tab-margin: 0; $tab-background: $white; $tab-background-active: $light-gray; -$tab-border: $light-gray; -$tab-item-color: foreground($tab-background, $primary-color); +$tab-item-font-size: rem-calc(12); $tab-item-background-hover: $white; $tab-item-padding: 1.25rem 1.5rem; $tab-expand-max: 6; @@ -515,18 +528,17 @@ $tab-content-border: $light-gray; $tab-content-color: foreground($tab-background, $primary-color); $tab-content-padding: 1rem; -// 32. Thumbnail +// 33. Thumbnail // ------------- $thumbnail-border: solid 4px $white; $thumbnail-margin-bottom: $global-margin; $thumbnail-shadow: 0 0 0 1px rgba($black, 0.2); -// $thumbnail-shadow-hover: 0 0 6px 1px rgba($primary-color, 0.5); -$thumbnail-shadow-hover: 0 0 6px 3px rgba($primary-color, 0.5); +$thumbnail-shadow-hover: 0 0 6px 1px rgba($primary-color, 0.5); $thumbnail-transition: box-shadow 200ms ease-out; $thumbnail-radius: $global-radius; -// 33. Title Bar +// 34. Title Bar // ------------- $titlebar-background: $black; @@ -537,7 +549,7 @@ $titlebar-icon-color: $white; $titlebar-icon-color-hover: $medium-gray; $titlebar-icon-spacing: 0.25rem; -// 34. Tooltip +// 35. Tooltip // ----------- $has-tip-font-weight: $global-weight-bold; @@ -548,17 +560,17 @@ $tooltip-padding: 0.75rem; $tooltip-font-size: $small-font-size; $tooltip-pip-width: 0.75rem; $tooltip-pip-height: $tooltip-pip-width * 0.866; -$tooltip-pip-offset: 1.25rem; $tooltip-radius: $global-radius; -// 35. Top Bar +// 36. Top Bar // ----------- $topbar-padding: 0.5rem; -// $topbar-background: $light-gray; -$topbar-background: #2e3436; +$topbar-background: $light-gray; +$topbar-submenu-background: $topbar-background; $topbar-title-spacing: 1rem; $topbar-input-width: 200px; +$topbar-unstack-breakpoint: medium; // --------------------------------------------------- // -------------- debshots --------------------------- diff --git a/app/assets/stylesheets/foundation_and_overrides.scss b/app/assets/stylesheets/foundation_and_overrides.scss index d843b4d..f60bbaf 100644 --- a/app/assets/stylesheets/foundation_and_overrides.scss +++ b/app/assets/stylesheets/foundation_and_overrides.scss @@ -16,33 +16,34 @@ @include foundation-forms; @include foundation-visibility-classes; @include foundation-float-classes; -// @include foundation-accordion; -// @include foundation-accordion-menu; +@include foundation-accordion; +@include foundation-accordion-menu; @include foundation-badge; @include foundation-breadcrumbs; @include foundation-button-group; @include foundation-callout; -// @include foundation-close-button; -// @include foundation-drilldown-menu; +@include foundation-close-button; +@include foundation-drilldown-menu; @include foundation-dropdown; -// @include foundation-dropdown-menu; -// @include foundation-flex-video; +@include foundation-dropdown-menu; +@include foundation-flex-video; @include foundation-label; -// @include foundation-media-object; +@include foundation-media-object; @include foundation-menu; -// @include foundation-off-canvas; -// @include foundation-orbit; +@include foundation-menu-icon; +@include foundation-off-canvas; +@include foundation-orbit; @include foundation-pagination; @include foundation-progress-bar; -// @include foundation-slider; -// @include foundation-sticky; +@include foundation-slider; +@include foundation-sticky; @include foundation-reveal; -// @include foundation-switch; -// @include foundation-table; -// @include foundation-tabs; +@include foundation-switch; +@include foundation-table; +@include foundation-tabs; @include foundation-thumbnail; @include foundation-title-bar; -// @include foundation-tooltip; +@include foundation-tooltip; @include foundation-top-bar; // If you'd like to include motion-ui the foundation-rails gem comes prepackaged with it, uncomment the 3 @imports, if you are not using the gem you need to install the motion-ui sass package. From 602707c53d20a1086502d4ecc9740256dd17dce8 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 21:44:36 +0200 Subject: [PATCH 03/12] CSS settings fixed again after Foundation update --- app/assets/stylesheets/_settings.scss | 52 +++++++++++++++------------ 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index a4a83db..e69909c 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -56,7 +56,8 @@ $global-font-size: 100%; $global-width: rem-calc(1200); $global-lineheight: 1.5; $foundation-palette: ( - primary: #2199e8, + primary: $debian-color, + // primary: #2199e8, secondary: #777, success: #3adb76, warning: #ffae00, @@ -146,7 +147,8 @@ $code-font-weight: $global-weight-normal; $code-background: $light-gray; $code-border: 1px solid $medium-gray; $code-padding: rem-calc(2 5 1); -$anchor-color: $primary-color; +// $anchor-color: $primary-color; +$anchor-color: #fefefe; $anchor-color-hover: scale-color($anchor-color, $lightness: -14%); $anchor-text-decoration: none; $anchor-text-decoration-hover: none; @@ -385,7 +387,8 @@ $mediaobject-image-width-stacked: 100%; $menu-margin: 0; $menu-margin-nested: 1rem; -$menu-item-padding: 0.7rem 1rem; +// $menu-item-padding: 0.7rem 1rem; +$menu-item-padding: 0.5rem 1rem; $menu-item-color-active: $white; $menu-item-background-active: map-get($foundation-palette, primary); $menu-icon-spacing: 0.25rem; @@ -566,7 +569,8 @@ $tooltip-radius: $global-radius; // ----------- $topbar-padding: 0.5rem; -$topbar-background: $light-gray; +// $topbar-background: $light-gray; +$topbar-background: #2e3436; $topbar-submenu-background: $topbar-background; $topbar-title-spacing: 1rem; $topbar-input-width: 200px; @@ -576,27 +580,12 @@ $topbar-unstack-breakpoint: medium; // -------------- debshots --------------------------- // --------------------------------------------------- -// Hover colors of links in top bar -$topbar-link-bg-hover: $primary-color; -$topbar-dropdown-link-bg-hover: $primary-color; - -// Larger top bar -// $topbar-height: rem-calc(60); -// Larger font in top bar -// $topbar-link-font-size: rem-calc(15); $topbar-padding: 0; -// $topbar-button-font-size: rem-calc(3); -// $topbar-button-top: rem-calc(5); - -// $topbar-link-padding: rem-calc(8); // At which width the top navigation bar should be switched to // mobile mode because otherwise it would wrap into two lines. -$topbar-breakpoint: 800px; -$topbar-media-query: "only screen and (min-width: #{$topbar-breakpoint})"; - -// Import Google font -// @import url(//fonts.googleapis.com/css?family=Droid+Sans:400,700); +// $topbar-breakpoint: 800px; +// $topbar-media-query: "only screen and (min-width: #{$topbar-breakpoint})"; // Use fonts from out own site. Do not load from Google for privacy reasons. @font-face { @@ -658,7 +647,7 @@ body } } -.top-bar-title +.top-bar-left .sitename { // Display the site name in a larger font font-size: 26px; @@ -672,10 +661,27 @@ body } } -header +.top-bar-right .menu li a +{ + padding-top: 1.3rem; + padding-bottom: 1.3rem; +} + +.top-bar { // Draw a colored line below the navigation topbar border-bottom: 5px solid $debian_color; + color: #8a8a8a; + + a + { + color: #8a8a8a; + } + + a.active + { + color: #fefefe; + } } // ------- Footer - format as table cell to allow vertical centering From 7e7838e7adf0dfb1f5eb26452c4bb3d0be0cbf4c Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 21:46:09 +0200 Subject: [PATCH 04/12] Disabled progressbar in moderation view temporarily (wrong calculation) --- app/views/moderate/index.slim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/moderate/index.slim b/app/views/moderate/index.slim index 45baa73..00cacf3 100644 --- a/app/views/moderate/index.slim +++ b/app/views/moderate/index.slim @@ -4,9 +4,10 @@ - if @package // Progress bar - .progress.warning role="progressbar" tabindex="0" - span.progress-meter style="width: #{@percent_moderated}%" - p.progress-meter-text #{@percent_moderated}% + // TODO: Calculation for the progress bar is currently wrong + / .progress.warning role="progressbar" tabindex="0" + / span.progress-meter style="width: #{@percent_moderated}%" + / p.progress-meter-text #{@percent_moderated}% h2 Package: #{@package.name} p =@package.description From 4ad718d8549bf0941d606e0261eb3c1058233942 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 21:46:17 +0200 Subject: [PATCH 05/12] Cruft removed from Log model --- app/models/log.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/log.rb b/app/models/log.rb index 36d9b9c..02fa7cf 100644 --- a/app/models/log.rb +++ b/app/models/log.rb @@ -1,4 +1,4 @@ -require 'pry' +# require 'pry' class Log < ActiveRecord::Base validates :message, presence: true @@ -26,6 +26,6 @@ class Log < ActiveRecord::Base log.token = token logger.error "Could not log to database - validation errors: #{log.errors.to_a}" unless log.valid? log.save - log + # log end end From c467e0ef2368dd2162413c9c5ad90e75cb518dc6 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 22:41:19 +0200 Subject: [PATCH 06/12] Link color set back to primary color --- app/assets/stylesheets/_settings.scss | 138 ++++---------------------- 1 file changed, 21 insertions(+), 117 deletions(-) diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index e69909c..bc4c134 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -147,8 +147,7 @@ $code-font-weight: $global-weight-normal; $code-background: $light-gray; $code-border: 1px solid $medium-gray; $code-padding: rem-calc(2 5 1); -// $anchor-color: $primary-color; -$anchor-color: #fefefe; +$anchor-color: $primary-color; $anchor-color-hover: scale-color($anchor-color, $lightness: -14%); $anchor-text-decoration: none; $anchor-text-decoration-hover: none; @@ -611,13 +610,6 @@ $button-font-tny: rem-calc(15); // Make the background of progress bars use a light version of the primary color $progress-bar-color: tint($primary-color, 80); -// Enable special grid and block-grid sizes for xlarge and xxlarge screens -/*$include-xl-html-grid-classes: true;*/ -/*$include-xl-html-block-grid-classes: true;*/ -/*$row-width: 100%;*/ - - - $page-background: #f2f2f2; $footer-background: #333333; $footer-text-color: #b3b3b3; @@ -698,28 +690,28 @@ html, body { height: 100%; } -#footer -{ - background-color: $footer-background; - display: table; - width: 100%; +// #footer +// { +// background-color: $footer-background; +// display: table; +// width: 100%; - p - { - display: table-cell; - padding: 5px 20px; - color: $footer-text-color; - vertical-align: middle; - text-align: center; - font-size: 100%; - } +// p +// { +// display: table-cell; +// padding: 5px 20px; +// color: $footer-text-color; +// vertical-align: middle; +// text-align: center; +// font-size: 100%; +// } - a - { - color: $footer-text-color; - font-weight: bolder; - } -} +// a +// { +// color: $footer-text-color; +// font-weight: bolder; +// } +// } // Leave some room after the topbar @@ -728,37 +720,9 @@ html, body { padding-top: 5px; } -// Screenshot thumbnail image with name and description -// .thumbnail -// { -// padding-top: 5px !important; -// padding-bottom: 5px !important; - // border-radius: 10px; -// margin-bottom: 10px; -// text-align: center; -// line-height: 120%; - -// &:hover -// { -// background-color: #d0d0d0; -// } - -// .pkgname -// { -// font-weight: 700; -// } -// .pkgdescription -// { -// font-size: 80%; -// } -// } - .grid-thumbnails .column { - // border: 5px solid green; border-radius: 10px; - // border: 2px solid $light-gray; - // height: 300px; padding: 5px 5px 50px 5px; text-align: center; } @@ -815,14 +779,6 @@ html, body { } } -// .row .gridview -// { -// img.screenshot -// { -// width: 100%; -// } -// } - .pkgname { font-size: 130%; @@ -831,35 +787,6 @@ html, body { line-height: 120%; } - -/*.pkgdetails -{ - .description - { - font-size: 150%; - color: #808080; - padding-bottom: 10px; - } - - .longdescription - { - font-size: 90%; - line-height: 120%; - padding-bottom: 5px; - } - - .rating - { - padding-top: 5px; - vertical-align: bottom; - } - - .commentcount - { - padding-left: 20px; - } -} -*/ .grid-thumbnail { // Pretend that all thumbnails are 120 pixels high to align the captions properly @@ -952,28 +879,6 @@ a.black } } - -// .ratingbar -// { -// background-color: $progress-bar-color; -// width: 10em; -// display: inline-block; -// padding: 2px; -// text-align: left; -// color: white; -// text-transform: uppercase; -// font-size: 0.8em; -// font-weight: bolder; - -// .meter -// { -// background-color: $primary-color; -// padding: 2px; -// padding-left: 0.4em; -// text-shadow: 0 0 2px black; -// } -// } - /* Properties of a screenshot - shown in details view */ .property-title { @@ -991,5 +896,4 @@ a.black .description-verbatim-lines { line-height: 120%; - // white-space: pre-line; } From 10d5bab37cd58e51392af0025d2a2c479f463dda Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 22:41:31 +0200 Subject: [PATCH 07/12] Allow searching in logs view --- app/controllers/logs_controller.rb | 9 ++++++++- app/views/logs/index.html.slim | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controllers/logs_controller.rb b/app/controllers/logs_controller.rb index e63b34e..cedc8d4 100644 --- a/app/controllers/logs_controller.rb +++ b/app/controllers/logs_controller.rb @@ -2,6 +2,13 @@ class LogsController < ApplicationController before_action :authenticate_user! def index - @logs = Log.paginate(page: params[:page], per_page: 20) + logs = Log + + if params[:search].present? + logger.debug "Searching for #{params[:search]}" + logs = logs.where("message ilike ?", "%#{params[:search]}%") + end + + @logs = logs.paginate(page: params[:page], per_page: 20) end end diff --git a/app/views/logs/index.html.slim b/app/views/logs/index.html.slim index c37aa39..64db410 100644 --- a/app/views/logs/index.html.slim +++ b/app/views/logs/index.html.slim @@ -6,7 +6,8 @@ .small-6.medium-4.large-3.columns // Search form - = render 'packages/searchfield' + = form_tag url_for, :method=>'GET' + = text_field_tag(:search, params[:search], placeholder: "Search...", maxlength: 50, size: 20, autofocus: true) // List of log messages .row @@ -20,7 +21,7 @@ th =log.created_at th =log.message - else - p No logs. Crazy. + p No logs found. Crazy. - // Second paginator at the bottom so the user does not have to scroll up again + // Second paginator at the bottom so the user does not have to scroll up again = render 'logs/paginator' From 61cad639a6c7d0869c2bb4618e585b298e0883fc Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 22:41:50 +0200 Subject: [PATCH 08/12] Showing most wanted package on home page properly --- app/controllers/welcome_controller.rb | 4 ++-- app/views/welcome/home.slim | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 38af1ba..c598fd5 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -4,11 +4,11 @@ class WelcomeController < ApplicationController @newest_upload = Screenshot.newest_upload # TODO: Use the actually most popular package and not just a random one - @most_popular_package = Package.with_screenshots.first + @most_popular_package = Package.order(:visits).last @package_count = Package.count - @most_wanted = Package.without_screenshots_most_visits.first + @most_wanted_package = Package.without_screenshots_most_visits.first end def about diff --git a/app/views/welcome/home.slim b/app/views/welcome/home.slim index 4922e70..af1785a 100644 --- a/app/views/welcome/home.slim +++ b/app/views/welcome/home.slim @@ -24,8 +24,6 @@ div.row hr - -div.row div.large-4.medium-12.small-12.columns.text-center h2 Newest upload // TODO: load actual newest upload and cache it @@ -53,9 +51,9 @@ div.row div.large-4.medium-12.small-12.columns.text-center h2 Your help needed // TODO: load actual most popular package without a screenshot and cache it - a href=upload_package_by_name_path('firefox') + a href=upload_package_by_name_path(@most_wanted_package.name) img src="/images/dummy/no-screenshots-upload-one.svg" width="80%" p - ' We lack a screenshot for the Firefox package. Can you - a href=upload_package_by_name_path('firefox') provide one + ' We lack a screenshot for the #{@most_wanted_package.name} package. Can you + a href=package_path(@most_wanted_package.name) provide one ' ? From c6cbdb3e3a30bd48ca67dbdb3f63f7542d65a54b Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 24 Aug 2016 22:42:03 +0200 Subject: [PATCH 09/12] Top bar now part of a .row --- app/views/layouts/_topbar.slim | 71 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/app/views/layouts/_topbar.slim b/app/views/layouts/_topbar.slim index 8c6034a..7320dc2 100644 --- a/app/views/layouts/_topbar.slim +++ b/app/views/layouts/_topbar.slim @@ -1,38 +1,39 @@ -header +nav.top-bar .row - .top-bar - .top-bar-title - // TODO: Make the logo depend on the virtual host - img src="/images/logos/debian.svg" width="35" alt="Debian logo" - // TODO: Use proper distribution name - 'Debian Screenshots > + .top-bar-left + ul.menu + li.menu.sitename + a href='/' + // TODO: Make the logo depend on the virtual host + img src="/images/logos/debian.svg" width="35" alt="Debian logo" + // TODO: Use proper distribution name + ' Debian Screenshots > - .top-bar-right - ul.menu - li class=('active' if controller_name=='welcome' and action_name=='home') - a href="/" Home - li class=('active' if controller_name=='packages') - a href="/packages" Explore - //li.has-dropdown - //a href="#" Distributions - //ul.dropdown - //// TODO: Use proper distribution list - //li - //a href="#" Debian - //li - //a href="#" Ubuntu - li class=('active' if controller_name=='welcome' and action_name=='about') - a href="/about" About - li.divider - // TODO: Check correct classes in Zurb/Foundation for top bar! + .top-bar-right + ul.dropdown.menu data-dropdown-menu=true + li class=('active' if controller_name=='welcome' and action_name=='home') + a href="/" Home + li class=('active' if controller_name=='packages') + a href="/packages" Explore + //li.has-dropdown + //a href="#" Distributions + //ul.dropdown + //// TODO: Use proper distribution list + //li + //a href="#" Debian + //li + //a href="#" Ubuntu + li class=('active' if controller_name=='welcome' and action_name=='about') + a href="/about" About + // TODO: Check correct classes in Zurb/Foundation for top bar! + - if user_signed_in? + li + a href='#' Admin + ul.menu.vertical + li = link_to 'Moderate', moderate_path + li = link_to 'Logs', logs_path + li - if user_signed_in? - li.has-dropdown - a href='#' Admin - ul.dropdown - li = link_to 'Moderate', moderate_path - li = link_to 'Logs', logs_path - li.has-form - - if user_signed_in? - = link_to "#{current_user.email} (Logout)", destroy_user_session_path, :method => :delete - - else - = link_to 'Login', new_user_session_path + = link_to "#{current_user.email} (Logout)", destroy_user_session_path, :method => :delete + - else + = link_to 'Login', new_user_session_path From 107309a84c02d5f075c7fddcc26a0608ebfa3090 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 29 Aug 2016 18:17:16 +0200 Subject: [PATCH 10/12] Upload page seperated, styled and Javscript-pimped Actual upload is not yet working. --- app/assets/javascripts/application.js | 18 +++ app/assets/stylesheets/_settings.scss | 40 +++++-- app/views/packages/_details_rightbox.slim | 2 +- app/views/packages/details.slim | 2 +- app/views/packages/upload.slim | 140 ++++++++++------------ config/routes.rb | 4 +- 6 files changed, 113 insertions(+), 93 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 9b2247c..c60af6a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -37,3 +37,21 @@ load_reviews = function() { } ); }; + +// Initialize the upload form. +upload_form_init = function() { + // Disable the submit button until files are selected. + $('#file-submit').hide(); + + // Install event handler to notice when files were selected. + $('#file').on('change', upload_form_files_selected); +}; + +upload_form_files_selected = function() { + no_files = this.files.length; + if (no_files > 0) { + $('#file-label').html(no_files+" files selected"); + $('#file-select-button').addClass('success'); + $('#file-submit').fadeIn('slow'); + } +}; diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index bc4c134..f55b409 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -804,6 +804,20 @@ a.black color: #808080; } +.bigpanel +{ + background-color: $light-gray; + border-radius: 10px; + padding: 1em 1em 0.1em 1em; + margin-bottom: 1em; +} + +.subtitle +{ + font-size: 120%; + color: #808080; +} + .packagepage { h1 @@ -811,11 +825,6 @@ a.black margin-bottom: 0; } - .subtitle - { - font-size: 120%; - color: #808080; - } /* Description of a screenshot (e.g. the situation when the screenshot was taken) */ .imgcaption @@ -832,13 +841,6 @@ a.black color: #808080; } - .bigpanel - { - background-color: $light-gray; - border-radius: 10px; - padding: 1em 1em 0.1em 1em; - margin-bottom: 1em; - } .comment { @@ -897,3 +899,17 @@ a.black { line-height: 120%; } + +/* Hide the file upload button to just show the styleable label */ +/* display: none will not work - this is the workaround */ +.hidden-inputfile { + width: 0.1px; + height: 0.1px; + opacity: 0; + overflow: hidden; + position: absolute; + z-index: -1; +} +.inputfile + label { + cursor: pointer; /* "hand" cursor */ +} \ No newline at end of file diff --git a/app/views/packages/_details_rightbox.slim b/app/views/packages/_details_rightbox.slim index 069a93a..10e4579 100644 --- a/app/views/packages/_details_rightbox.slim +++ b/app/views/packages/_details_rightbox.slim @@ -20,7 +20,7 @@ ' Please help extend the collection of screenshots. ' Just make a screenshot and upload it here. You don't ' need to register or anything. - a.button.small.expand data-open="upload-modal" Upload now + a.button.small.expand href=upload_path(pkg.name) Upload now // homepage - if pkg.homepage.present? diff --git a/app/views/packages/details.slim b/app/views/packages/details.slim index 155d1a0..d583eae 100644 --- a/app/views/packages/details.slim +++ b/app/views/packages/details.slim @@ -63,7 +63,7 @@ .small-5.medium-5.columns = render(partial: 'details_rightbox', locals: {pkg: @package}) - = render(partial: 'details_uploadmodal') + / = render(partial: 'details_uploadmodal') javascript: $( function() { diff --git a/app/views/packages/upload.slim b/app/views/packages/upload.slim index cdf5372..08674ce 100644 --- a/app/views/packages/upload.slim +++ b/app/views/packages/upload.slim @@ -1,85 +1,71 @@ -.row.packagepage - .small-12.columns - h1 = "Upload a new screenshot for #{@package.name}>" +.row + h1 = "Upload a screenshot for #{@package.name}" + +.row + .small-7.columns p.subtitle = @package.description + p + ' You are about to upload a screenshot for the #{@package.name} + ' package. Thanks for your contribution. + - if @package.screenshots.any? + p + ' Just for your information - these screenshots have already been uploaded. -.row.packagepage - .small-12.medium-7.large-8.columns - // First row contains the upload form - .row - .small-6.columns - //input id="fileupload" type="file" name="files[]" data-url=upload_image_path(name: @package.name) multiple=true + .small-up-1.medium-up-3.large-up-4.grid-thumbnails + - @package.screenshots.all.each do |ss| + a.black.fancybox href=ss.image.url(:large, timestamp: false) rel='fancybox-thumb' title=ss.caption + = image_tag(ss.image.url(:thumb, timestamp: false), alt: ss.caption, class: 'thumbnail') - //= form_for @new_screenshot, :url => upload_image_path, :html => { :multipart => true } do |form| - // = form.file_field :image - // = form.submit 'Save' - = form_tag(upload_image_path, multipart: true) - = file_field_tag('image') - = submit_tag + // = render partial: 'packages/grid_thumbnail', locals: { pkg: pkg } - //a.button.radius.expand href=upload_package_by_name_path(name: @package.name) - //' Click or drag a PNG screenshot file here - .small-6.columns - ' Form - - @package.screenshots.each do |screenshot| - .row - img src=screenshot.image.url(:large, timestamp: false, alt: screenshot.caption) - = link_to "Delete screenshot", delete_screenshot_path(@package.name, screenshot.id), onclick: "return confirm('Really delete the screenshot?');" + - else + ' There are no screenshots yet for #{@package.name}. -// - @package.screenshots.each do |screenshot| -// .listview -// a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption -// = image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption) -// .imgcaption -// => screenshot.caption -// - if screenshot.uploader -// | (Uploaded by -// =< screenshot.uploader -// | ) + = form_tag(upload_image_path, multipart: true) - .small-12.medium-5.large-4.columns - .bigpanel - p Thanks for uploading more screenshots. Please note: - ul - li - ' Screenshots are made public and can freely be used by anyone. - li - ' Your screenshots must be in PNG format. - li - ' Images larger than 800x600 pixels will automatically be reduced. - ' So don't try to put too much detail on a screenshot. - li - ' Your screenshot should contain a typical scene when working with it. - li - ' Nice tools for taking screenshots are shutter, ksnapshot (KDE), - ' gimp, xwd or scrot. See the - a href='http://wiki.debian.org/ScreenShots' Debian wiki - ' for more information on how to make screenshots under Debian. - li - ' Please set your language to english so that everybody understands it. - ' If you don't use english by default please start your application - ' from a shell using after setting "export LANG=C". - li - ' Please only take a screenshot of the respective application and not of - ' your whole desktop (unless the screenshot is meant for a window manager). - li - ' If you are not logged in or lack the reputation then your screenshot - ' may need to be approved by the moderators first. + input.hidden-inputfile type="file" name="file" id="file" multiple=true + label for="file" + a.button id="file-select-button" + = fa_stacked_icon "image", base: "circle-thin" + span id="file-label" + ' Select screenshot files - //ul.small-block-grid-1.medium-block-grid-2.large-block-grid-2 - // - for screenshot in @package.screenshots - // li - // a.black.fancybox href=screenshot.url('large') rel='fancybox-thumb' title=screenshot.caption - // img src=screenshot.url('large') - // .imgcaption =screenshot.caption - // + button.button type="submit" id="file-submit" + = fa_stacked_icon "upload", base: "circle-thin" + ' Start upload -//javascript: -// $('#fileupload').fileupload({ -// dataType: 'json', -// done: function (e, data) { -// $.each(data.result.files, function (index, file) { -// $('

').text(file.name).appendTo(document.body); -// }); -// } -// }); + + .small-5.columns.bigpanel + p.subtitle Your upload… + ul + li + ' should contain a typical scene when working with it. + li + ' should show the actual application and not just + ' your whole desktop (unless the screenshot is meant for a window manager). + li + ' must be in PNG format. + li + ' can be multiple images at once. + li + ' needs to be approved by the moderators first before it is publicly visible. + li + ' will be reduced if it is lager than 800x600 pixels. + ' So don't try to capture too much detail in a screenshot. It may become + ' unreadable. Shrink the applications window if possible. + li + ' will be made public and can freely be used by anyone. + li + ' can be taken by screenshot tools like shutter, ksnapshot (KDE), + ' gimp, xwd or scrot. See the + a href='http://wiki.debian.org/ScreenShots' Debian wiki + ' for more information on how to make screenshots under Debian. + li + ' should preferably show the application in english. + ' If you don't use english by default please start your application + ' from a shell using after setting "export LANG=C". + +javascript: + // Hide the submit button unless images are selected for upload + $(document).ready(upload_form_init); + // TODO: Move into javascripts/packages/upload... diff --git a/config/routes.rb b/config/routes.rb index 5eafc3d..c3a8fc9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,9 +18,9 @@ Debshots::Application.routes.draw do get 'logs' => 'logs#index' get 'package/:name' => 'packages#details', as: :package, name: /[^\/]+/ get 'package_reviews/:name' => 'packages#reviews', as: :package_reviews, name: /[^\/]+/ - get 'upload', to: redirect('/packages') # legacy upload form + get 'upload', to: redirect('/packages'), as: :upload_legacy # legacy upload form post 'uploadfile' => 'packages#legacy_uploadfile' - get 'upload/:name' => 'packages#upload', as: :upload_package_by_name + get 'upload/:name' => 'packages#upload', as: :upload post 'upload_image/:name' => 'packages#upload_image', as: :upload_image, name: /[^\/]+/ # TODO: "get" is probably the wrong method to delete a screenshot get 'delete_screenshot/:id' => 'packages#delete_screenshot', as: :delete_screenshot From 5ba02d5d3509a66decc4a910c5949525f29368e9 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 29 Aug 2016 18:27:35 +0200 Subject: [PATCH 11/12] Select and upload-submit buttons aligned --- app/views/packages/upload.slim | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/views/packages/upload.slim b/app/views/packages/upload.slim index 08674ce..03042b5 100644 --- a/app/views/packages/upload.slim +++ b/app/views/packages/upload.slim @@ -23,16 +23,19 @@ = form_tag(upload_image_path, multipart: true) - input.hidden-inputfile type="file" name="file" id="file" multiple=true - label for="file" - a.button id="file-select-button" - = fa_stacked_icon "image", base: "circle-thin" - span id="file-label" - ' Select screenshot files + .row + .small-6.columns + input.hidden-inputfile type="file" name="file" id="file" multiple=true + label for="file" + a.button id="file-select-button" + = fa_stacked_icon "image", base: "circle-thin" + span id="file-label" + ' Select screenshot files - button.button type="submit" id="file-submit" - = fa_stacked_icon "upload", base: "circle-thin" - ' Start upload + .small-6.columns + button.button type="submit" id="file-submit" + = fa_stacked_icon "upload", base: "circle-thin" + ' Start upload .small-5.columns.bigpanel From 52590d866e3b44c1df9343d5f0886883e4fc9ef2 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 29 Aug 2016 19:57:36 +0200 Subject: [PATCH 12/12] Obsolete TODO hints removed --- app/views/welcome/home.slim | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/views/welcome/home.slim b/app/views/welcome/home.slim index af1785a..6909ed2 100644 --- a/app/views/welcome/home.slim +++ b/app/views/welcome/home.slim @@ -26,8 +26,6 @@ div.row hr div.large-4.medium-12.small-12.columns.text-center h2 Newest upload - // TODO: load actual newest upload and cache it - // TODO: link to the package page a.black href=package_path(@newest_upload.package.name) = image_tag(@newest_upload.image.url(:large, timestamp: false), alt: @newest_upload.caption) p @@ -38,8 +36,6 @@ div.row =@newest_upload.package.description div.large-4.medium-12.small-12.columns.text-center h2 Most popular - // TODO: load actual most popular package and highest-rated screenshot and cache it - // TODO: link to the package page a.black href=package_path(@most_popular_package.name) img src=@most_popular_package.screenshots.first.image.url(:large, timestamp: false) p @@ -50,7 +46,6 @@ div.row =@most_popular_package.description div.large-4.medium-12.small-12.columns.text-center h2 Your help needed - // TODO: load actual most popular package without a screenshot and cache it a href=upload_package_by_name_path(@most_wanted_package.name) img src="/images/dummy/no-screenshots-upload-one.svg" width="80%" p