Merge branch 'feature-redesign'

This commit is contained in:
pixeldesu 2015-04-19 16:52:49 +02:00
commit 4fcc86531b
12 changed files with 104 additions and 60 deletions

View File

@ -29,7 +29,7 @@ gem 'devise-async'
gem 'bootstrap_form' gem 'bootstrap_form'
gem 'font-kit-rails' gem 'font-kit-rails'
gem 'nprogress-rails' gem 'nprogress-rails'
gem 'font-awesome-rails', '~> 4.2.0.0' gem 'font-awesome-rails', '~> 4.3.0.0'
gem 'rails-assets-growl' gem 'rails-assets-growl'
gem "paperclip", "~> 4.2" gem "paperclip", "~> 4.2"
gem 'delayed_paperclip' gem 'delayed_paperclip'

View File

@ -105,7 +105,7 @@ GEM
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
faraday_middleware (0.9.1) faraday_middleware (0.9.1)
faraday (>= 0.7.4, < 0.10) faraday (>= 0.7.4, < 0.10)
font-awesome-rails (4.2.0.0) font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0) railties (>= 3.2, < 5.0)
font-kit-rails (1.1.0) font-kit-rails (1.1.0)
rails rails
@ -372,7 +372,7 @@ DEPENDENCIES
devise-async devise-async
factory_girl_rails factory_girl_rails
faker faker
font-awesome-rails (~> 4.2.0.0) font-awesome-rails (~> 4.3.0.0)
font-kit-rails font-kit-rails
foreman foreman
haml haml

View File

@ -41,11 +41,11 @@ $navbar-inverse-toggle-hover-bg: #512da8;
$navbar-inverse-toggle-icon-bar-bg: #7e57c2; $navbar-inverse-toggle-icon-bar-bg: #7e57c2;
$navbar-inverse-toggle-border-color: #512da8; $navbar-inverse-toggle-border-color: #512da8;
@import "bootswatch/paper/variables"; @import "bootswatch/cosmo/variables";
@import "bootstrap"; @import "bootstrap";
body { padding-top: $navbar-height; } body { padding-top: $navbar-height; }
@import "bootswatch/paper/bootswatch"; @import "bootswatch/cosmo/bootswatch";
@import "base"; @import "base";

View File

@ -125,3 +125,14 @@ body {
.links { .links {
padding-bottom: 10px; padding-bottom: 10px;
} }
.panel {
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.25);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.25);
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.panel-default {
border-color: transparent;
}

View File

@ -1,11 +1,13 @@
.navbar .nav .badge { .navbar .nav .badge {
padding: 3px 6px 3px; padding: 3px 6px 3px;
background-color: $navbar-inverse-link-active-bg; background-color: $navbar-inverse-link-active-bg;
color: #fff;
} }
.navbar .nav .active .badge, li.dropdown.open a.dropdown-toggle span.badge { .navbar .nav .active .badge, li.dropdown.open a.dropdown-toggle span.badge {
padding: 3px 6px 3px; padding: 3px 6px 3px;
background-color: $navbar-inverse-bg; background-color: $navbar-inverse-bg;
color: #fff;
} }
.navbar--inbox-animation { .navbar--inbox-animation {
@ -117,6 +119,16 @@
} }
.profile--image-dropdown > a { .profile--image-dropdown > a {
padding-top: 16px !important; padding: 0px !important;
padding-bottom: 16px !important; }
.profile--image-avatar {
min-height: 50px;
min-width: 50px;
height: 50px;
width: 50px;
}
.navbar-inverse {
border: none;
} }

View File

@ -67,8 +67,6 @@
} }
.profile--avatar { .profile--avatar {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
width: 100%; width: 100%;
height: auto; height: auto;
border: medium none; border: medium none;
@ -77,8 +75,8 @@
.profile--panel-badge { .profile--panel-badge {
width: 100%; width: 100%;
text-align: center; text-align: center;
padding-top: 0.05em; padding-top: 0.15em;
padding-bottom: 0.05em; padding-bottom: 0.15em;
text-transform: uppercase; text-transform: uppercase;
font-weight: bold; font-weight: bold;
margin: 0; margin: 0;

View File

@ -21,6 +21,24 @@ module ApplicationHelper
content_tag(:li, link_to(body.html_safe, path), class: ("#{'active ' if current_page? path}#{options[:class]}")) content_tag(:li, link_to(body.html_safe, path), class: ("#{'active ' if current_page? path}#{options[:class]}"))
end end
def list_group_item(body, path, options = {})
options = {
badge: nil,
badge_color: nil,
class: ''
}.merge(options)
unless options[:badge].nil? or options[:badge] == 0
# TODO: make this prettier?
body << " #{
content_tag(:span, options[:badge], class: ("badge#{
" badge-#{options[:badge_color]}" unless options[:badge_color].nil?
}"))}"
end
content_tag(:a, body.html_safe, href: path, class: ("list-group-item #{'active ' if current_page? path}#{options[:class]}"))
end
## ##
# #
def bootstrap_color c def bootstrap_color c

View File

@ -1,33 +1,36 @@
%li.dropdown.profile--image-dropdown %li.dropdown.profile--image-dropdown
%a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"}
%img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} %img.profile--image-avatar.hidden-xs{src: current_user.profile_picture.url(:small)}
%span.visible-xs %span.visible-xs
= current_user.screen_name = current_user.screen_name
%b.caret %b.caret
%ul.dropdown-menu.profile--dropdown %ul.dropdown-menu
%li.hidden-xs %li.dropdown-header.hidden-xs= current_user.screen_name
.media.profile--dropdown-media %li
.pull-left %a{href: show_user_profile_path(current_user.screen_name)}
%img.img-rounded.profile--dropdown-img{src: current_user.profile_picture.url(:medium)} %i.fa.fa-fw.fa-user
.media-body View profile
- if current_user.display_name.blank? %li
.profile--dropdown-username %a{href: edit_user_registration_path}
%a{href: show_user_profile_path(current_user.screen_name)} %i.fa.fa-fw.fa-cog
= current_user.screen_name Settings
- else
.profile--dropdown-displayname
%a{href: show_user_profile_path(current_user.screen_name)}
= current_user.display_name
.profile--username
= current_user.screen_name
%li.divider.hidden-xs
%li.visible-xs= link_to "View profile", show_user_profile_path(current_user.screen_name)
%li= link_to "Settings", edit_user_registration_path
%li.divider %li.divider
- if current_user.admin? - if current_user.admin?
%li= link_to "Kontrollzentrum", rails_admin_path %li
%li= link_to "Sidekiq", sidekiq_web_path %a{href: rails_admin_path}
%i.fa.fa-fw.fa-cogs
Kontrollzentrum
%li
%a{href: sidekiq_web_path}
%i.fa.fa-fw.fa-bar-chart
Sidekiq
- if current_user.mod? - if current_user.mod?
%li= link_to "Moderation panel", moderation_path %li
%a{href: moderation_path}
%i.fa.fa-fw.fa-gavel
Moderation Panel
%li.divider %li.divider
%li= link_to "Logout", destroy_user_session_path, method: :delete %li
%a{href: destroy_user_session_path, data: {method: :delete} }
%i.fa.fa-fw.fa-sign-out
Logout

View File

@ -1,9 +1,8 @@
.col-md-3.col-xs-12.col-sm-3 .col-md-3.col-xs-12.col-sm-3
.panel.panel-default.hidden-xs .panel.panel-default.hidden-xs
.panel-body .list-group
%ul.nav.nav-pills.nav-stacked = list_group_item "All notifications", notifications_path, badge: Notification.where(new: true).count
= nav_entry "All notifications", notifications_path = list_group_item "Answers", notifications_path('answer'), badge: Notification.where(target_type: "Answer", new: true).count
= nav_entry "Answers", notifications_path('answer') = list_group_item "Smiles", notifications_path('smile'), badge: Notification.where(target_type: "Smile", new: true).count
= nav_entry "Smiles", notifications_path('smile') = list_group_item "Comments", notifications_path('comment'), badge: Notification.where(target_type: "Comment", new: true).count
= nav_entry "Comments", notifications_path('comment') = list_group_item "Followers", notifications_path('relationship'), badge: Notification.where(target_type: "Relationship", new: true).count
= nav_entry "Followers", notifications_path('relationship')

View File

@ -23,12 +23,11 @@
%h4.entry-text#friend-count= current_user.friend_count %h4.entry-text#friend-count= current_user.friend_count
%h6.entry-subtext Following %h6.entry-subtext Following
.panel.panel-default.hidden-xs .panel.panel-default.hidden-xs
.panel-body %ul.nav.nav-pills.nav-stacked
%ul.nav.nav-pills.nav-stacked = list_group_item "Timeline", root_path
= nav_entry "Timeline", root_path = list_group_item "Public", public_timeline_path
= nav_entry "Public", public_timeline_path - current_user.groups.each do |group|
- current_user.groups.each do |group| = list_group_item group.display_name, group_timeline_path(group.name)
= nav_entry group.display_name, group_timeline_path(group.name)
- unless @group.nil? - unless @group.nil?
.panel.panel-default.profile--panel.hidden-xs .panel.panel-default.profile--panel.hidden-xs
.panel-heading .panel-heading

View File

@ -7,8 +7,9 @@
.row .row
.col-sm-4 .col-sm-4
.panel.panel-default .panel.panel-default
.panel-heading
%h3.panel-title The Team
.panel-body .panel-body
%h3 The Team
The people behind The people behind
= succeed '!' do = succeed '!' do
= APP_CONFIG['site_name'] = APP_CONFIG['site_name']
@ -22,8 +23,9 @@
%h4.entry-text.entry-about= adm['about_text'] %h4.entry-text.entry-about= adm['about_text']
%h6.entry-subtext= adm['subtext'] %h6.entry-subtext= adm['subtext']
.panel.panel-default .panel.panel-default
.panel-heading
%h3.panel-title Moderators
.panel-body .panel-body
%h3 Moderators
The people on The people on
= APP_CONFIG['site_name'] = APP_CONFIG['site_name']
that look after you! that look after you!
@ -33,8 +35,9 @@
%img.img-rounded.answerbox--img-small{src: mod.profile_picture.url(:small)} %img.img-rounded.answerbox--img-small{src: mod.profile_picture.url(:small)}
.col-sm-4 .col-sm-4
.panel.panel-default .panel.panel-default
.panel-heading
%h3.panel-title Unfinished Project
.panel-body .panel-body
%h3 Unfinished
%p %p
= APP_CONFIG['site_name'] = APP_CONFIG['site_name']
is running on unfinished code, full of bugs. Caveat emptor. is running on unfinished code, full of bugs. Caveat emptor.
@ -48,9 +51,10 @@
Still have some questions? Check our Still have some questions? Check our
= link_to "FAQ!", help_faq_path = link_to "FAQ!", help_faq_path
.panel.panel-default .panel.panel-default
.panel-heading
%h3.panel-title Statistics
.panel-body .panel-body
There are lies, damned lies, and then there are... %p All-time statistics for #{APP_CONFIG['site_name']}
%h3 Statistics
.row .row
.col-xs-6 .col-xs-6
%h4.entry-text#asked-count= Question.count %h4.entry-text#asked-count= Question.count
@ -71,8 +75,9 @@
%h6.entry-subtext Users %h6.entry-subtext Users
.col-sm-4 .col-sm-4
.panel.panel-default .panel.panel-default
.panel-heading
%h3.panel-title Funding
.panel-body .panel-body
%h3 Funding
Currently Retrospring is running of the developers funds and will be able to sustain at the current needs of servers. Hereby we want to thank the people who previously donated to our project and helped it grow. Everyone shown at the bottom of this panel has contributed to the project with donations or great input. Currently Retrospring is running of the developers funds and will be able to sustain at the current needs of servers. Hereby we want to thank the people who previously donated to our project and helped it grow. Everyone shown at the bottom of this panel has contributed to the project with donations or great input.
%ul.about--moderator %ul.about--moderator
- User.where(supporter: true).each do |sup| - User.where(supporter: true).each do |sup|

View File

@ -1,11 +1,10 @@
.col-md-3.col-xs-12.col-sm-3 .col-md-3.col-xs-12.col-sm-3
.panel.panel-default .panel.panel-default
.panel-body .list-group
%ul.nav.nav-pills.nav-stacked = list_group_item "Account", edit_user_registration_path
= nav_entry "Account", edit_user_registration_path = list_group_item "Profile", edit_user_profile_path
= nav_entry "Profile", edit_user_profile_path = list_group_item "Privacy", edit_user_privacy_path
= nav_entry "Privacy", edit_user_privacy_path = list_group_item "Sharing", services_path
= nav_entry "Sharing", services_path
.hidden-xs= render "shared/links" .hidden-xs= render "shared/links"