From 75ae141759452cc84c259cd05f1016fa1d48f5fb Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 16 Jan 2015 22:36:39 +0100 Subject: [PATCH 001/231] added privacy policy --- app/controllers/static_controller.rb | 4 ++++ app/views/static/privacy_policy.html.haml | 25 +++++++++++++++++++++++ config/routes.rb | 1 + 3 files changed, 30 insertions(+) create mode 100644 app/views/static/privacy_policy.html.haml diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 287b0361..7f25bce8 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -16,4 +16,8 @@ class StaticController < ApplicationController def faq end + + def privacy_policy + + end end diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml new file mode 100644 index 00000000..5bd273f7 --- /dev/null +++ b/app/views/static/privacy_policy.html.haml @@ -0,0 +1,25 @@ +%h1 Privacy Policy +%p This Privacy Policy describes how and when Retrospring uses and collects your data, checks your information and shares with other Services. +%h2 Information Collection and Use +%h4 Basic Account Information +%p When you create a Retrospring account, you provide some personal information, such as your name, username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. +%h4 Additional Information +%p You may provide us with information for public displaying, like a short biography, a link to your website, your location or a profile picture. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. +%h4 Answers and Questions +%p Our Service primarily is designed to ask your friends and other people from around the world questions or answer them. Most of the information you provide us is information you are asking us to make public. This information does not only include the questions, answers, comments and smiles, but also the groups you create, the people you follow and other bits of information that result from using our Service. +%h4 Cookies +%p Like many websites, we use cookies and similar technologies to collect additional website usage data and to improve our Services. A cookie is a small data file that is transferred to your computer's hard disk. Retrospring uses persistant cookies to improve the users browsing experience and to to better understand how you interact with our Services. Most Internet browsers automatically accept cookies. You can instruct your browser, by changing its settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. However, the Services may not function properly if you disable cookies. +%h4 Log Data +%p When you use our Services, we may receive information ("Log Data") such as your IP address, browser type, operating system, the referring web page, pages visited, location, your mobile carrier, device information (including device and application IDs), search terms, and cookie information. We receive Log Data when you interact with our Services, for example, when you visit our websites or sign into our Services. +%h4 Third-Party Services +%p Retrospring uses a variety of third-party services to help provide our Services and to help us understand and improve the use of our Services, such as Piwik Analytics, or to share your answers to, if connected, other Services like Twitter, Tumblr or Facebook. These third-party service providers may collect information sent by your browser as part of a web page request, such as cookies or your IP address. +%h2 Information Sharing +%p Retrospring will keep any collected data (see "Information Collection and Use" above) encrypted on our servers. Any information shared with other Services is controlled by the user itself, as we only supply sharing to these. If a user isn't satisfied with Terms from another Service they shouldn't connect their accounts or remove access over the Sharing page on the profile settings page. +%p Notwithstanding anything to the contrary in this Policy, we may preserve or disclose your information if we believe that it is reasonably necessary to comply with a law, regulation or legal request; to protect the safety of any person; to address fraud, security or technical issues; or to protect Retrospring's rights or property. However, nothing in this Privacy Policy is intended to limit any legal defenses or objections that you may have to a third party’s, including a government’s, request to disclose your information. +%h2 Modifying Your Personal Information +%p If you are a registered user of our Services, we provide you with tools and account settings to access or modify the personal information you provided to us and associated with your account. +%p You can also permanently delete your Retrospring account with a button at the bottom of the account settings page. Removing your account will cease your ability to log in with your credentials and the loss of all your data you supplied to the Service. +%h2 Our Policy Towards Children +%p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. +%p + %em Effective: 17th January 2015 \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 8ae75153..dbc991d1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,6 +27,7 @@ Rails.application.routes.draw do match '/about', to: 'static#about', via: 'get' match '/help/faq', to: 'static#faq', via: 'get', as: :help_faq + match '/privacy', to: 'static#privacy_policy', via: 'get', as: :privacy_policy # Devise routes devise_for :users, path: 'user', skip: [:sessions, :registrations] From d593e0edd4ff742a610eb310e932af6e7b579295 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 16 Jan 2015 22:43:56 +0100 Subject: [PATCH 002/231] added privacy policy --- app/views/static/privacy_policy.html.haml | 52 ++++++++++++----------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml index 5bd273f7..a65d0fbf 100644 --- a/app/views/static/privacy_policy.html.haml +++ b/app/views/static/privacy_policy.html.haml @@ -1,25 +1,27 @@ -%h1 Privacy Policy -%p This Privacy Policy describes how and when Retrospring uses and collects your data, checks your information and shares with other Services. -%h2 Information Collection and Use -%h4 Basic Account Information -%p When you create a Retrospring account, you provide some personal information, such as your name, username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. -%h4 Additional Information -%p You may provide us with information for public displaying, like a short biography, a link to your website, your location or a profile picture. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. -%h4 Answers and Questions -%p Our Service primarily is designed to ask your friends and other people from around the world questions or answer them. Most of the information you provide us is information you are asking us to make public. This information does not only include the questions, answers, comments and smiles, but also the groups you create, the people you follow and other bits of information that result from using our Service. -%h4 Cookies -%p Like many websites, we use cookies and similar technologies to collect additional website usage data and to improve our Services. A cookie is a small data file that is transferred to your computer's hard disk. Retrospring uses persistant cookies to improve the users browsing experience and to to better understand how you interact with our Services. Most Internet browsers automatically accept cookies. You can instruct your browser, by changing its settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. However, the Services may not function properly if you disable cookies. -%h4 Log Data -%p When you use our Services, we may receive information ("Log Data") such as your IP address, browser type, operating system, the referring web page, pages visited, location, your mobile carrier, device information (including device and application IDs), search terms, and cookie information. We receive Log Data when you interact with our Services, for example, when you visit our websites or sign into our Services. -%h4 Third-Party Services -%p Retrospring uses a variety of third-party services to help provide our Services and to help us understand and improve the use of our Services, such as Piwik Analytics, or to share your answers to, if connected, other Services like Twitter, Tumblr or Facebook. These third-party service providers may collect information sent by your browser as part of a web page request, such as cookies or your IP address. -%h2 Information Sharing -%p Retrospring will keep any collected data (see "Information Collection and Use" above) encrypted on our servers. Any information shared with other Services is controlled by the user itself, as we only supply sharing to these. If a user isn't satisfied with Terms from another Service they shouldn't connect their accounts or remove access over the Sharing page on the profile settings page. -%p Notwithstanding anything to the contrary in this Policy, we may preserve or disclose your information if we believe that it is reasonably necessary to comply with a law, regulation or legal request; to protect the safety of any person; to address fraud, security or technical issues; or to protect Retrospring's rights or property. However, nothing in this Privacy Policy is intended to limit any legal defenses or objections that you may have to a third party’s, including a government’s, request to disclose your information. -%h2 Modifying Your Personal Information -%p If you are a registered user of our Services, we provide you with tools and account settings to access or modify the personal information you provided to us and associated with your account. -%p You can also permanently delete your Retrospring account with a button at the bottom of the account settings page. Removing your account will cease your ability to log in with your credentials and the loss of all your data you supplied to the Service. -%h2 Our Policy Towards Children -%p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. -%p - %em Effective: 17th January 2015 \ No newline at end of file +.container + .panel.panel-default + %h1 Privacy Policy + %p This Privacy Policy describes how and when Retrospring uses and collects your data, checks your information and shares with other Services. + %h2 Information Collection and Use + %h4 Basic Account Information + %p When you create a Retrospring account, you provide some personal information, such as your name, username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. + %h4 Additional Information + %p You may provide us with information for public displaying, like a short biography, a link to your website, your location or a profile picture. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. + %h4 Answers and Questions + %p Our Service primarily is designed to ask your friends and other people from around the world questions or answer them. Most of the information you provide us is information you are asking us to make public. This information does not only include the questions, answers, comments and smiles, but also the groups you create, the people you follow and other bits of information that result from using our Service. + %h4 Cookies + %p Like many websites, we use cookies and similar technologies to collect additional website usage data and to improve our Services. A cookie is a small data file that is transferred to your computer's hard disk. Retrospring uses persistant cookies to improve the users browsing experience and to to better understand how you interact with our Services. Most Internet browsers automatically accept cookies. You can instruct your browser, by changing its settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. However, the Services may not function properly if you disable cookies. + %h4 Log Data + %p When you use our Services, we may receive information ("Log Data") such as your IP address, browser type, operating system, the referring web page, pages visited, location, your mobile carrier, device information (including device and application IDs), search terms, and cookie information. We receive Log Data when you interact with our Services, for example, when you visit our websites or sign into our Services. + %h4 Third-Party Services + %p Retrospring uses a variety of third-party services to help provide our Services and to help us understand and improve the use of our Services, such as Piwik Analytics, or to share your answers to, if connected, other Services like Twitter, Tumblr or Facebook. These third-party service providers may collect information sent by your browser as part of a web page request, such as cookies or your IP address. + %h2 Information Sharing + %p Retrospring will keep any collected data (see "Information Collection and Use" above) encrypted on our servers. Any information shared with other Services is controlled by the user itself, as we only supply sharing to these. If a user isn't satisfied with Terms from another Service they shouldn't connect their accounts or remove access over the Sharing page on the profile settings page. + %p Notwithstanding anything to the contrary in this Policy, we may preserve or disclose your information if we believe that it is reasonably necessary to comply with a law, regulation or legal request; to protect the safety of any person; to address fraud, security or technical issues; or to protect Retrospring's rights or property. However, nothing in this Privacy Policy is intended to limit any legal defenses or objections that you may have to a third party’s, including a government’s, request to disclose your information. + %h2 Modifying Your Personal Information + %p If you are a registered user of our Services, we provide you with tools and account settings to access or modify the personal information you provided to us and associated with your account. + %p You can also permanently delete your Retrospring account with a button at the bottom of the account settings page. Removing your account will cease your ability to log in with your credentials and the loss of all your data you supplied to the Service. + %h2 Our Policy Towards Children + %p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. + %p + %em Effective: 17th January 2015 \ No newline at end of file From 28e72b3adcd58460b7ad8fc27deea3645339d6de Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 16 Jan 2015 22:45:00 +0100 Subject: [PATCH 003/231] added panel-body --- app/views/static/privacy_policy.html.haml | 51 ++++++++++++----------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml index a65d0fbf..5fee3162 100644 --- a/app/views/static/privacy_policy.html.haml +++ b/app/views/static/privacy_policy.html.haml @@ -1,27 +1,28 @@ .container .panel.panel-default - %h1 Privacy Policy - %p This Privacy Policy describes how and when Retrospring uses and collects your data, checks your information and shares with other Services. - %h2 Information Collection and Use - %h4 Basic Account Information - %p When you create a Retrospring account, you provide some personal information, such as your name, username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. - %h4 Additional Information - %p You may provide us with information for public displaying, like a short biography, a link to your website, your location or a profile picture. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. - %h4 Answers and Questions - %p Our Service primarily is designed to ask your friends and other people from around the world questions or answer them. Most of the information you provide us is information you are asking us to make public. This information does not only include the questions, answers, comments and smiles, but also the groups you create, the people you follow and other bits of information that result from using our Service. - %h4 Cookies - %p Like many websites, we use cookies and similar technologies to collect additional website usage data and to improve our Services. A cookie is a small data file that is transferred to your computer's hard disk. Retrospring uses persistant cookies to improve the users browsing experience and to to better understand how you interact with our Services. Most Internet browsers automatically accept cookies. You can instruct your browser, by changing its settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. However, the Services may not function properly if you disable cookies. - %h4 Log Data - %p When you use our Services, we may receive information ("Log Data") such as your IP address, browser type, operating system, the referring web page, pages visited, location, your mobile carrier, device information (including device and application IDs), search terms, and cookie information. We receive Log Data when you interact with our Services, for example, when you visit our websites or sign into our Services. - %h4 Third-Party Services - %p Retrospring uses a variety of third-party services to help provide our Services and to help us understand and improve the use of our Services, such as Piwik Analytics, or to share your answers to, if connected, other Services like Twitter, Tumblr or Facebook. These third-party service providers may collect information sent by your browser as part of a web page request, such as cookies or your IP address. - %h2 Information Sharing - %p Retrospring will keep any collected data (see "Information Collection and Use" above) encrypted on our servers. Any information shared with other Services is controlled by the user itself, as we only supply sharing to these. If a user isn't satisfied with Terms from another Service they shouldn't connect their accounts or remove access over the Sharing page on the profile settings page. - %p Notwithstanding anything to the contrary in this Policy, we may preserve or disclose your information if we believe that it is reasonably necessary to comply with a law, regulation or legal request; to protect the safety of any person; to address fraud, security or technical issues; or to protect Retrospring's rights or property. However, nothing in this Privacy Policy is intended to limit any legal defenses or objections that you may have to a third party’s, including a government’s, request to disclose your information. - %h2 Modifying Your Personal Information - %p If you are a registered user of our Services, we provide you with tools and account settings to access or modify the personal information you provided to us and associated with your account. - %p You can also permanently delete your Retrospring account with a button at the bottom of the account settings page. Removing your account will cease your ability to log in with your credentials and the loss of all your data you supplied to the Service. - %h2 Our Policy Towards Children - %p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. - %p - %em Effective: 17th January 2015 \ No newline at end of file + .panel-body + %h1 Privacy Policy + %p This Privacy Policy describes how and when Retrospring uses and collects your data, checks your information and shares with other Services. + %h2 Information Collection and Use + %h4 Basic Account Information + %p When you create a Retrospring account, you provide some personal information, such as your name, username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. + %h4 Additional Information + %p You may provide us with information for public displaying, like a short biography, a link to your website, your location or a profile picture. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. + %h4 Answers and Questions + %p Our Service primarily is designed to ask your friends and other people from around the world questions or answer them. Most of the information you provide us is information you are asking us to make public. This information does not only include the questions, answers, comments and smiles, but also the groups you create, the people you follow and other bits of information that result from using our Service. + %h4 Cookies + %p Like many websites, we use cookies and similar technologies to collect additional website usage data and to improve our Services. A cookie is a small data file that is transferred to your computer's hard disk. Retrospring uses persistant cookies to improve the users browsing experience and to to better understand how you interact with our Services. Most Internet browsers automatically accept cookies. You can instruct your browser, by changing its settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. However, the Services may not function properly if you disable cookies. + %h4 Log Data + %p When you use our Services, we may receive information ("Log Data") such as your IP address, browser type, operating system, the referring web page, pages visited, location, your mobile carrier, device information (including device and application IDs), search terms, and cookie information. We receive Log Data when you interact with our Services, for example, when you visit our websites or sign into our Services. + %h4 Third-Party Services + %p Retrospring uses a variety of third-party services to help provide our Services and to help us understand and improve the use of our Services, such as Piwik Analytics, or to share your answers to, if connected, other Services like Twitter, Tumblr or Facebook. These third-party service providers may collect information sent by your browser as part of a web page request, such as cookies or your IP address. + %h2 Information Sharing + %p Retrospring will keep any collected data (see "Information Collection and Use" above) encrypted on our servers. Any information shared with other Services is controlled by the user itself, as we only supply sharing to these. If a user isn't satisfied with Terms from another Service they shouldn't connect their accounts or remove access over the Sharing page on the profile settings page. + %p Notwithstanding anything to the contrary in this Policy, we may preserve or disclose your information if we believe that it is reasonably necessary to comply with a law, regulation or legal request; to protect the safety of any person; to address fraud, security or technical issues; or to protect Retrospring's rights or property. However, nothing in this Privacy Policy is intended to limit any legal defenses or objections that you may have to a third party’s, including a government’s, request to disclose your information. + %h2 Modifying Your Personal Information + %p If you are a registered user of our Services, we provide you with tools and account settings to access or modify the personal information you provided to us and associated with your account. + %p You can also permanently delete your Retrospring account with a button at the bottom of the account settings page. Removing your account will cease your ability to log in with your credentials and the loss of all your data you supplied to the Service. + %h2 Our Policy Towards Children + %p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. + %p + %em Effective: 17th January 2015 \ No newline at end of file From 74e74dedef5699bcbe59ab6cf514eb035ab20e89 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 16 Jan 2015 23:16:28 +0100 Subject: [PATCH 004/231] added terms of service --- app/controllers/static_controller.rb | 4 ++++ app/views/static/terms.html.haml | 22 ++++++++++++++++++++++ config/routes.rb | 1 + 3 files changed, 27 insertions(+) create mode 100644 app/views/static/terms.html.haml diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 7f25bce8..a0386471 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -20,4 +20,8 @@ class StaticController < ApplicationController def privacy_policy end + + def terms + + end end diff --git a/app/views/static/terms.html.haml b/app/views/static/terms.html.haml new file mode 100644 index 00000000..adcf8214 --- /dev/null +++ b/app/views/static/terms.html.haml @@ -0,0 +1,22 @@ +.container + .panel.panel-default + .panel-body + %h1 Terms of Use + %p These Terms of Service ("Terms") govern your access to and use of the services (the "Services" or “Retrospring”), and any information, text, graphics, photos or other materials uploaded, downloaded or appearing on the Services (collectively referred to as "Content"). Your access to and use of the Services are conditioned on your acceptance of and compliance with these Terms. By accessing or using the Services you agree to be bound by these Terms. + %h2 1. Basic Terms + %p You are responsible for your use of the Services, for any Content you post to the Services, and for any consequences thereof. The Content you submit, post, or display will be able to be viewed by other users of the Services and through third party services and websites (go to the account settings page to control who sees your Content). You should only provide Content that you are comfortable sharing with others under these Terms. + %p You may use the Services only if you can form a binding contract with Retrospring and are not a person barred from receiving services under the laws of any applicable jurisdiction. If you are accepting these Terms and using the Services on behalf of a company, organization, government, or other legal entity, you represent and warrant that you are authorized to do so. You may use the Services only in compliance with these Terms and all applicable local, state, national, and international laws, rules and regulations. + %h2 2. Privacy + %p Any information that you provide to Retrospring is subject to our Privacy Policy, which governs our collection and use of your information. You understand that through your use of the Services you consent to the collection and use (as set forth in the Privacy Policy) of this information. As part of providing you the Services, we may need to provide you with certain communications, such as service announcements and administrative messages. These communications are considered part of the Services and your Retrospring account, which you may not be able to opt-out from receiving. + %h2 3. Passwords + %p You are responsible for safeguarding the password that you use to access the Services and for any activities or actions under your password. We encourage you to use "strong" passwords (passwords that use a combination of upper and lower case letters, numbers and symbols) with your account. Retrospring cannot and will not be liable for any loss or damage arising from your failure to comply with the above. + %h2 4. Content on the Services + %p All Content, whether publicly posted or privately transmitted, is the sole responsibility of the person who originated such Content. We may not monitor or control the Content posted via the Services and, we cannot take responsibility for such Content. Any use or reliance on any Content or materials posted via the Services or obtained by you through the Services is at your own risk. + %p We do not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Content or communications posted via the Services or endorse any opinions expressed via the Services. You understand that by using the Services, you may be exposed to Content that might be offensive, harmful, inaccurate or otherwise inappropriate, or in some cases, postings that have been mislabeled or are otherwise deceptive. Under no circumstances will Retrospring be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the Services or broadcast elsewhere. + %h2 5. Your Rights + %p You retain your rights to any Content you submit, post or display on or through the Services. + %h2 6. Restrictions on Content and Use of the Services + %p We reserve the right at all times (but will not have an obligation) to remove or refuse to distribute any Content on the Services, to suspend or terminate users, and to reclaim usernames without liability to you. We also reserve the right to access, read, preserve, and disclose any information as we reasonably believe is necessary to satisfy any applicable law, regulation, legal process or governmental request, enforce the Terms, including investigation of potential violations hereof, detect, prevent, or otherwise address fraud, security or technical issues, respond to user support requests, or protect the rights, property or safety of Retrospring, its users and the public. + %h2 9. Copyright Policy + %p Retrospring respects the intellectual property rights of others and expects users of the Services to do the same. We will respond to notices of alleged copyright infringement that comply with applicable law and are properly provided to us. If you believe that your Content has been copied in a way that constitutes copyright infringement, please provide us with the following information: a physical or electronic signature of the copyright owner or a person authorized to act on their behalf; identification of the copyrighted work claimed to have been infringed; identification of the material that is claimed to be infringing or to be the subject of infringing activity and that is to be removed or access to which is to be disabled, and information reasonably sufficient to permit us to locate the material; your contact information, including your address, telephone number, and an email address; a statement by you that you have a good faith belief that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law; and a statement that the information in the notification is accurate, and, under penalty of perjury, that you are authorized to act on behalf of the copyright owner. + %p We reserve the right to remove Content alleged to be infringing without prior notice, at our sole discretion, and without liability to you. In appropriate circumstances, Retrospring will also terminate a user’s account if the user is determined to be a repeat infringer. \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index dbc991d1..5ad09a18 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,6 +28,7 @@ Rails.application.routes.draw do match '/about', to: 'static#about', via: 'get' match '/help/faq', to: 'static#faq', via: 'get', as: :help_faq match '/privacy', to: 'static#privacy_policy', via: 'get', as: :privacy_policy + match '/terms', to: 'static#terms', via: 'get', as: :terms # Devise routes devise_for :users, path: 'user', skip: [:sessions, :registrations] From ec62fea66500f30d62cdd92fc75548b419082ac1 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 16 Jan 2015 23:31:02 +0100 Subject: [PATCH 005/231] updated screen name validator --- app/validators/screen_name_validator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/validators/screen_name_validator.rb b/app/validators/screen_name_validator.rb index e0158662..b8279de2 100644 --- a/app/validators/screen_name_validator.rb +++ b/app/validators/screen_name_validator.rb @@ -1,7 +1,8 @@ class ScreenNameValidator < ActiveModel::EachValidator FORBIDDEN_SCREEN_NAMES = %w(justask_admin retrospring_admin admin justask retrospring support about public notifications inbox sign_in sign_up sidekiq moderation moderator mod administrator - siteadmin site_admin help retro_spring retroospring retrosprlng niisding nllsding) + siteadmin site_admin help retro_spring retroospring retrosprlng niisding nllsding + pixeidesu terms privacy help) def validate_each(record, attribute, value) if FORBIDDEN_SCREEN_NAMES.include? value.downcase From d5b14f0654b7fccd2bd5bdb4e944ce6d4b25c65d Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 17 Jan 2015 09:13:56 +0100 Subject: [PATCH 006/231] update effective date --- app/views/static/privacy_policy.html.haml | 2 +- app/views/static/terms.html.haml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml index 5fee3162..7eb5b825 100644 --- a/app/views/static/privacy_policy.html.haml +++ b/app/views/static/privacy_policy.html.haml @@ -25,4 +25,4 @@ %h2 Our Policy Towards Children %p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. %p - %em Effective: 17th January 2015 \ No newline at end of file + %em Effective: 18th January 2015 \ No newline at end of file diff --git a/app/views/static/terms.html.haml b/app/views/static/terms.html.haml index adcf8214..bfe4afab 100644 --- a/app/views/static/terms.html.haml +++ b/app/views/static/terms.html.haml @@ -19,4 +19,6 @@ %p We reserve the right at all times (but will not have an obligation) to remove or refuse to distribute any Content on the Services, to suspend or terminate users, and to reclaim usernames without liability to you. We also reserve the right to access, read, preserve, and disclose any information as we reasonably believe is necessary to satisfy any applicable law, regulation, legal process or governmental request, enforce the Terms, including investigation of potential violations hereof, detect, prevent, or otherwise address fraud, security or technical issues, respond to user support requests, or protect the rights, property or safety of Retrospring, its users and the public. %h2 9. Copyright Policy %p Retrospring respects the intellectual property rights of others and expects users of the Services to do the same. We will respond to notices of alleged copyright infringement that comply with applicable law and are properly provided to us. If you believe that your Content has been copied in a way that constitutes copyright infringement, please provide us with the following information: a physical or electronic signature of the copyright owner or a person authorized to act on their behalf; identification of the copyrighted work claimed to have been infringed; identification of the material that is claimed to be infringing or to be the subject of infringing activity and that is to be removed or access to which is to be disabled, and information reasonably sufficient to permit us to locate the material; your contact information, including your address, telephone number, and an email address; a statement by you that you have a good faith belief that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law; and a statement that the information in the notification is accurate, and, under penalty of perjury, that you are authorized to act on behalf of the copyright owner. - %p We reserve the right to remove Content alleged to be infringing without prior notice, at our sole discretion, and without liability to you. In appropriate circumstances, Retrospring will also terminate a user’s account if the user is determined to be a repeat infringer. \ No newline at end of file + %p We reserve the right to remove Content alleged to be infringing without prior notice, at our sole discretion, and without liability to you. In appropriate circumstances, Retrospring will also terminate a user’s account if the user is determined to be a repeat infringer. + %p + %em Effective: 18th January 2015 \ No newline at end of file From 68717332491502f9b439990cc55cee8aef6f52c9 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 17 Jan 2015 09:21:49 +0100 Subject: [PATCH 007/231] update terms of service --- app/views/static/privacy_policy.html.haml | 2 +- app/views/static/terms.html.haml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml index 7eb5b825..b0b13cc3 100644 --- a/app/views/static/privacy_policy.html.haml +++ b/app/views/static/privacy_policy.html.haml @@ -5,7 +5,7 @@ %p This Privacy Policy describes how and when Retrospring uses and collects your data, checks your information and shares with other Services. %h2 Information Collection and Use %h4 Basic Account Information - %p When you create a Retrospring account, you provide some personal information, such as your name, username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. + %p When you create a Retrospring account, you provide some personal information, such as your username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. %h4 Additional Information %p You may provide us with information for public displaying, like a short biography, a link to your website, your location or a profile picture. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. %h4 Answers and Questions diff --git a/app/views/static/terms.html.haml b/app/views/static/terms.html.haml index bfe4afab..6bf19eb6 100644 --- a/app/views/static/terms.html.haml +++ b/app/views/static/terms.html.haml @@ -7,7 +7,10 @@ %p You are responsible for your use of the Services, for any Content you post to the Services, and for any consequences thereof. The Content you submit, post, or display will be able to be viewed by other users of the Services and through third party services and websites (go to the account settings page to control who sees your Content). You should only provide Content that you are comfortable sharing with others under these Terms. %p You may use the Services only if you can form a binding contract with Retrospring and are not a person barred from receiving services under the laws of any applicable jurisdiction. If you are accepting these Terms and using the Services on behalf of a company, organization, government, or other legal entity, you represent and warrant that you are authorized to do so. You may use the Services only in compliance with these Terms and all applicable local, state, national, and international laws, rules and regulations. %h2 2. Privacy - %p Any information that you provide to Retrospring is subject to our Privacy Policy, which governs our collection and use of your information. You understand that through your use of the Services you consent to the collection and use (as set forth in the Privacy Policy) of this information. As part of providing you the Services, we may need to provide you with certain communications, such as service announcements and administrative messages. These communications are considered part of the Services and your Retrospring account, which you may not be able to opt-out from receiving. + %p + Any information that you provide to Retrospring is subject to our + = link_to "Privacy Policy", privacy_policy_path + , which governs our collection and use of your information. You understand that through your use of the Services you consent to the collection and use (as set forth in the Privacy Policy) of this information. As part of providing you the Services, we may need to provide you with certain communications, such as service announcements and administrative messages. These communications are considered part of the Services and your Retrospring account, which you may not be able to opt-out from receiving. %h2 3. Passwords %p You are responsible for safeguarding the password that you use to access the Services and for any activities or actions under your password. We encourage you to use "strong" passwords (passwords that use a combination of upper and lower case letters, numbers and symbols) with your account. Retrospring cannot and will not be liable for any loss or damage arising from your failure to comply with the above. %h2 4. Content on the Services From 991ad1f8383f84731f0714cbd452575f616a1e65 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 17 Jan 2015 12:34:51 +0100 Subject: [PATCH 008/231] added agree statement to sign in page --- app/views/devise/registrations/new.html.haml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 9b27989f..81cc63df 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -10,6 +10,9 @@ = f.password_field :password, autocomplete: "off", label: "Password" = f.password_field :password_confirmation, autocomplete: "off", label: "Confirm password" + %p + With signing up you accept our + = link_to "Terms of Service", terms_path = f.submit "Sign up" = render "devise/shared/links" From 097041c8d200f5dadd8e8b2ae937159bd3da834e Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 18 Jan 2015 01:12:53 +0100 Subject: [PATCH 009/231] update questiongenerator --- Gemfile.lock | 4 ++-- config/initializers/questiongenerator.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 config/initializers/questiongenerator.rb diff --git a/Gemfile.lock b/Gemfile.lock index b76ce586..401e40bd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/justask/questiongenerator.git - revision: 99f2469bbe59f50a0cf3df60d7e82b2b5f7aab9b + revision: d90f681be8e3a155a6aa45fc9afaae95c24d5114 specs: - questiongenerator (0.0.2) + questiongenerator (0.1.0) GEM remote: https://rubygems.org/ diff --git a/config/initializers/questiongenerator.rb b/config/initializers/questiongenerator.rb new file mode 100644 index 00000000..2aacfa93 --- /dev/null +++ b/config/initializers/questiongenerator.rb @@ -0,0 +1 @@ +QuestionGenerator.compile From 05334e3bd0b9b47070140d2f3d827fbc93e777a5 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 18 Jan 2015 14:15:21 +0100 Subject: [PATCH 010/231] added some specs --- app/assets/javascripts/piwik.js.erb | 2 +- spec/factories/{users.rb => 10_users.rb} | 0 spec/factories/answers.rb | 6 ++ spec/factories/questions.rb | 6 ++ spec/features/users/banned_spec.rb | 43 ++++++++ spec/features/users/inbox_spec.rb | 124 +++++++++++++++++++++++ spec/models/answer_spec.rb | 19 ++++ spec/models/question_spec.rb | 35 +++++++ 8 files changed, 234 insertions(+), 1 deletion(-) rename spec/factories/{users.rb => 10_users.rb} (100%) create mode 100644 spec/factories/answers.rb create mode 100644 spec/factories/questions.rb create mode 100644 spec/features/users/banned_spec.rb create mode 100644 spec/features/users/inbox_spec.rb create mode 100644 spec/models/answer_spec.rb create mode 100644 spec/models/question_spec.rb diff --git a/app/assets/javascripts/piwik.js.erb b/app/assets/javascripts/piwik.js.erb index 5e716619..a3e62461 100644 --- a/app/assets/javascripts/piwik.js.erb +++ b/app/assets/javascripts/piwik.js.erb @@ -13,6 +13,6 @@ _paq.push(['setDocumentTitle', document.title]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); -<% else %> +<% elsif !Rails.env.test? %> console.log("i track'd ur bich"); <% end %> \ No newline at end of file diff --git a/spec/factories/users.rb b/spec/factories/10_users.rb similarity index 100% rename from spec/factories/users.rb rename to spec/factories/10_users.rb diff --git a/spec/factories/answers.rb b/spec/factories/answers.rb new file mode 100644 index 00000000..6d32c335 --- /dev/null +++ b/spec/factories/answers.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :answer do |u| + u.sequence(:content) { |n| "This is an answer. I'm number #{n}!" } + u.user FactoryGirl.create(:user) + end +end diff --git a/spec/factories/questions.rb b/spec/factories/questions.rb new file mode 100644 index 00000000..688854b1 --- /dev/null +++ b/spec/factories/questions.rb @@ -0,0 +1,6 @@ +FactoryGirl.define do + factory :question do |u| + u.sequence(:content) { |n| "#{QuestionGenerator.generate}#{n}" } + u.author_is_anonymous true + end +end diff --git a/spec/features/users/banned_spec.rb b/spec/features/users/banned_spec.rb new file mode 100644 index 00000000..6b4f4107 --- /dev/null +++ b/spec/features/users/banned_spec.rb @@ -0,0 +1,43 @@ +include Warden::Test::Helpers +Warden.test_mode! + +# Feature: Ban users +# As a user +# I want to get banned +# So I can't sign in anymore +feature "Ban users", :devise do + + after :each do + Warden.test_reset! + end + + # Scenario: User gets banned + # Given I am signed in + # When I visit another page + # And I am banned + # Then I see the sign in page + scenario "user gets banned", js: true do + me = FactoryGirl.create :user + + login_as me, scope: :user + visit root_path + expect(page).to have_text("Timeline") + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true + + me.banned = true + me.save + click_link "Inbox" + expect(current_path).to eq(new_user_session_path) + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true + end + + scenario 'user visits banned user profiles', js: true do + evil_user = FactoryGirl.create :user + evil_user.banned = true + evil_user.save + + visit show_user_profile_path(evil_user.screen_name) + expect(page).to have_text('Banned'.upcase) + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_3.png"), full: true + end +end diff --git a/spec/features/users/inbox_spec.rb b/spec/features/users/inbox_spec.rb new file mode 100644 index 00000000..2dd96409 --- /dev/null +++ b/spec/features/users/inbox_spec.rb @@ -0,0 +1,124 @@ +include Warden::Test::Helpers +Warden.test_mode! + +# Feature: Answer questions +# As a user +# I want to go to the inbox +# So I can answer and get new questions +feature "Inbox", :devise do + + after :each do + Warden.test_reset! + end + + # Scenario: User answers a question + # Given I am signed in + # When I visit the inbox + # And I have a question in my inbox + # Then I can answer my question + # And see the answer on my user profile + scenario "user answers a question", js: true do + me = FactoryGirl.create :user + question = FactoryGirl.create :question + Inbox.create question: question, user: me, new: true + + login_as me, scope: :user + visit root_path + expect(page).to have_text('1 new question') + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true + + click_link "Inbox" + expect(page).to have_text(question.content) + fill_in "ib-answer", with: Faker::Lorem.sentence + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true + + click_button "Answer" + wait_for_ajax + expect(page).not_to have_text(question.content) + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_3.png"), full: true + + visit show_user_profile_path(me.screen_name) + expect(page).to have_text(question.content) + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_4.png"), full: true + end + + # Scenario: User generates new question + # Given I am signed in + # When I visit the inbox + # And I click "Get new question" + # Then I get a new question + scenario 'user generates new question', js: true do + me = FactoryGirl.create :user + + login_as me, scope: :user + visit inbox_path + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true + + click_button "Get new question" + wait_for_ajax + expect(page).to have_text('Answer'.upcase) + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true + end + +=begin + # Scenario: User deletes a question + # Given I am signed in + # When I visit the inbox + # And I have a question in my inbox + # And I delete the question + # Then don't see it anymore in my inbox + scenario "user deletes a question", js: true do + me = FactoryGirl.create :user + question = FactoryGirl.create :question + Inbox.create question: question, user: me + + login_as me, scope: :user + visit inbox_path + expect(page).to have_text(question.content) + + click_button "Delete" + expect(page).to have_text('Really delete?') + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true + + # this apparently doesn't get triggered :( + page.find('.sweet-alert').click_button 'Delete' + wait_for_ajax + + visit root_path + visit inbox_path + expect(page).not_to have_text(question.content) + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true + end + + # Scenario: User deletes all questions + # Given I am signed in + # When I visit the inbox + # And I have a few questions in my inbox + # And I click on "Delete all questions" + # Then don't see them anymore in my inbox + scenario "user deletes all questions", js: true do + me = FactoryGirl.create :user + 5.times do + question = FactoryGirl.create :question + Inbox.create question: question, user: me + end + + login_as me, scope: :user + visit inbox_path + expect(page).to have_text('Answer'.upcase) + + click_button "Delete all questions" + expect(page).to have_text('Really delete 5 questions?') + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true + + # this apparently doesn't get triggered :( + page.find('.sweet-alert').click_button 'Delete' + wait_for_ajax + + visit root_path + visit inbox_path + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true + expect(page).not_to have_text('Answer'.upcase) + end +=end +end diff --git a/spec/models/answer_spec.rb b/spec/models/answer_spec.rb new file mode 100644 index 00000000..86714638 --- /dev/null +++ b/spec/models/answer_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +RSpec.describe Answer, :type => :model do + before :each do + @answer = Answer.new( + content: 'This is an answer.', + user: FactoryGirl.create(:user), + question: FactoryGirl.create(:question) + ) + end + + subject { @answer } + + it { should respond_to(:content) } + + it '#content returns a string' do + expect(@answer.content).to match 'This is an answer.' + end +end diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb new file mode 100644 index 00000000..9bfa8b3a --- /dev/null +++ b/spec/models/question_spec.rb @@ -0,0 +1,35 @@ +require 'rails_helper' + +RSpec.describe Question, :type => :model do + before :each do + @question = Question.new( + content: 'Is this a question?', + user: FactoryGirl.create(:user) + ) + end + + subject { @question } + + it { should respond_to(:content) } + + it '#content returns a string' do + expect(@question.content).to match 'Is this a question?' + end + + it 'does not save questions longer than 255 characters' do + @question.content = 'X' * 256 + expect{@question.save!}.to raise_error(ActiveRecord::RecordInvalid) + end + + it 'has many answers' do + 5.times { |i| Answer.create(content: "This is an answer. #{i}", user: FactoryGirl.create(:user), question: @question) } + expect(@question.answer_count).to match 5 + end + + it 'also deletes the answers when deleted' do + 5.times { |i| Answer.create(content: "This is an answer. #{i}", user: FactoryGirl.create(:user), question: @question) } + first_answer_id = @question.answers.first.id + @question.destroy + expect{Answer.find(first_answer_id)}.to raise_error(ActiveRecord::RecordNotFound) + end +end From fa2220dd002d753eb6f69e807e8b3891237e648b Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 19 Jan 2015 17:39:19 +0100 Subject: [PATCH 011/231] added Filippus to admins --- app/views/static/about.html.haml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml index 56bbd63b..b8abc228 100644 --- a/app/views/static/about.html.haml +++ b/app/views/static/about.html.haml @@ -27,6 +27,13 @@ .media-body %h4.entry-text.entry-about pixeldesu %h6.entry-subtext Frontend Design & Layout + .media + .pull-left + %a{href: show_user_profile_path('Filippus')} + %img.img-rounded.answerbox--img{src: User.find_by_screen_name('Filippus').profile_picture.url(:medium)} + .media-body + %h4.entry-text.entry-about Filippus + %h6.entry-subtext Moderator Management & Support .panel.panel-default .panel-body %h3 Moderators From bae7307778ba4ff97e25cf461b036d1cda1dc937 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 19:06:22 +0100 Subject: [PATCH 012/231] no longer require factory_girl_rails --- Gemfile | 2 +- spec/spec_helper.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6d635877..6251f7f8 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,7 @@ end group :development, :test do gem 'thin' gem 'rspec-rails', '~> 3.0.0' - gem 'factory_girl_rails' + gem 'factory_girl_rails', require: false gem 'faker' gem 'capybara' gem 'poltergeist' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a5f6554f..dd8b7595 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,6 +7,8 @@ Capybara.register_driver :poltergeist do |app| end Capybara.javascript_driver = :poltergeist +require 'factory_girl_rails' + # This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause this From 53244234a59a6b2acebe4c4db1ff07444d740587 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 19:16:32 +0100 Subject: [PATCH 013/231] update questiongenerator --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 401e40bd..a587f7a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/justask/questiongenerator.git - revision: d90f681be8e3a155a6aa45fc9afaae95c24d5114 + revision: 4f85dafbaf226e3dfbfad9ed3f169bab03b9a84c specs: questiongenerator (0.1.0) From 83e23accfeb81c225ae95b31ea680623b8acceeb Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 19:21:44 +0100 Subject: [PATCH 014/231] update TODO --- TODO | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index dd6ce6e6..d3161e88 100644 --- a/TODO +++ b/TODO @@ -5,7 +5,7 @@ Not done: [012| 0%] (?) open source the entire thing – in late 2015 or 2016 maybe, after we got bought by fakelook. [015| 0%] make a public accessible API (maybe even as an oauth provider?) [016| 5%] WRYYYYte more specs -[017| 0%] write "terms of service" and a privacy policy. +[017| 50%] write "terms of service" and a privacy policy. [018| 0%] that annoying "we use cookies" thing every website in the EU must? add [020| 0%] helper function for profile headings to resize on certain string length [022| 0%] recommended follows @@ -33,4 +33,4 @@ Finished: [014|100%] generate questions if there are none in the inbox (probably make it as a gem) [019|100%] omniAuth (twatter, fakelook, goggles plus) for social networking elitists [021|100%] deleting comments - |----- restructure comment design \ No newline at end of file + |----- restructure comment design From ef4b0e78f8b4fadbd555ce5553f6e449b6eab464 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 19:33:41 +0100 Subject: [PATCH 015/231] attempt to prevent phantomjs timeouts --- spec/spec_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dd8b7595..1b31fa35 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -26,6 +26,14 @@ require 'factory_girl_rails' # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| + + # this should prevent timeouts for waiting on the assets to be compiled, + # makes testing a bit longer though + config.before(:all, type: :feature) do + visit "/assets/application.css" + visit "/assets/application.js" + end + # The settings below are suggested to provide a good initial experience # with RSpec, but feel free to customize to your heart's content. =begin From 626cedca0e7d9798d691c0622b30328b3d40e3ac Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 19:42:13 +0100 Subject: [PATCH 016/231] attempt #2 --- spec/spec_helper.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1b31fa35..e709dd67 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,7 +3,9 @@ SimpleCov.start require 'capybara/poltergeist' Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, js_errors: false) + Capybara::Poltergeist::Driver.new app, + js_errors: false, + timeout: 180 end Capybara.javascript_driver = :poltergeist @@ -26,14 +28,6 @@ require 'factory_girl_rails' # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| - - # this should prevent timeouts for waiting on the assets to be compiled, - # makes testing a bit longer though - config.before(:all, type: :feature) do - visit "/assets/application.css" - visit "/assets/application.js" - end - # The settings below are suggested to provide a good initial experience # with RSpec, but feel free to customize to your heart's content. =begin From 6d68da5ae11c80b07c2b60b57a9f4175362ffc74 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 19:56:39 +0100 Subject: [PATCH 017/231] added Rcov formatter for simplecov --- Gemfile | 4 +++- Gemfile.lock | 7 +++++++ spec/spec_helper.rb | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6251f7f8..63dca713 100644 --- a/Gemfile +++ b/Gemfile @@ -78,7 +78,9 @@ group :development, :test do gem 'faker' gem 'capybara' gem 'poltergeist' - gem 'simplecov' + gem 'simplecov', require: false + gem 'simplecov-json', require: false + gem 'simplecov-rcov', require: false gem 'database_cleaner' end diff --git a/Gemfile.lock b/Gemfile.lock index a587f7a5..fc086541 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -284,6 +284,11 @@ GEM multi_json (~> 1.0) simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + simplecov-json (0.2) + json + simplecov + simplecov-rcov (0.2.3) + simplecov (>= 0.4.1) sinatra (1.4.5) rack (~> 1.4) rack-protection (~> 1.4) @@ -399,6 +404,8 @@ DEPENDENCIES sdoc (~> 0.4.1) sidekiq simplecov + simplecov-json + simplecov-rcov sinatra spring sweetalert-rails diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e709dd67..45581943 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,12 @@ require 'simplecov' +require 'simplecov-json' +require 'simplecov-rcov' + +SimpleCov.formatters = [ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::JSONFormatter, + SimpleCov::Formatter::RcovFormatter +] SimpleCov.start require 'capybara/poltergeist' From 0d639fd6ecf17b046e99f42c796202a2a95121ab Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 20:30:09 +0100 Subject: [PATCH 018/231] added blogger badge --- Rakefile | 24 ++++++++++++-- app/assets/stylesheets/scss/user.scss | 44 ++++++-------------------- app/views/user/_profile_info.html.haml | 4 +++ 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Rakefile b/Rakefile index 8c169681..cce9964f 100644 --- a/Rakefile +++ b/Rakefile @@ -70,7 +70,7 @@ namespace :justask do fail "user #{args[:screen_name]} not found" if user.nil? user.admin = false user.save! - puts "#{user.screen_name} no longer an admin." + puts "#{user.screen_name} is no longer an admin." end desc "Gives moderator status to an user." @@ -113,6 +113,26 @@ namespace :justask do puts "#{user.screen_name} is no longer banned." end + desc "Gives blogger status to an user." + task :blog, [:screen_name] => :environment do |t, args| + fail "screen name required" if args[:screen_name].nil? + user = User.find_by_screen_name(args[:screen_name]) + fail "user #{args[:screen_name]} not found" if user.nil? + user.blogger = true + user.save! + puts "#{user.screen_name} is now a blogger." + end + + desc "Removes blogger status from an user." + task :unblog, [:screen_name] => :environment do |t, args| + fail "screen name required" if args[:screen_name].nil? + user = User.find_by_screen_name(args[:screen_name]) + fail "user #{args[:screen_name]} not found" if user.nil? + user.blogger = false + user.save! + puts "#{user.screen_name} is no longer a blogger." + end + desc "Gives supporter status to an user." task :sup, [:screen_name] => :environment do |t, args| fail "screen name required" if args[:screen_name].nil? @@ -130,7 +150,7 @@ namespace :justask do fail "user #{args[:screen_name]} not found" if user.nil? user.supporter = false user.save! - puts "#{user.screen_name} no longer an supporter." + puts "#{user.screen_name} is no longer an supporter." end desc "Lists all users." diff --git a/app/assets/stylesheets/scss/user.scss b/app/assets/stylesheets/scss/user.scss index 55101e25..799296ac 100644 --- a/app/assets/stylesheets/scss/user.scss +++ b/app/assets/stylesheets/scss/user.scss @@ -22,27 +22,6 @@ margin: 0px 0px 0.2em; } -.profile--admin { - color: $brand-danger; - text-transform: uppercase; - font-weight: bold; - font-size: 80%; -} - -.profile--moderator { - color: $brand-success; - text-transform: uppercase; - font-weight: bold; - font-size: 80%; -} - -.profile--supporter { - color: $brand-warning; - text-transform: uppercase; - font-weight: bold; - font-size: 80%; -} - .profile--text { margin-bottom: 2px; line-height: 1.5em; @@ -106,20 +85,17 @@ color: #fff; } -.panel-badge-danger { - background-color: #E51C23; -} +$colours: danger $brand-danger, + default #BBB, + success $brand-success, + warning $brand-warning, + info $brand-info, + primary $brand-primary; -.panel-badge-default { - background-color: #BBB; -} - -.panel-badge-success { - background-color: #4CAF50; -} - -.panel-badge-warning { - background-color: #FF9800; +@each $colour in $colours { + .panel-badge-#{nth($colour, 1)} { + background-color: nth($colour, 2); + } } .user--banned { diff --git a/app/views/user/_profile_info.html.haml b/app/views/user/_profile_info.html.haml index dc310f11..5dfae7e0 100644 --- a/app/views/user/_profile_info.html.haml +++ b/app/views/user/_profile_info.html.haml @@ -12,6 +12,10 @@ .profile--panel-badge.panel-badge-warning %i.fa.fa-star Supporter + - if @user.blogger? + .profile--panel-badge.panel-badge-info + %i.fa.fa-pencil.fa-spin + Blogger - if @user.banned? .profile--panel-badge.panel-badge-default %i.fa.fa-ban From 87d08f92e8068e3b4133a6f27f935bf679c8dc82 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 25 Jan 2015 20:30:53 +0100 Subject: [PATCH 019/231] forgot to add migration and everything --- .../20150125191224_add_blogger_to_users.rb | 5 ++ db/schema.rb | 46 ++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20150125191224_add_blogger_to_users.rb diff --git a/db/migrate/20150125191224_add_blogger_to_users.rb b/db/migrate/20150125191224_add_blogger_to_users.rb new file mode 100644 index 00000000..cc860fa3 --- /dev/null +++ b/db/migrate/20150125191224_add_blogger_to_users.rb @@ -0,0 +1,5 @@ +class AddBloggerToUsers < ActiveRecord::Migration + def change + add_column :users, :blogger, :boolean, default: :false + end +end diff --git a/db/schema.rb b/db/schema.rb index 42159d46..d9f6fe4c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150112210755) do +ActiveRecord::Schema.define(version: 20150125191224) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -101,6 +101,49 @@ ActiveRecord::Schema.define(version: 20150112210755) do t.datetime "updated_at" end + create_table "oauth_access_grants", force: true do |t| + t.integer "resource_owner_id", null: false + t.integer "application_id", null: false + t.string "token", null: false + t.integer "expires_in", null: false + t.text "redirect_uri", null: false + t.datetime "created_at", null: false + t.datetime "revoked_at" + t.string "scopes" + end + + add_index "oauth_access_grants", ["token"], name: "index_oauth_access_grants_on_token", unique: true, using: :btree + + create_table "oauth_access_tokens", force: true do |t| + t.integer "resource_owner_id" + t.integer "application_id" + t.string "token", null: false + t.string "refresh_token" + t.integer "expires_in" + t.datetime "revoked_at" + t.datetime "created_at", null: false + t.string "scopes" + end + + add_index "oauth_access_tokens", ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true, using: :btree + add_index "oauth_access_tokens", ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id", using: :btree + add_index "oauth_access_tokens", ["token"], name: "index_oauth_access_tokens_on_token", unique: true, using: :btree + + create_table "oauth_applications", force: true do |t| + t.string "name", null: false + t.string "uid", null: false + t.string "secret", null: false + t.text "redirect_uri", null: false + t.string "scopes", default: "", null: false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "owner_id" + t.string "owner_type" + end + + add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree + add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree + create_table "questions", force: true do |t| t.string "content" t.boolean "author_is_anonymous" @@ -198,6 +241,7 @@ ActiveRecord::Schema.define(version: 20150112210755) do t.boolean "privacy_allow_stranger_answers", default: true t.boolean "privacy_show_in_search", default: true t.boolean "banned", default: false + t.boolean "blogger", default: false end add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree From 40eb19d38743c9f971b299f6208425e5349ffdd7 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sun, 25 Jan 2015 20:48:14 +0100 Subject: [PATCH 020/231] updated colours thingy --- app/assets/stylesheets/scss/user.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/scss/user.scss b/app/assets/stylesheets/scss/user.scss index 799296ac..9111b7c3 100644 --- a/app/assets/stylesheets/scss/user.scss +++ b/app/assets/stylesheets/scss/user.scss @@ -89,8 +89,8 @@ $colours: danger $brand-danger, default #BBB, success $brand-success, warning $brand-warning, - info $brand-info, - primary $brand-primary; + primary $brand-primary, + info #2980b9; @each $colour in $colours { .panel-badge-#{nth($colour, 1)} { From 1a3c491e458cf37d2b9c0f36d61b41713593364a Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sun, 25 Jan 2015 20:50:42 +0100 Subject: [PATCH 021/231] remove fa-spin from blogger badge --- app/views/user/_profile_info.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/user/_profile_info.html.haml b/app/views/user/_profile_info.html.haml index 5dfae7e0..cdd4878d 100644 --- a/app/views/user/_profile_info.html.haml +++ b/app/views/user/_profile_info.html.haml @@ -14,7 +14,7 @@ Supporter - if @user.blogger? .profile--panel-badge.panel-badge-info - %i.fa.fa-pencil.fa-spin + %i.fa.fa-pencil Blogger - if @user.banned? .profile--panel-badge.panel-badge-default From 370169c35a83862df48a79985fb71c6e18602342 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 26 Jan 2015 15:51:18 +0100 Subject: [PATCH 022/231] update and fix mobile design --- app/assets/stylesheets/scss/answerbox.scss | 7 ++++++- app/views/shared/_answerbox.html.haml | 24 ++++++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/scss/answerbox.scss b/app/assets/stylesheets/scss/answerbox.scss index 71468b1e..68facc5b 100644 --- a/app/assets/stylesheets/scss/answerbox.scss +++ b/app/assets/stylesheets/scss/answerbox.scss @@ -17,7 +17,7 @@ width: 20px; } -.answerbox--question-text, .answerbox--question-user { +.answerbox--question-text, .answerbox--question-user, .answerbox--answer-user, .answerbox--answer-date { margin-bottom: 0px; overflow: hidden; } @@ -30,4 +30,9 @@ font-size: 16px; color: #000; line-height: 1.3em; +} + +.answerbox--answer-date { + font-size: 12px; + line-height: 1.3em; } \ No newline at end of file diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index e486e8fc..35adc2f2 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -36,15 +36,21 @@ = markdown a.content - if @user.nil? .row - .col-md-6.col-sm-4.col-xs-7.text-left.text-muted - Answered by - %a{href: show_user_profile_path(a.user.screen_name)} - %img.img-rounded.answerbox--img-small{src: gravatar_url(a.user)} - %span= a.user.screen_name - %a{href: show_user_answer_path(a.user.screen_name, a.id)} - %span= time_ago_in_words(a.created_at) - ago - .col-md-6.col-sm-8.col-xs-5.text-right + .col-md-6.col-sm-4.col-xs-6.text-left.text-muted + .media + .pull-left + %a{href: show_user_profile_path(a.user.screen_name)} + %img.img-rounded.answerbox--img{src: gravatar_url(a.user)} + .media-body + %h6.media-heading.answerbox--answer-user + %span.hidden-xs + Answered by + = user_screen_name a.user.screen_name + .answerbox--answer-date + %a{href: show_user_answer_path(a.user.screen_name, a.id)} + %span= time_ago_in_words(a.created_at) + ago + .col-md-6.col-sm-8.col-xs-6.text-right = render 'shared/answerbox_buttons', a: a - else .row From e9c7c5120be2e3019c1d96ed6633309e2094655f Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 26 Jan 2015 15:57:07 +0100 Subject: [PATCH 023/231] hotfix --- app/views/shared/_answerbox.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index 35adc2f2..f46c90c3 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -45,7 +45,7 @@ %h6.media-heading.answerbox--answer-user %span.hidden-xs Answered by - = user_screen_name a.user.screen_name + = user_screen_name a.user .answerbox--answer-date %a{href: show_user_answer_path(a.user.screen_name, a.id)} %span= time_ago_in_words(a.created_at) From 0a69ee04a7f09a9557e1864cbfde0448c9e6b1c0 Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 26 Jan 2015 16:14:20 +0100 Subject: [PATCH 024/231] changed exception rendering option for test environment [ci skip] --- config/environments/test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 411eb23c..053f5b66 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -21,7 +21,7 @@ Rails.application.configure do config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = true # was: false + config.action_dispatch.show_exceptions = false # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false From da9c15d43c6c6184d6a27dc17d296ca99d492bc9 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 26 Jan 2015 17:16:32 +0100 Subject: [PATCH 025/231] basic stuff added --- .../stylesheets/scss/notifications.scss | 24 ++++++++++ app/views/layouts/_notifications.html.haml | 44 ++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/notifications.scss b/app/assets/stylesheets/scss/notifications.scss index 07afe92f..58055060 100644 --- a/app/assets/stylesheets/scss/notifications.scss +++ b/app/assets/stylesheets/scss/notifications.scss @@ -19,4 +19,28 @@ color: $gray; opacity: 0.4; z-index: 0; +} + +.notification--dropdown { + min-width: 370px; +} + +.notification--dropdown-media { + padding: 3px 5px; +} + +.notification--dropdown-user, .notification--dropdown-text { + margin-bottom: 0px; + overflow: hidden; +} + +.notification--dropdown-user { + margin-top: 3px; +} + +.notification--dropdown-img { + min-height: 32px; + min-width: 32px; + height: 32px; + width: 32px; } \ No newline at end of file diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index 12282da0..c85e4a8c 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -1 +1,43 @@ -= nav_entry "Notifications", notifications_path, badge: notification_count \ No newline at end of file += nav_entry "Notifications", notifications_path, badge: notification_count +%li.dropdown.hidden-xs + %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} + Notifications + %span.badge= notification_count + %ul.dropdown-menu.notification--dropdown + %li + .media.notification--dropdown-media + .pull-left + %img.img-rounded.notification--dropdown-img + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + followed you 33 minutes ago + %li + .media.notification--dropdown-media + .pull-left + %img.img-rounded.notification--dropdown-img + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + smiled at your answer about 1 hour ago + %li + .media.notification--dropdown-media + .pull-left + %img.img-rounded.notification--dropdown-img + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + answered your question about 4 hours ago + %li + .media.notification--dropdown-media + .pull-left + %img.img-rounded.notification--dropdown-img + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + commented on your answer about 5 hours ago + %li= link_to "Show all Notifications", notifications_path \ No newline at end of file From 2a0d80b755c50fc461911c0aa070d094e69ee77c Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 26 Jan 2015 17:21:40 +0100 Subject: [PATCH 026/231] basic stuff fixed --- app/views/layouts/_notifications.html.haml | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index c85e4a8c..7f6ab534 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -8,36 +8,36 @@ .media.notification--dropdown-media .pull-left %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - followed you 33 minutes ago + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + followed you 33 minutes ago %li .media.notification--dropdown-media .pull-left %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - smiled at your answer about 1 hour ago + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + smiled at your answer about 1 hour ago %li .media.notification--dropdown-media .pull-left %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - answered your question about 4 hours ago + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + answered your question about 4 hours ago %li .media.notification--dropdown-media .pull-left %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - commented on your answer about 5 hours ago + .media-body + %h6.media-heading.notification--dropdown-user + username + .notification--dropdown-text + commented on your answer about 5 hours ago %li= link_to "Show all Notifications", notifications_path \ No newline at end of file From 45e08651aff0bbd37ada8535ff7c1f6e3c88beb8 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 26 Jan 2015 17:33:40 +0100 Subject: [PATCH 027/231] fixed some more stuff --- app/assets/stylesheets/scss/notifications.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/notifications.scss b/app/assets/stylesheets/scss/notifications.scss index 58055060..2c1b3c4c 100644 --- a/app/assets/stylesheets/scss/notifications.scss +++ b/app/assets/stylesheets/scss/notifications.scss @@ -32,10 +32,11 @@ .notification--dropdown-user, .notification--dropdown-text { margin-bottom: 0px; overflow: hidden; + line-height: 1.3em; } .notification--dropdown-user { - margin-top: 3px; + margin-top: 0px; } .notification--dropdown-img { From c8b02bbf509cea181f42ef7f624640d21a497338 Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 26 Jan 2015 17:50:45 +0100 Subject: [PATCH 028/231] actually add some code here --- app/views/layouts/_notifications.html.haml | 94 +++++++++++++--------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index 7f6ab534..43c58e4c 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -1,43 +1,61 @@ -= nav_entry "Notifications", notifications_path, badge: notification_count +.visible-xs= nav_entry "Notifications", notifications_path, badge: notification_count +- notifications = Notification.for(current_user).limit(4) %li.dropdown.hidden-xs %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} Notifications %span.badge= notification_count %ul.dropdown-menu.notification--dropdown - %li - .media.notification--dropdown-media - .pull-left - %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - followed you 33 minutes ago - %li - .media.notification--dropdown-media - .pull-left - %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - smiled at your answer about 1 hour ago - %li - .media.notification--dropdown-media - .pull-left - %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - answered your question about 4 hours ago - %li - .media.notification--dropdown-media - .pull-left - %img.img-rounded.notification--dropdown-img - .media-body - %h6.media-heading.notification--dropdown-user - username - .notification--dropdown-text - commented on your answer about 5 hours ago - %li= link_to "Show all Notifications", notifications_path \ No newline at end of file + - if notifications.count == 0 + %p New notifications will appear here. + - else + - notifications.each do |notification| + %li{class: (notification.new? ? 'list-group-item-warning' : '')} + .media.notification--dropdown-media + - case notification.target_type + - when "Answer" + .pull-left + %img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)} + .media-body + %h6.media-heading.notification--dropdown-user + = user_screen_name notification.target.user + .notification--dropdown-text + answered + %a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id), title: "#{notification.target.content[0..40]}...", data: { toggle: :tooltip, placement: :top }} + your question + = time_ago_in_words notification.target.created_at + ago + - when "Relationship" + .pull-left + %img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.source)} + .media-body + %h6.media-heading.notification--dropdown-user + = user_screen_name notification.target.source + .notification--dropdown-text + followed you + = time_ago_in_words notification.target.created_at + ago + - when "Smile" + .pull-left + %img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)} + .media-body + %h6.media-heading.notification--dropdown-user + = user_screen_name notification.target.user + .notification--dropdown-text + smiled at + %a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }} + your answer + = time_ago_in_words notification.target.created_at + ago + - when "Comment" + .pull-left + %img.img-rounded.notification--dropdown-img{src: gravatar_url(notification.target.user)} + .media-body + %h6.media-heading.notification--dropdown-user + = user_screen_name notification.target.user + .notification--dropdown-text + commented on + %a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }} + your answer + = time_ago_in_words notification.target.created_at + ago + %li= link_to "Show all notifications#{" and mark them as read" if notifications.pluck(:new).any?}", notifications_path \ No newline at end of file From 13bdbaa430acab1148059692fb1b18a7e8ab2980 Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 26 Jan 2015 17:53:23 +0100 Subject: [PATCH 029/231] centred the "New notifications will appear here" text and also fixed class for notifications entry on navbar --- app/views/layouts/_notifications.html.haml | 4 ++-- spec/features/users/inbox_spec.rb | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index 43c58e4c..b29c8f98 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -1,4 +1,4 @@ -.visible-xs= nav_entry "Notifications", notifications_path, badge: notification_count += nav_entry "Notifications", notifications_path, badge: notification_count, class: 'visible-xs' - notifications = Notification.for(current_user).limit(4) %li.dropdown.hidden-xs %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} @@ -6,7 +6,7 @@ %span.badge= notification_count %ul.dropdown-menu.notification--dropdown - if notifications.count == 0 - %p New notifications will appear here. + %li.centre.text-muted New notifications will appear here. - else - notifications.each do |notification| %li{class: (notification.new? ? 'list-group-item-warning' : '')} diff --git a/spec/features/users/inbox_spec.rb b/spec/features/users/inbox_spec.rb index 2dd96409..e6da518e 100644 --- a/spec/features/users/inbox_spec.rb +++ b/spec/features/users/inbox_spec.rb @@ -60,7 +60,6 @@ feature "Inbox", :devise do page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true end -=begin # Scenario: User deletes a question # Given I am signed in # When I visit the inbox @@ -84,7 +83,7 @@ feature "Inbox", :devise do page.find('.sweet-alert').click_button 'Delete' wait_for_ajax - visit root_path + login_as me, scope: :user visit inbox_path expect(page).not_to have_text(question.content) page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true @@ -111,14 +110,14 @@ feature "Inbox", :devise do expect(page).to have_text('Really delete 5 questions?') page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true - # this apparently doesn't get triggered :( page.find('.sweet-alert').click_button 'Delete' wait_for_ajax - visit root_path + puts me.inbox.all + + login_as me, scope: :user visit inbox_path page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true expect(page).not_to have_text('Answer'.upcase) end -=end end From 174ea6b774c612ae0074274ae663d067cfa7fbd6 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 26 Jan 2015 17:55:18 +0100 Subject: [PATCH 030/231] changed display of notification badge --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index d520c913..bd865d2f 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -3,7 +3,7 @@ background-color: $navbar-inverse-link-active-bg; } -.navbar .nav .active .badge { +.navbar .nav .active .badge, .dropdown .open .badge { padding: 3px 6px 3px; background-color: $navbar-inverse-bg; } From 2b1c10933286a7a551fbbf0e8c1497e73846c92e Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 26 Jan 2015 17:55:58 +0100 Subject: [PATCH 031/231] fucking --- spec/features/users/inbox_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/features/users/inbox_spec.rb b/spec/features/users/inbox_spec.rb index e6da518e..01f51740 100644 --- a/spec/features/users/inbox_spec.rb +++ b/spec/features/users/inbox_spec.rb @@ -60,6 +60,7 @@ feature "Inbox", :devise do page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true end +=begin # Scenario: User deletes a question # Given I am signed in # When I visit the inbox @@ -120,4 +121,5 @@ feature "Inbox", :devise do page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true expect(page).not_to have_text('Answer'.upcase) end +=end end From f7e71d3d676e364051c0180941d9dd234e27fdfc Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 26 Jan 2015 18:04:17 +0100 Subject: [PATCH 032/231] how about this selector? --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index bd865d2f..daa4c796 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -3,7 +3,7 @@ background-color: $navbar-inverse-link-active-bg; } -.navbar .nav .active .badge, .dropdown .open .badge { +.navbar .nav .active .badge, li.dropdown.open a.dropdown-toggle span.badge { padding: 3px 6px 3px; background-color: $navbar-inverse-bg; } From 4e4925846305dff3b590ee73dfe6d45ec40c413d Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 26 Jan 2015 18:08:03 +0100 Subject: [PATCH 033/231] removed annoying margin, ready to merge [ci skip] --- app/assets/stylesheets/scss/notifications.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/scss/notifications.scss b/app/assets/stylesheets/scss/notifications.scss index 2c1b3c4c..8f09001d 100644 --- a/app/assets/stylesheets/scss/notifications.scss +++ b/app/assets/stylesheets/scss/notifications.scss @@ -23,6 +23,7 @@ .notification--dropdown { min-width: 370px; + margin-top: 0px !important; } .notification--dropdown-media { From 32956319d48d856c0eca4d26441bc5fc9333b2d7 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 26 Jan 2015 18:41:16 +0100 Subject: [PATCH 034/231] changed question-text line height --- app/assets/stylesheets/scss/answerbox.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/scss/answerbox.scss b/app/assets/stylesheets/scss/answerbox.scss index 68facc5b..2cfb92b1 100644 --- a/app/assets/stylesheets/scss/answerbox.scss +++ b/app/assets/stylesheets/scss/answerbox.scss @@ -32,6 +32,10 @@ line-height: 1.3em; } +.answerbox--question-text { + line-height: 1.3em; +} + .answerbox--answer-date { font-size: 12px; line-height: 1.3em; From b26ec1dd0b360063e57dae46c20d726575ab63e4 Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 27 Jan 2015 17:51:39 +0100 Subject: [PATCH 035/231] fixed question generator not working if privacy_allow_anonymous_questions is false (GitHub issue #71) --- app/models/inbox.rb | 2 +- spec/features/users/inbox_spec.rb | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/models/inbox.rb b/app/models/inbox.rb index 161e8c7c..0cea150b 100644 --- a/app/models/inbox.rb +++ b/app/models/inbox.rb @@ -3,7 +3,7 @@ class Inbox < ActiveRecord::Base belongs_to :question before_create do - raise "User does not want to receive anonymous questions" if self.question.author_is_anonymous and !self.user.privacy_allow_anonymous_questions? + raise "User does not want to receive anonymous questions" if self.question.author_is_anonymous and self.question.author_name != 'justask' and !self.user.privacy_allow_anonymous_questions? end def answer(answer_content, user) diff --git a/spec/features/users/inbox_spec.rb b/spec/features/users/inbox_spec.rb index 01f51740..19ba3581 100644 --- a/spec/features/users/inbox_spec.rb +++ b/spec/features/users/inbox_spec.rb @@ -60,6 +60,27 @@ feature "Inbox", :devise do page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true end + # Scenario: User with privacy options generates new question + # Given I am signed in + # When I visit the inbox + # And I click "Get new question" + # And I don't want to receive questions by anonymous users + # Then I get a new question + scenario 'user with privacy options generates new question', js: true do + me = FactoryGirl.create :user + me.privacy_allow_anonymous_questions = false + me.save + + login_as me, scope: :user + visit inbox_path + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true + + click_button "Get new question" + wait_for_ajax + expect(page).to have_text('Answer'.upcase) + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true + end + =begin # Scenario: User deletes a question # Given I am signed in From ca7789750af72448d911ecd9d721ae05af17e9a3 Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 27 Jan 2015 17:53:05 +0100 Subject: [PATCH 036/231] made NProgress loading bar brighter (GitHub issue #73) --- app/assets/stylesheets/application.css.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 515ab0cc..8bf94e9c 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -51,6 +51,6 @@ body { padding-top: $navbar-height; } @import "font-awesome"; -$nprogress-color: darken($navbar-inverse-bg, 15%); +$nprogress-color: lighten($navbar-inverse-bg, 25%); @import 'nprogress'; @import 'nprogress-bootstrap'; From ddbff78926e329bf1d9b79eaa2fb7cccbc1a51e8 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 27 Jan 2015 18:13:24 +0100 Subject: [PATCH 037/231] add panel-footer to inbox panel --- app/views/inbox/_entry.html.haml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index fb65cce2..8acac5fa 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -23,8 +23,20 @@ Answer %button.btn.btn-danger{name: 'ib-destroy', data: { ib_id: i.id }} Delete - - current_user.services.each do |service| - %label - %input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }} - Post to - = service.provider.capitalize \ No newline at end of file + %button.btn.btn-default + Options + .panel-footer + %h4 Sharing + - if @services.count > 0 + .row + - current_user.services.each do |service| + .col-md-2.col-sm-4.col-xs-6 + %label + %input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }} + Post to + = service.provider.capitalize + - else + %p + You have not connected any services yet. Visit your + = link_to "service settings", services_path + to connect one. \ No newline at end of file From 9c2b0951bfcb2756a29053bf7afd817d514e5e5d Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 27 Jan 2015 18:25:20 +0100 Subject: [PATCH 038/231] add coffescript to expand options --- app/assets/javascripts/inbox.coffee | 15 +++++++++++++++ app/views/inbox/_entry.html.haml | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/inbox.coffee b/app/assets/javascripts/inbox.coffee index 397fb515..50fabac3 100644 --- a/app/assets/javascripts/inbox.coffee +++ b/app/assets/javascripts/inbox.coffee @@ -121,3 +121,18 @@ $(document).on "click", "button[name=ib-destroy]", -> complete: (jqxhr, status) -> btn.button "reset" $("textarea[name=ib-answer][data-id=#{iid}]").removeAttr "readonly" + +# Toggle button +$(document).on "click", "button[name=ib-options]", -> + btn = $(this) + ibid = btn[0].dataset.ib_id + state = btn[0].dataset.state + optionBox = $("#ib-options-#{ibid}") + + switch state + when 'hidden' + optionBox.slideDown() + btn[0].dataset.state = 'shown' + when 'shown' + optionBox.slideUp() + btn[0].dataset.state = 'hidden' \ No newline at end of file diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 8acac5fa..6504a537 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -23,9 +23,9 @@ Answer %button.btn.btn-danger{name: 'ib-destroy', data: { ib_id: i.id }} Delete - %button.btn.btn-default + %button.btn.btn-default{name: 'ib-options', data: { ib_id: i.id, state: :hidden }} Options - .panel-footer + .panel-footer{id: "ib-options-#{i.id}", style: 'display: none'} %h4 Sharing - if @services.count > 0 .row From a7fbc5b366f116fce8e31bf1979bb5352747e478 Mon Sep 17 00:00:00 2001 From: nilsding Date: Wed, 28 Jan 2015 06:49:17 +0100 Subject: [PATCH 039/231] fixed inbox entries and toggle button --- app/assets/javascripts/inbox.coffee | 3 ++- app/views/inbox/_entry.html.haml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/inbox.coffee b/app/assets/javascripts/inbox.coffee index 50fabac3..ff553e0b 100644 --- a/app/assets/javascripts/inbox.coffee +++ b/app/assets/javascripts/inbox.coffee @@ -122,10 +122,11 @@ $(document).on "click", "button[name=ib-destroy]", -> btn.button "reset" $("textarea[name=ib-answer][data-id=#{iid}]").removeAttr "readonly" + # Toggle button $(document).on "click", "button[name=ib-options]", -> btn = $(this) - ibid = btn[0].dataset.ib_id + ibid = btn[0].dataset.ibId state = btn[0].dataset.state optionBox = $("#ib-options-#{ibid}") diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 6504a537..2d55623c 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -24,10 +24,11 @@ %button.btn.btn-danger{name: 'ib-destroy', data: { ib_id: i.id }} Delete %button.btn.btn-default{name: 'ib-options', data: { ib_id: i.id, state: :hidden }} - Options + %i.fa.fa-cog + %span.sr-only Options .panel-footer{id: "ib-options-#{i.id}", style: 'display: none'} %h4 Sharing - - if @services.count > 0 + - if current_user.services.count > 0 .row - current_user.services.each do |service| .col-md-2.col-sm-4.col-xs-6 From 0bf46a888fe00ad65f6002dcbca8faff1ed05f56 Mon Sep 17 00:00:00 2001 From: nilsding Date: Thu, 29 Jan 2015 16:45:58 +0100 Subject: [PATCH 040/231] added a new Markdown renderer (TwitteredMarkdown) which will be used for sharing to Twitter --- app/helpers/markdown_helper.rb | 5 +++++ app/models/services/twitter.rb | 4 ++-- app/services/twittered_markdown.rb | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 app/services/twittered_markdown.rb diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb index b385f696..590956ce 100644 --- a/app/helpers/markdown_helper.rb +++ b/app/helpers/markdown_helper.rb @@ -9,4 +9,9 @@ module MarkdownHelper md = Redcarpet::Markdown.new(Redcarpet::Render::StripDown, MARKDOWN_OPTS) CGI.unescape_html(Sanitize.fragment(md.render(content), EVIL_TAGS)).strip end + + def twitter_markdown(content) + md = Redcarpet::Markdown.new(TwitteredMarkdown, MARKDOWN_OPTS) + CGI.unescape_html(Sanitize.fragment(md.render(content), EVIL_TAGS)).strip + end end \ No newline at end of file diff --git a/app/models/services/twitter.rb b/app/models/services/twitter.rb index bd3b6ca8..243536c7 100644 --- a/app/models/services/twitter.rb +++ b/app/models/services/twitter.rb @@ -28,8 +28,8 @@ class Services::Twitter < Service def prepare_tweet(answer) # TODO: improve this. - question_content = strip_markdown answer.question.content - answer_content = strip_markdown answer.content + question_content = twitter_markdown answer.question.content + answer_content = twitter_markdown answer.content answer_url = show_user_answer_url( id: answer.id, username: answer.user.screen_name, diff --git a/app/services/twittered_markdown.rb b/app/services/twittered_markdown.rb new file mode 100644 index 00000000..aeadf428 --- /dev/null +++ b/app/services/twittered_markdown.rb @@ -0,0 +1,23 @@ +class TwitteredMarkdown < Redcarpet::Render::StripDown + + def preprocess(text) + wrap_mentions(text) + end + + def wrap_mentions(text) + text.gsub! /(^|\s)@([a-zA-Z0-9_]{1,16})/ do + local_user = User.find_by_screen_name($2) + if local_user.nil? + "#{$1}#{$2}" + else + service = local_user.services.where(type: "Services::Twitter").first + if service.nil? + "#{$1}#{$2}" + else + "#{$1}@#{service.nickname}" + end + end + end + text + end +end From b3d81e18ab7832dda414e2562b6a73d0dc90edd2 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 30 Jan 2015 20:32:10 +0100 Subject: [PATCH 041/231] fix this shit --- app/views/inbox/_entry.html.haml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 2d55623c..ea6ff358 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -30,12 +30,12 @@ %h4 Sharing - if current_user.services.count > 0 .row - - current_user.services.each do |service| - .col-md-2.col-sm-4.col-xs-6 - %label - %input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }} - Post to - = service.provider.capitalize + - current_user.services.each do |service| + .col-md-2.col-sm-4.col-xs-6 + %label + %input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }} + Post to + = service.provider.capitalize - else %p You have not connected any services yet. Visit your From caa6a06ab0c27aa98f7bc4963607909a3e754611 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 30 Jan 2015 20:34:28 +0100 Subject: [PATCH 042/231] small visual improvement --- app/views/inbox/_entry.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index ea6ff358..821daa36 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -31,7 +31,7 @@ - if current_user.services.count > 0 .row - current_user.services.each do |service| - .col-md-2.col-sm-4.col-xs-6 + .col-md-3.col-sm-4.col-xs-6 %label %input{type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider }} Post to From 99c7aa8f86afb0bd961a93367f38b6c4a23bffd7 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 30 Jan 2015 22:46:44 +0100 Subject: [PATCH 043/231] add mobile navigation for lists and timelines --- app/views/group/index.html.haml | 1 + app/views/public/index.html.haml | 1 + app/views/shared/_sidebar.html.haml | 2 +- app/views/static/_mobile-nav.html.haml | 14 ++++++++++++++ app/views/static/index.html.haml | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/views/static/_mobile-nav.html.haml diff --git a/app/views/group/index.html.haml b/app/views/group/index.html.haml index d9f363bf..a4d167ff 100644 --- a/app/views/group/index.html.haml +++ b/app/views/group/index.html.haml @@ -1,3 +1,4 @@ += render 'static/mobile-nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' diff --git a/app/views/public/index.html.haml b/app/views/public/index.html.haml index d9f363bf..a4d167ff 100644 --- a/app/views/public/index.html.haml +++ b/app/views/public/index.html.haml @@ -1,3 +1,4 @@ += render 'static/mobile-nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' diff --git a/app/views/shared/_sidebar.html.haml b/app/views/shared/_sidebar.html.haml index 1fc18c9b..93f7ab4c 100644 --- a/app/views/shared/_sidebar.html.haml +++ b/app/views/shared/_sidebar.html.haml @@ -32,7 +32,7 @@ .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#answered-count= current_user.smiled_count %h6.entry-subtext Smiles -.panel.panel-default +.panel.panel-default.hidden-xs .panel-body %ul.nav.nav-pills.nav-stacked = nav_entry "Timeline", root_path diff --git a/app/views/static/_mobile-nav.html.haml b/app/views/static/_mobile-nav.html.haml new file mode 100644 index 00000000..cedf46c2 --- /dev/null +++ b/app/views/static/_mobile-nav.html.haml @@ -0,0 +1,14 @@ +%nav.navbar.navbar-default.navbar-fixed-top.visible-xs{role: "navigation"} + .container + .navbar-header + %button.navbar-toggle{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"} + %span.sr-only Toggle navigation + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand{href: "/"} Timelines & Lists + #j2-tl-navbar-collapse.collapse.navbar-collapse + %ul.nav.navbar-nav + = nav_entry "Public", public_timeline_path + - current_user.groups.each do |group| + = nav_entry group.display_name, group_timeline_path(group.name) diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml index 14d88172..1102acdd 100644 --- a/app/views/static/index.html.haml +++ b/app/views/static/index.html.haml @@ -1,4 +1,5 @@ - if user_signed_in? + = render 'static/mobile-nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' From cac03fa31e808803b09da681c3f29f37f1c34700 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 30 Jan 2015 22:48:24 +0100 Subject: [PATCH 044/231] change fixed to static --- app/views/static/_mobile-nav.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/static/_mobile-nav.html.haml b/app/views/static/_mobile-nav.html.haml index cedf46c2..4ab992a0 100644 --- a/app/views/static/_mobile-nav.html.haml +++ b/app/views/static/_mobile-nav.html.haml @@ -1,4 +1,4 @@ -%nav.navbar.navbar-default.navbar-fixed-top.visible-xs{role: "navigation"} +%nav.navbar.navbar-default.navbar-static-top.visible-xs{role: "navigation"} .container .navbar-header %button.navbar-toggle{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"} From 1c6533bb749bca4949d5bc89c9ca8d4b1e9fb00e Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 30 Jan 2015 22:48:38 +0100 Subject: [PATCH 045/231] change text --- app/views/static/_mobile-nav.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/static/_mobile-nav.html.haml b/app/views/static/_mobile-nav.html.haml index 4ab992a0..643b9379 100644 --- a/app/views/static/_mobile-nav.html.haml +++ b/app/views/static/_mobile-nav.html.haml @@ -6,7 +6,7 @@ %span.icon-bar %span.icon-bar %span.icon-bar - %a.navbar-brand{href: "/"} Timelines & Lists + %a.navbar-brand{href: "/"} Timelines #j2-tl-navbar-collapse.collapse.navbar-collapse %ul.nav.navbar-nav = nav_entry "Public", public_timeline_path From bde9f395735c01c7580028901998fdf4433088e8 Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 30 Jan 2015 22:52:05 +0100 Subject: [PATCH 046/231] fixed mobile navbar thing [ci skip] --- .../static/{_mobile-nav.html.haml => _mobile_nav.html.haml} | 6 +++--- app/views/static/index.html.haml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename app/views/static/{_mobile-nav.html.haml => _mobile_nav.html.haml} (88%) diff --git a/app/views/static/_mobile-nav.html.haml b/app/views/static/_mobile_nav.html.haml similarity index 88% rename from app/views/static/_mobile-nav.html.haml rename to app/views/static/_mobile_nav.html.haml index 643b9379..1bffbf09 100644 --- a/app/views/static/_mobile-nav.html.haml +++ b/app/views/static/_mobile_nav.html.haml @@ -3,9 +3,9 @@ .navbar-header %button.navbar-toggle{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"} %span.sr-only Toggle navigation - %span.icon-bar - %span.icon-bar - %span.icon-bar + %span.icon-bar + %span.icon-bar + %span.icon-bar %a.navbar-brand{href: "/"} Timelines #j2-tl-navbar-collapse.collapse.navbar-collapse %ul.nav.navbar-nav diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml index 1102acdd..cf67d51e 100644 --- a/app/views/static/index.html.haml +++ b/app/views/static/index.html.haml @@ -1,5 +1,5 @@ - if user_signed_in? - = render 'static/mobile-nav' + = render 'static/mobile_nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' @@ -17,4 +17,4 @@ Load more .visible-xs= render 'shared/links' - else - = render 'static/front' \ No newline at end of file + = render 'static/front' From bca0344792a5364713d0c4ed0d8ff9d891b48433 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 30 Jan 2015 22:53:44 +0100 Subject: [PATCH 047/231] remove margin from navbar --- app/assets/stylesheets/base.css.scss | 4 ++++ app/views/static/_mobile_nav.html.haml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index 6ce16f9b..48897a05 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -96,4 +96,8 @@ body { .j2-delete { color: $brand-danger; text-decoration: none; +} + +.j2-navbar { + margin-bottom: 0px; } \ No newline at end of file diff --git a/app/views/static/_mobile_nav.html.haml b/app/views/static/_mobile_nav.html.haml index 1bffbf09..24304d95 100644 --- a/app/views/static/_mobile_nav.html.haml +++ b/app/views/static/_mobile_nav.html.haml @@ -1,4 +1,4 @@ -%nav.navbar.navbar-default.navbar-static-top.visible-xs{role: "navigation"} +%nav.navbar.navbar-default.navbar-static-top.j2-navbar.visible-xs{role: "navigation"} .container .navbar-header %button.navbar-toggle{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"} From 393b92e0018e8c5988237fcd30681133ecd7bbe0 Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 30 Jan 2015 22:55:29 +0100 Subject: [PATCH 048/231] =?UTF-8?q?=E2=80=A6=20[ci=20skip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/group/index.html.haml | 2 +- app/views/public/index.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/group/index.html.haml b/app/views/group/index.html.haml index a4d167ff..070fff40 100644 --- a/app/views/group/index.html.haml +++ b/app/views/group/index.html.haml @@ -1,4 +1,4 @@ -= render 'static/mobile-nav' += render 'static/mobile_nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' diff --git a/app/views/public/index.html.haml b/app/views/public/index.html.haml index a4d167ff..070fff40 100644 --- a/app/views/public/index.html.haml +++ b/app/views/public/index.html.haml @@ -1,4 +1,4 @@ -= render 'static/mobile-nav' += render 'static/mobile_nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' From 030e6ac6a67b33ab6fb84d3782ce595d85ab56da Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 31 Jan 2015 00:47:28 +0100 Subject: [PATCH 049/231] add notification navbar --- .../notifications/_notification_nav.html.haml | 16 ++++++++++++++++ .../notifications/_notification_tabs.html.haml | 2 +- app/views/notifications/index.html.haml | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/views/notifications/_notification_nav.html.haml diff --git a/app/views/notifications/_notification_nav.html.haml b/app/views/notifications/_notification_nav.html.haml new file mode 100644 index 00000000..a2513801 --- /dev/null +++ b/app/views/notifications/_notification_nav.html.haml @@ -0,0 +1,16 @@ +%nav.navbar.navbar-default.navbar-static-top.j2-navbar.visible-xs{role: "navigation"} + .container + .navbar-header + %button.navbar-toggle{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"} + %span.sr-only Toggle navigation + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand{href: "/"} Notifications + #j2-tl-navbar-collapse.collapse.navbar-collapse + %ul.nav.navbar-nav + = nav_entry "All notifications", notifications_path + = nav_entry "Answers", notifications_path('answer') + = nav_entry "Smiles", notifications_path('smile') + = nav_entry "Comments", notifications_path('comment') + = nav_entry "Followers", notifications_path('relationship') \ No newline at end of file diff --git a/app/views/notifications/_notification_tabs.html.haml b/app/views/notifications/_notification_tabs.html.haml index 4bb01b43..16f73e5d 100644 --- a/app/views/notifications/_notification_tabs.html.haml +++ b/app/views/notifications/_notification_tabs.html.haml @@ -1,5 +1,5 @@ .col-md-3.col-xs-12.col-sm-3 - .panel.panel-default + .panel.panel-default.hidden-xs .panel-body %ul.nav.nav-pills.nav-stacked = nav_entry "All notifications", notifications_path diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index f394a2bd..4b12b4b4 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -1,3 +1,4 @@ += render 'notifications/notification_nav' .container.j2-page = render 'notification_tabs' .col-md-9.col-xs-12.col-sm-9 From 9cb21d2458a86b6f5a6a33e8f7fa133fa20666db Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 31 Jan 2015 00:49:31 +0100 Subject: [PATCH 050/231] add moderation navbar navbar --- app/views/moderation/_moderation_nav.html.haml | 16 ++++++++++++++++ app/views/moderation/_moderation_tabs.html.haml | 2 +- app/views/moderation/index.html.haml | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/views/moderation/_moderation_nav.html.haml diff --git a/app/views/moderation/_moderation_nav.html.haml b/app/views/moderation/_moderation_nav.html.haml new file mode 100644 index 00000000..f33f013a --- /dev/null +++ b/app/views/moderation/_moderation_nav.html.haml @@ -0,0 +1,16 @@ +%nav.navbar.navbar-default.navbar-static-top.j2-navbar.visible-xs{role: "navigation"} + .container + .navbar-header + %button.navbar-toggle{"data-target" => "#j2-tl-navbar-collapse", "data-toggle" => "collapse", type: "button"} + %span.sr-only Toggle navigation + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand{href: "/"} Moderation + #j2-tl-navbar-collapse.collapse.navbar-collapse + %ul.nav.navbar-nav + = nav_entry "All reports", moderation_path + = nav_entry "Answers", moderation_path('answer') + = nav_entry "Comments", moderation_path('comment') + = nav_entry "Users", moderation_path('user') + = nav_entry "Questions", moderation_path('question') \ No newline at end of file diff --git a/app/views/moderation/_moderation_tabs.html.haml b/app/views/moderation/_moderation_tabs.html.haml index 05d93880..cb75096a 100644 --- a/app/views/moderation/_moderation_tabs.html.haml +++ b/app/views/moderation/_moderation_tabs.html.haml @@ -1,5 +1,5 @@ .col-md-3.col-sm-3.col-xs-12 - .panel.panel-default + .panel.panel-default.hidden-xs .panel-body %ul.nav.nav-pills.nav-stacked = nav_entry "All reports", moderation_path diff --git a/app/views/moderation/index.html.haml b/app/views/moderation/index.html.haml index a2407e94..5fb59763 100644 --- a/app/views/moderation/index.html.haml +++ b/app/views/moderation/index.html.haml @@ -1,3 +1,4 @@ += render 'moderation/moderation_nav' .container.j2-page .row = render 'moderation/moderation_tabs' From cff278793ec79856938d7961b739e1d4986b63f2 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 31 Jan 2015 16:20:07 +0100 Subject: [PATCH 051/231] update timeline design --- app/views/shared/_sidebar.html.haml | 36 +++++++++++------------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/app/views/shared/_sidebar.html.haml b/app/views/shared/_sidebar.html.haml index 93f7ab4c..34018942 100644 --- a/app/views/shared/_sidebar.html.haml +++ b/app/views/shared/_sidebar.html.haml @@ -1,14 +1,18 @@ .panel.panel-default.hidden-xs + %img.profile--avatar{src: current_user.profile_picture.url(:large)} + - unless inbox_count.nil? + .profile--panel-badge.panel-badge-info + %i.fa.fa-envelope + = pluralize(inbox_count, 'new question') .panel-body - %p - Welcome, - = current_user.screen_name - - unless inbox_count.nil? - %p - %strong - You have - = pluralize(inbox_count, 'new question') - in your inbox! + - if current_user.display_name.blank? + .profile--displayname + = current_user.screen_name + - else + .profile--displayname + = current_user.display_name + .profile--username + = current_user.screen_name .row %a{href: show_user_followers_path(current_user.screen_name)} .col-md-6.col-sm-6.col-xs-6 @@ -18,20 +22,6 @@ .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#friend-count= current_user.friend_count %h6.entry-subtext Following - .row - .col-md-6.col-sm-6.col-xs-6 - %h4.entry-text#asked-count= current_user.asked_count - %h6.entry-subtext Questions - .col-md-6.col-sm-6.col-xs-6 - %h4.entry-text#answered-count= current_user.answered_count - %h6.entry-subtext Answers - .row - .col-md-6.col-sm-6.col-xs-6 - %h4.entry-text#asked-count= current_user.commented_count - %h6.entry-subtext Comments - .col-md-6.col-sm-6.col-xs-6 - %h4.entry-text#answered-count= current_user.smiled_count - %h6.entry-subtext Smiles .panel.panel-default.hidden-xs .panel-body %ul.nav.nav-pills.nav-stacked From d1ed602353b0887e0b0d63d9ed27c361d67c6d2b Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 31 Jan 2015 16:26:22 +0100 Subject: [PATCH 052/231] update test --- spec/features/users/inbox_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/users/inbox_spec.rb b/spec/features/users/inbox_spec.rb index 19ba3581..9b9a99ed 100644 --- a/spec/features/users/inbox_spec.rb +++ b/spec/features/users/inbox_spec.rb @@ -24,7 +24,7 @@ feature "Inbox", :devise do login_as me, scope: :user visit root_path - expect(page).to have_text('1 new question') + expect(page).to have_text('1 new question'.upcase) page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true click_link "Inbox" From d09b8554d3f46bb114fb3da94f3c00f5b73eaa17 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sun, 1 Feb 2015 20:07:52 +0100 Subject: [PATCH 053/231] update placeholders --- app/views/user/edit.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/user/edit.html.haml b/app/views/user/edit.html.haml index bd2540c7..f5d6af9c 100644 --- a/app/views/user/edit.html.haml +++ b/app/views/user/edit.html.haml @@ -27,11 +27,11 @@ = f.text_field :motivation_header, label: "Motivation header", placeholder: 'Ask me anything!' - = f.text_field :website, label: "Website", placeholder: 'http://bad-dragon.com' + = f.text_field :website, label: "Website", placeholder: 'http://example.com' - = f.text_field :location, label: "Location", placeholder: 'Germoney' + = f.text_field :location, label: "Location", placeholder: 'Where are you?' - = f.text_area :bio, label: "Bio", placeholder: 'In Bio war ich nie gut x--DD' + = f.text_area :bio, label: "Bio", placeholder: 'Tell us something nice about you!' - for attrib in %i(crop_x crop_y crop_w crop_h) = f.hidden_field attrib, id: attrib From 8882360e4b94e7ed5ae2b1072142e739743352be Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 2 Feb 2015 16:09:52 +0100 Subject: [PATCH 054/231] added 'search' to the list of forbidden user names [ci skip] --- app/validators/screen_name_validator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/validators/screen_name_validator.rb b/app/validators/screen_name_validator.rb index 3633c4b1..87375ddb 100644 --- a/app/validators/screen_name_validator.rb +++ b/app/validators/screen_name_validator.rb @@ -2,11 +2,11 @@ class ScreenNameValidator < ActiveModel::EachValidator FORBIDDEN_SCREEN_NAMES = %w(justask_admin retrospring_admin admin justask retrospring support about public notifications inbox sign_in sign_up sidekiq moderation moderator mod administrator siteadmin site_admin help retro_spring retroospring retrosprlng niisding nllsding - group settings) + group settings search pixeidesu plxeldesu plxeidesu) def validate_each(record, attribute, value) if FORBIDDEN_SCREEN_NAMES.include? value.downcase record.errors[attribute] << "Thou shalt not use this username! Please choose another one." end end -end \ No newline at end of file +end From 3bf92f43f059670ef37e160b1d43f469edb234f4 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 3 Feb 2015 14:55:36 +0100 Subject: [PATCH 055/231] remove support from validator --- app/validators/screen_name_validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/validators/screen_name_validator.rb b/app/validators/screen_name_validator.rb index 3633c4b1..7b9d81de 100644 --- a/app/validators/screen_name_validator.rb +++ b/app/validators/screen_name_validator.rb @@ -1,5 +1,5 @@ class ScreenNameValidator < ActiveModel::EachValidator - FORBIDDEN_SCREEN_NAMES = %w(justask_admin retrospring_admin admin justask retrospring support about public + FORBIDDEN_SCREEN_NAMES = %w(justask_admin retrospring_admin admin justask retrospring about public notifications inbox sign_in sign_up sidekiq moderation moderator mod administrator siteadmin site_admin help retro_spring retroospring retrosprlng niisding nllsding group settings) From 17f1c8f09156a482f708d413ed25e485f80ab5c8 Mon Sep 17 00:00:00 2001 From: Georg G Date: Tue, 3 Feb 2015 17:13:50 +0100 Subject: [PATCH 056/231] added user privileges modal --- app/views/user/_actions.html.haml | 10 +++++++- app/views/user/_modal_privileges.html.haml | 23 +++++++++++++++++++ .../user/_modal_privileges_item.html.haml | 9 ++++++++ app/views/user/show.html.haml | 2 ++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 app/views/user/_modal_privileges.html.haml create mode 100644 app/views/user/_modal_privileges_item.html.haml diff --git a/app/views/user/_actions.html.haml b/app/views/user/_actions.html.haml index b2b211e0..99114397 100644 --- a/app/views/user/_actions.html.haml +++ b/app/views/user/_actions.html.haml @@ -27,4 +27,12 @@ %li %a{href: '#', data: { action: 'report-user', target: user.screen_name }} %i.fa.fa-exclamation-triangle - Report \ No newline at end of file + Report + - if current_user.mod? + %li + %a{href: '#', data: { target: "#modal-privileges", toggle: :modal }} + %i.fa.fa-paw + Check + = succeed "'s" do + = user.screen_name + privileges \ No newline at end of file diff --git a/app/views/user/_modal_privileges.html.haml b/app/views/user/_modal_privileges.html.haml new file mode 100644 index 00000000..a9104dbe --- /dev/null +++ b/app/views/user/_modal_privileges.html.haml @@ -0,0 +1,23 @@ +#modal-privileges.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-privileges-label", :role => "dialog", :tabindex => "-1"} + .modal-dialog + .modal-content + .modal-header + %button.close{"data-dismiss" => "modal", :type => "button"} + %span{"aria-hidden" => "true"} × + %span.sr-only Close + %h4#modal-privileges-label.modal-title + Check + = succeed "'s" do + = @user.screen_name + privileges + .modal-body + %ul.list-group.groups--list + - unless @user.admin? + = render 'user/modal_privileges_item', privilege: 'banned', description: 'Hit the user with ye olde banhammer', user: @user + = render 'user/modal_privileges_item', privilege: 'blogger', description: 'The user gets that privilege if they blogged something (nice) about Retrospring.', user: @user + - if current_user.admin? + = render 'user/modal_privileges_item', privilege: 'supporter', description: 'oy vey muh shekels', user: @user + = render 'user/modal_privileges_item', privilege: 'moderator', user: @user + = render 'user/modal_privileges_item', privilege: 'admin', user: @user + .modal-footer + %button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }} Done \ No newline at end of file diff --git a/app/views/user/_modal_privileges_item.html.haml b/app/views/user/_modal_privileges_item.html.haml new file mode 100644 index 00000000..799b2892 --- /dev/null +++ b/app/views/user/_modal_privileges_item.html.haml @@ -0,0 +1,9 @@ +- description ||= '' +%li.list-group-item{id: "privilege-#{privilege}"} + .media + .pull-left.j2-table + %input.input--center{type: :checkbox, name: 'check-your-privileges', data: { type: privilege, user: user.screen_name }, checked: user.send("#{privilege}?"), autocomplete: 'off'} + .media-body + .list-group-item-heading= privilege.capitalize + - unless description.blank? + .list-group-item-text.text-muted.j2-up= description \ No newline at end of file diff --git a/app/views/user/show.html.haml b/app/views/user/show.html.haml index 087ecc93..a655c57d 100644 --- a/app/views/user/show.html.haml +++ b/app/views/user/show.html.haml @@ -17,3 +17,5 @@ .visible-xs= render 'shared/links' - if user_signed_in? = render 'user/modal_group_memberships' + - if current_user.mod? and @user != current_user + = render 'user/modal_privileges' \ No newline at end of file From 96f4a9433f1b2dfb550f7176db162bd97aaa73c5 Mon Sep 17 00:00:00 2001 From: Georg G Date: Tue, 3 Feb 2015 17:31:04 +0100 Subject: [PATCH 057/231] moderation javascripts now only get loaded if the current_user is a moderator or above --- app/assets/javascripts/application.js.erb.coffee | 15 ++++++++++++++- app/assets/javascripts/moderation.js.erb.coffee | 1 + app/views/layouts/application.html.haml | 3 +++ config/initializers/assets.rb | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/moderation.js.erb.coffee diff --git a/app/assets/javascripts/application.js.erb.coffee b/app/assets/javascripts/application.js.erb.coffee index 5842510d..f34b63c9 100644 --- a/app/assets/javascripts/application.js.erb.coffee +++ b/app/assets/javascripts/application.js.erb.coffee @@ -9,7 +9,20 @@ #= require cheet #= require jquery.guillotine #= require sweet-alert -#= require_tree . +# local requires to be seen by everyone: +#= require_tree ./answerbox +#= require_tree ./questionbox +#= require groups +#= require inbox +#= require memes +#= require notifications +#= require pagination +#= require piwik +#= require question +#= require settings +#= require user +# not required: +# _tree ./moderation NProgress.configure showSpinner: false diff --git a/app/assets/javascripts/moderation.js.erb.coffee b/app/assets/javascripts/moderation.js.erb.coffee new file mode 100644 index 00000000..5a8a1551 --- /dev/null +++ b/app/assets/javascripts/moderation.js.erb.coffee @@ -0,0 +1 @@ +#= require_tree ./moderation \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 807074a4..8fd481eb 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -15,6 +15,9 @@ %title= APP_CONFIG['site_name'] = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true + - if user_signed_in? + - if current_user.mod? + = javascript_include_tag 'moderation', 'data-turbolinks-track' => true = csrf_meta_tags %body = render 'layouts/header' diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index d2f4ec33..1f4fa74b 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -5,4 +5,4 @@ Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -# Rails.application.config.assets.precompile += %w( search.js ) +Rails.application.config.assets.precompile += %w( moderation.js ) From 06cc52ffc5e22efeaddf52f106254782d6c0bf6c Mon Sep 17 00:00:00 2001 From: Georg G Date: Tue, 3 Feb 2015 17:48:30 +0100 Subject: [PATCH 058/231] made these checkboxes work --- .../javascripts/moderation/privileges.coffee | 24 ++++++++++++++ app/controllers/ajax/moderation_controller.rb | 33 +++++++++++++++++++ .../ajax/moderation/privilege.json.jbuilder | 2 ++ config/routes.rb | 3 +- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/moderation/privileges.coffee create mode 100644 app/views/ajax/moderation/privilege.json.jbuilder diff --git a/app/assets/javascripts/moderation/privileges.coffee b/app/assets/javascripts/moderation/privileges.coffee new file mode 100644 index 00000000..6f676851 --- /dev/null +++ b/app/assets/javascripts/moderation/privileges.coffee @@ -0,0 +1,24 @@ +($ document).on "click", "input[type=checkbox][name=check-your-privileges]", -> + box = $(this) + box.attr 'disabled', 'disabled' + + privType = box[0].dataset.type + boxChecked = box[0].checked + + $.ajax + url: '/ajax/mod/privilege' + type: 'POST' + data: + user: box[0].dataset.user + type: privType + status: boxChecked + success: (data, status, jqxhr) -> + if data.success + box[0].checked = if data.checked? then data.checked else !boxChecked + showNotification data.message, data.success + error: (jqxhr, status, error) -> + box[0].checked = false + console.log jqxhr, status, error + showNotification "An error occurred, a developer should check the console for details", false + complete: (jqxhr, status) -> + box.removeAttr "disabled" \ No newline at end of file diff --git a/app/controllers/ajax/moderation_controller.rb b/app/controllers/ajax/moderation_controller.rb index 32f6895c..2a635651 100644 --- a/app/controllers/ajax/moderation_controller.rb +++ b/app/controllers/ajax/moderation_controller.rb @@ -104,4 +104,37 @@ class Ajax::ModerationController < ApplicationController @message = "Successfully deleted comment." @success = true end + + def privilege + @status = :err + @success = false + + params.require :user + params.require :type + params.require :status + + status = params[:status] == 'true' + + target_user = User.find_by_screen_name(params[:user]) + + @message = "nope!" + return unless %w(banned blogger supporter moderator admin).include? params[:type].downcase + + if (%w(supporter moderator admin).include?(params[:type].downcase) and !current_user.admin?) or + (params[:type].downcase == 'banned' and target_user.admin?) + @status = :nopriv + @message = "You'd better check YOUR privileges first!" + @success = false + return + end + + @checked = status + target_user.send("#{params[:type]}=", status) + target_user.save! + + @message = "Successfully checked this user's #{params[:type]} privilege." + + @status = :okay + @success = true + end end diff --git a/app/views/ajax/moderation/privilege.json.jbuilder b/app/views/ajax/moderation/privilege.json.jbuilder new file mode 100644 index 00000000..707cf362 --- /dev/null +++ b/app/views/ajax/moderation/privilege.json.jbuilder @@ -0,0 +1,2 @@ +json.partial! 'ajax/shared/status' +json.checked @checked \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3c2e6050..a8e6fa97 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,7 +12,7 @@ Rails.application.routes.draw do # Moderation panel constraints ->(req) { req.env['warden'].authenticate?(scope: :user) && - (req.env['warden'].user.admin? or req.env['warden'].user.moderator?) } do + (req.env['warden'].user.mod?) } do match '/moderation(/:type)', to: 'moderation#index', via: :get, as: :moderation, defaults: {type: 'all'} namespace :ajax do match '/mod/destroy_report', to: 'moderation#destroy_report', via: :post, as: :mod_destroy_report @@ -20,6 +20,7 @@ Rails.application.routes.draw do match '/mod/destroy_comment', to: 'moderation#destroy_comment', via: :post, as: :mod_destroy_comment match '/mod/create_vote', to: 'moderation#vote', via: :post, as: :mod_create_vote match '/mod/destroy_vote', to: 'moderation#destroy_vote', via: :post, as: :mod_destroy_vote + match '/mod/privilege', to: 'moderation#privilege', via: :post, as: :mod_privilege end end From 26cd72ba2ea43d805dd055759829f62c8467d8ce Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 3 Feb 2015 18:10:14 +0100 Subject: [PATCH 059/231] update modal --- app/views/user/_modal_privileges.html.haml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/views/user/_modal_privileges.html.haml b/app/views/user/_modal_privileges.html.haml index a9104dbe..561a1fd9 100644 --- a/app/views/user/_modal_privileges.html.haml +++ b/app/views/user/_modal_privileges.html.haml @@ -10,14 +10,13 @@ = succeed "'s" do = @user.screen_name privileges - .modal-body - %ul.list-group.groups--list - - unless @user.admin? - = render 'user/modal_privileges_item', privilege: 'banned', description: 'Hit the user with ye olde banhammer', user: @user - = render 'user/modal_privileges_item', privilege: 'blogger', description: 'The user gets that privilege if they blogged something (nice) about Retrospring.', user: @user - - if current_user.admin? - = render 'user/modal_privileges_item', privilege: 'supporter', description: 'oy vey muh shekels', user: @user - = render 'user/modal_privileges_item', privilege: 'moderator', user: @user - = render 'user/modal_privileges_item', privilege: 'admin', user: @user + %ul.list-group.groups--list + - unless @user.admin? + = render 'user/modal_privileges_item', privilege: 'banned', description: 'Hit the user with ye olde banhammer', user: @user + = render 'user/modal_privileges_item', privilege: 'blogger', description: 'The user gets that privilege if they blogged something (nice) about Retrospring.', user: @user + - if current_user.admin? + = render 'user/modal_privileges_item', privilege: 'supporter', description: 'This user supports the site with money', user: @user + = render 'user/modal_privileges_item', privilege: 'moderator', description: 'Someone trustworthy enough to help managing reports',user: @user + = render 'user/modal_privileges_item', privilege: 'admin', description: 'This user is part of the core team', user: @user .modal-footer %button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }} Done \ No newline at end of file From 66607a1eae6377a559a6f85a95bad675c5a6960f Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 3 Feb 2015 18:22:01 +0100 Subject: [PATCH 060/231] update modal --- app/views/user/_actions.html.haml | 2 +- app/views/user/_modal_privileges.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/user/_actions.html.haml b/app/views/user/_actions.html.haml index 99114397..6ed47740 100644 --- a/app/views/user/_actions.html.haml +++ b/app/views/user/_actions.html.haml @@ -31,7 +31,7 @@ - if current_user.mod? %li %a{href: '#', data: { target: "#modal-privileges", toggle: :modal }} - %i.fa.fa-paw + %i.fa.fa-wrench Check = succeed "'s" do = user.screen_name diff --git a/app/views/user/_modal_privileges.html.haml b/app/views/user/_modal_privileges.html.haml index 561a1fd9..9e1a041b 100644 --- a/app/views/user/_modal_privileges.html.haml +++ b/app/views/user/_modal_privileges.html.haml @@ -15,7 +15,7 @@ = render 'user/modal_privileges_item', privilege: 'banned', description: 'Hit the user with ye olde banhammer', user: @user = render 'user/modal_privileges_item', privilege: 'blogger', description: 'The user gets that privilege if they blogged something (nice) about Retrospring.', user: @user - if current_user.admin? - = render 'user/modal_privileges_item', privilege: 'supporter', description: 'This user supports the site with money', user: @user + = render 'user/modal_privileges_item', privilege: 'supporter', description: 'This user monetarily supports the site', user: @user = render 'user/modal_privileges_item', privilege: 'moderator', description: 'Someone trustworthy enough to help managing reports',user: @user = render 'user/modal_privileges_item', privilege: 'admin', description: 'This user is part of the core team', user: @user .modal-footer From cde8d8a30fe4a75fa984d55ec78ffd5acd7ed001 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 5 Feb 2015 15:17:15 +0100 Subject: [PATCH 061/231] remove padding on specific rows on mobile devices --- app/assets/stylesheets/base.css.scss | 7 +++++++ app/views/static/index.html.haml | 2 +- app/views/user/show.html.haml | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index 48897a05..ac7d4c73 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -100,4 +100,11 @@ body { .j2-navbar { margin-bottom: 0px; +} + +@media (max-width: $screen-xs-max) { + .j2-col-reset { + padding-left: 0px; + padding-right: 0px; + } } \ No newline at end of file diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml index cf67d51e..a3e2f94b 100644 --- a/app/views/static/index.html.haml +++ b/app/views/static/index.html.haml @@ -3,7 +3,7 @@ .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' - .col-md-9.col-xs-12.col-sm-9 + .col-md-9.col-xs-12.col-sm-9.j2-col-reset = render 'layouts/messages' #timeline diff --git a/app/views/user/show.html.haml b/app/views/user/show.html.haml index a655c57d..53401652 100644 --- a/app/views/user/show.html.haml +++ b/app/views/user/show.html.haml @@ -1,9 +1,9 @@ .profile--header .container.j2-page - .col-md-3.col-xs-12.col-sm-4 + .col-md-3.col-xs-12.col-sm-4.j2-col-reset = render 'user/profile_info' .hidden-xs= render 'shared/links' - .col-md-9.col-xs-12.col-sm-8 + .col-md-9.col-xs-12.col-sm-8.j2-col-reset = render 'shared/questionbox' #answers - @answers.each do |a| From 46d8769b922fc692e3334f06ec7ace071a42067c Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 5 Feb 2015 15:20:41 +0100 Subject: [PATCH 062/231] remove padding on even more pages --- app/views/group/index.html.haml | 2 +- app/views/user/questions.html.haml | 4 ++-- app/views/user/show_follow.html.haml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/group/index.html.haml b/app/views/group/index.html.haml index 070fff40..bb0a7648 100644 --- a/app/views/group/index.html.haml +++ b/app/views/group/index.html.haml @@ -2,7 +2,7 @@ .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' - .col-md-9.col-xs-12.col-sm-9 + .col-md-9.col-xs-12.col-sm-9.j2-col-reset = render 'layouts/messages' #timeline diff --git a/app/views/user/questions.html.haml b/app/views/user/questions.html.haml index e1ce1c30..f5e4262e 100644 --- a/app/views/user/questions.html.haml +++ b/app/views/user/questions.html.haml @@ -1,9 +1,9 @@ .profile--header .container.j2-page - .col-md-3.col-xs-12.col-sm-4 + .col-md-3.col-xs-12.col-sm-4.j2-col-reset = render 'user/profile_info' .hidden-xs= render 'shared/links' - .col-md-9.col-xs-12.col-sm-8 + .col-md-9.col-xs-12.col-sm-8.j2-col-reset %h1.j2-lh.hidden-xs= @title %h1.visible-xs= @title #questions diff --git a/app/views/user/show_follow.html.haml b/app/views/user/show_follow.html.haml index 54899d40..83f526da 100644 --- a/app/views/user/show_follow.html.haml +++ b/app/views/user/show_follow.html.haml @@ -1,9 +1,9 @@ .profile--header .container.j2-page - .col-md-3.col-xs-12.col-sm-4 + .col-md-3.col-xs-12.col-sm-4.j2-col-reset = render 'user/profile_info' .hidden-xs= render 'shared/links' - .col-md-9.col-xs-12.col-sm-8 + .col-md-9.col-xs-12.col-sm-8.j2-col-reset %h1.j2-lh.hidden-xs= @title %h1.visible-xs= @title #users From 85507607724134226c6572e296b5cebf6d9384dc Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sun, 8 Feb 2015 00:59:07 +0100 Subject: [PATCH 063/231] add inbox sidebar --- app/views/inbox/_sidebar.html.haml | 20 ++++++++++++++++++++ app/views/inbox/show.html.haml | 25 ++++--------------------- 2 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 app/views/inbox/_sidebar.html.haml diff --git a/app/views/inbox/_sidebar.html.haml b/app/views/inbox/_sidebar.html.haml new file mode 100644 index 00000000..27bd7a2c --- /dev/null +++ b/app/views/inbox/_sidebar.html.haml @@ -0,0 +1,20 @@ +.panel.panel-default.inbox--panel + .panel-heading + %h3.panel-title Out of questions? + .panel-body + %button.btn.btn-block.btn-info{type: :button, id: 'ib-generate-question'} Get new question + .panel.panel-default.inbox--panel + .panel-heading + %h3.panel-title Share + .panel-body + %a.btn.btn-block.btn-primary{target: '_blank', href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}"} + %i.fa.fa-twitter + Share on Twitter + %a.btn.btn-block.btn-primary{target: '_blank', href: "http://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"} + %i.fa.fa-tumblr + Share on Tumblr + .panel.panel-default.warning--panel + .panel-heading + %h3.panel-title Actions + .panel-body + %button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (@inbox.empty? ? 'disabled' : nil), data: { ib_count: @inbox.count }} Delete all questions \ No newline at end of file diff --git a/app/views/inbox/show.html.haml b/app/views/inbox/show.html.haml index 31c95187..0d9098b2 100644 --- a/app/views/inbox/show.html.haml +++ b/app/views/inbox/show.html.haml @@ -1,26 +1,7 @@ .container.j2-page .row - .col-md-3.col-xs-12.col-sm-3 - .panel.panel-default.inbox--panel - .panel-heading - %h3.panel-title Out of questions? - .panel-body - %button.btn.btn-block.btn-info{type: :button, id: 'ib-generate-question'} Get new question - .panel.panel-default.inbox--panel - .panel-heading - %h3.panel-title Share - .panel-body - %a.btn.btn-block.btn-primary{target: '_blank', href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}"} - %i.fa.fa-twitter - Share on Twitter - %a.btn.btn-block.btn-primary{target: '_blank', href: "http://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"} - %i.fa.fa-tumblr - Share on Tumblr - .panel.panel-default.warning--panel - .panel-heading - %h3.panel-title Actions - .panel-body - %button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (@inbox.empty? ? 'disabled' : nil), data: { ib_count: @inbox.count }} Delete all questions + .col-md-3.col-xs-12.col-sm-3.hidden-xs + = render 'inbox/sidebar' .col-md-9.col-xs-12.col-sm-9 = render 'layouts/messages' #entries @@ -30,6 +11,8 @@ - if @inbox.empty? Nothing to see here. + .col-md-9.col-xs-12.col-sm-9.visible-xs + = render 'inbox/sidebar' = render "shared/links" - @inbox.update_all(new: false) \ No newline at end of file From 3c6221eb1e03e826b5375671f67eb377cf4c92ea Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sun, 8 Feb 2015 02:54:57 +0100 Subject: [PATCH 064/231] indentation got fucked up here --- app/views/inbox/_sidebar.html.haml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/views/inbox/_sidebar.html.haml b/app/views/inbox/_sidebar.html.haml index 27bd7a2c..c9629caf 100644 --- a/app/views/inbox/_sidebar.html.haml +++ b/app/views/inbox/_sidebar.html.haml @@ -3,18 +3,18 @@ %h3.panel-title Out of questions? .panel-body %button.btn.btn-block.btn-info{type: :button, id: 'ib-generate-question'} Get new question - .panel.panel-default.inbox--panel - .panel-heading - %h3.panel-title Share - .panel-body - %a.btn.btn-block.btn-primary{target: '_blank', href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}"} - %i.fa.fa-twitter - Share on Twitter - %a.btn.btn-block.btn-primary{target: '_blank', href: "http://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"} - %i.fa.fa-tumblr - Share on Tumblr - .panel.panel-default.warning--panel - .panel-heading - %h3.panel-title Actions - .panel-body - %button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (@inbox.empty? ? 'disabled' : nil), data: { ib_count: @inbox.count }} Delete all questions \ No newline at end of file +.panel.panel-default.inbox--panel + .panel-heading + %h3.panel-title Share + .panel-body + %a.btn.btn-block.btn-primary{target: '_blank', href: "https://twitter.com/intent/tweet?text=Ask%20me%20anything%21&url=#{show_user_profile_url(current_user.screen_name)}"} + %i.fa.fa-twitter + Share on Twitter + %a.btn.btn-block.btn-primary{target: '_blank', href: "http://www.tumblr.com/share/link?url=#{show_user_profile_url(current_user.screen_name)}&name=Ask%20me%20anything%21"} + %i.fa.fa-tumblr + Share on Tumblr +.panel.panel-default.warning--panel + .panel-heading + %h3.panel-title Actions + .panel-body + %button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (@inbox.empty? ? 'disabled' : nil), data: { ib_count: @inbox.count }} Delete all questions \ No newline at end of file From 192c0a0931790856a3516e6450eeddaa397f4d71 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 9 Feb 2015 16:43:05 +0100 Subject: [PATCH 065/231] update ask button in navbar --- app/views/layouts/_header.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index a3835231..8bdf40d0 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -25,10 +25,12 @@ = render "layouts/notifications" %ul.nav.navbar-nav.navbar-right %li - .btn.btn-primary.navbar-btn.btn-sm.hidden-xs{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} - %i.fa.fa-pencil-square-o + %span{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"} + .btn.btn-link.navbar-btn.btn-sm.hidden-xs{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} + %i.fa.fa-pencil-square-o %li.dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} + %img.img-rounded.answerbox--img-small.hidden-xs{src: current_user.profile_picture.url(:small)} = current_user.screen_name %b.caret %ul.dropdown-menu From 6ac227fd3192100a45efe46d4ee1c99f5dc4f633 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 9 Feb 2015 16:43:48 +0100 Subject: [PATCH 066/231] hide entire list item, not just the button --- app/views/layouts/_header.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 8bdf40d0..29c30086 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -24,9 +24,9 @@ = nav_entry "Inbox", "/inbox", badge: inbox_count = render "layouts/notifications" %ul.nav.navbar-nav.navbar-right - %li + %li.hidden-xs %span{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"} - .btn.btn-link.navbar-btn.btn-sm.hidden-xs{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} + .btn.btn-link.navbar-btn.btn-sm{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} %i.fa.fa-pencil-square-o %li.dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} From 7e12a1c77a90021c0bda354a766d420eb9fe1587 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 9 Feb 2015 16:48:31 +0100 Subject: [PATCH 067/231] update notification display --- app/views/layouts/_header.html.haml | 2 +- app/views/layouts/_notifications.html.haml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 29c30086..fca1ff72 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -22,8 +22,8 @@ %ul.nav.navbar-nav = nav_entry "Timeline", root_path = nav_entry "Inbox", "/inbox", badge: inbox_count - = render "layouts/notifications" %ul.nav.navbar-nav.navbar-right + = render "layouts/notifications" %li.hidden-xs %span{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"} .btn.btn-link.navbar-btn.btn-sm{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} diff --git a/app/views/layouts/_notifications.html.haml b/app/views/layouts/_notifications.html.haml index b29c8f98..7c272aa4 100644 --- a/app/views/layouts/_notifications.html.haml +++ b/app/views/layouts/_notifications.html.haml @@ -2,7 +2,11 @@ - notifications = Notification.for(current_user).limit(4) %li.dropdown.hidden-xs %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} - Notifications + - if notification_count.nil? + %i.fa.fa-bell-o + - else + %i.fa.fa-bell + %span.sr-only Notifications %span.badge= notification_count %ul.dropdown-menu.notification--dropdown - if notifications.count == 0 From ddbb7e63c87ee2ec508fd5c3e75803998dbe82ba Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 9 Feb 2015 17:39:34 +0100 Subject: [PATCH 068/231] remove small size for asking button --- app/views/layouts/_header.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index fca1ff72..97a3075e 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -26,7 +26,7 @@ = render "layouts/notifications" %li.hidden-xs %span{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"} - .btn.btn-link.navbar-btn.btn-sm{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} + .btn.btn-link.navbar-btn{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} %i.fa.fa-pencil-square-o %li.dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} From 87cfff8809198f8c000153c48cbf04b78d95906c Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 9 Feb 2015 19:58:58 +0100 Subject: [PATCH 069/231] try to fix buggy tooltip --- app/views/layouts/_header.html.haml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 97a3075e..6bfaf658 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -24,10 +24,9 @@ = nav_entry "Inbox", "/inbox", badge: inbox_count %ul.nav.navbar-nav.navbar-right = render "layouts/notifications" - %li.hidden-xs - %span{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"} - .btn.btn-link.navbar-btn{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} - %i.fa.fa-pencil-square-o + %li.hidden-xs{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"} + .btn.btn-link.navbar-btn{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} + %i.fa.fa-pencil-square-o %li.dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img-small.hidden-xs{src: current_user.profile_picture.url(:small)} From 31d8e687252db38340ce7767b874bebbc8979323 Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 10 Feb 2015 06:53:50 +0100 Subject: [PATCH 070/231] automatically mark notifications as read --- app/controllers/answer_controller.rb | 18 ++++++++++++++++++ app/controllers/user_controller.rb | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/app/controllers/answer_controller.rb b/app/controllers/answer_controller.rb index 8a2734a0..4c8bd73e 100644 --- a/app/controllers/answer_controller.rb +++ b/app/controllers/answer_controller.rb @@ -2,5 +2,23 @@ class AnswerController < ApplicationController def show @answer = Answer.find(params[:id]) @display_all = true + + if user_signed_in? + notif = Notification.where(target_type: "Answer", target_id: @answer.id, recipient_id: current_user.id, new: true).first + unless notif.nil? + notif.new = false + notif.save + end + notif = Notification.where(target_type: "Comment", target_id: @answer.comments.pluck(:id), recipient_id: current_user.id, new: true).first + unless notif.nil? + notif.new = false + notif.save + end + notif = Notification.where(target_type: "Smile", target_id: @answer.smiles.pluck(:id), recipient_id: current_user.id, new: true).first + unless notif.nil? + notif.new = false + notif.save + end + end end end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 25957157..4667e2b0 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,6 +4,15 @@ class UserController < ApplicationController def show @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first! @answers = @user.answers.reverse_order.paginate(page: params[:page]) + + if user_signed_in? + notif = Notification.where(target_type: "Relationship", target_id: @user.active_relationships.where(target_id: current_user.id).pluck(:id), recipient_id: current_user.id, new: true).first + unless notif.nil? + notif.new = false + notif.save + end + end + respond_to do |format| format.html format.js From e51b525fd5eb62e350e6633ef9eafbf3d419136a Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 10 Feb 2015 07:04:49 +0100 Subject: [PATCH 071/231] use :created_at for order --- app/models/notification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index d14f5ece..d93e6821 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -4,7 +4,7 @@ class Notification < ActiveRecord::Base class << self def for(recipient, options={}) - self.where(options.merge!(recipient: recipient)).order(:updated_at).reverse_order + self.where(options.merge!(recipient: recipient)).order(:created_at).reverse_order end def notify(recipient, target) From c6864133d482515daecbdb05c555ca00527adb9d Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 10 Feb 2015 21:36:37 +0100 Subject: [PATCH 072/231] update terms/policy a bit --- app/views/static/privacy_policy.html.haml | 2 +- app/views/static/terms.html.haml | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml index b0b13cc3..2b9706f0 100644 --- a/app/views/static/privacy_policy.html.haml +++ b/app/views/static/privacy_policy.html.haml @@ -25,4 +25,4 @@ %h2 Our Policy Towards Children %p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. %p - %em Effective: 18th January 2015 \ No newline at end of file + %em Effective: the time we will actually publish it plus some days \ No newline at end of file diff --git a/app/views/static/terms.html.haml b/app/views/static/terms.html.haml index 6bf19eb6..892ab4a5 100644 --- a/app/views/static/terms.html.haml +++ b/app/views/static/terms.html.haml @@ -2,7 +2,7 @@ .panel.panel-default .panel-body %h1 Terms of Use - %p These Terms of Service ("Terms") govern your access to and use of the services (the "Services" or “Retrospring”), and any information, text, graphics, photos or other materials uploaded, downloaded or appearing on the Services (collectively referred to as "Content"). Your access to and use of the Services are conditioned on your acceptance of and compliance with these Terms. By accessing or using the Services you agree to be bound by these Terms. + %p These Terms of Service ("Terms") as declared by the company (referred to as "Staff") govern your access to and use of the services (the "Services" or “Retrospring”), and any information, text, graphics, photos or other materials uploaded, downloaded or appearing on the Services (collectively referred to as "Content"). Your access to and use of the Services are conditioned on your acceptance of and compliance with these Terms. By accessing or using the Services you agree to be bound by these Terms. %h2 1. Basic Terms %p You are responsible for your use of the Services, for any Content you post to the Services, and for any consequences thereof. The Content you submit, post, or display will be able to be viewed by other users of the Services and through third party services and websites (go to the account settings page to control who sees your Content). You should only provide Content that you are comfortable sharing with others under these Terms. %p You may use the Services only if you can form a binding contract with Retrospring and are not a person barred from receiving services under the laws of any applicable jurisdiction. If you are accepting these Terms and using the Services on behalf of a company, organization, government, or other legal entity, you represent and warrant that you are authorized to do so. You may use the Services only in compliance with these Terms and all applicable local, state, national, and international laws, rules and regulations. @@ -11,17 +11,18 @@ Any information that you provide to Retrospring is subject to our = link_to "Privacy Policy", privacy_policy_path , which governs our collection and use of your information. You understand that through your use of the Services you consent to the collection and use (as set forth in the Privacy Policy) of this information. As part of providing you the Services, we may need to provide you with certain communications, such as service announcements and administrative messages. These communications are considered part of the Services and your Retrospring account, which you may not be able to opt-out from receiving. - %h2 3. Passwords - %p You are responsible for safeguarding the password that you use to access the Services and for any activities or actions under your password. We encourage you to use "strong" passwords (passwords that use a combination of upper and lower case letters, numbers and symbols) with your account. Retrospring cannot and will not be liable for any loss or damage arising from your failure to comply with the above. - %h2 4. Content on the Services - %p All Content, whether publicly posted or privately transmitted, is the sole responsibility of the person who originated such Content. We may not monitor or control the Content posted via the Services and, we cannot take responsibility for such Content. Any use or reliance on any Content or materials posted via the Services or obtained by you through the Services is at your own risk. - %p We do not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Content or communications posted via the Services or endorse any opinions expressed via the Services. You understand that by using the Services, you may be exposed to Content that might be offensive, harmful, inaccurate or otherwise inappropriate, or in some cases, postings that have been mislabeled or are otherwise deceptive. Under no circumstances will Retrospring be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the Services or broadcast elsewhere. - %h2 5. Your Rights - %p You retain your rights to any Content you submit, post or display on or through the Services. - %h2 6. Restrictions on Content and Use of the Services + %h2 3. Conducts + %p All Content, whether publicly posted or privately transmitted, is the sole responsibility of the person who originated such Content. We may not monitor or control the Content posted via the Services and, we cannot take responsibility for such Content. Any use or reliance on any Content or materials posted via the Services or obtained by you through the Services is at your own risk. + %p We do not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Content or communications posted via the Services or endorse any opinions expressed via the Services excluding official information represented by the "Staff" of the Services.. You understand that by using the Services, you may be exposed to Content that might be offensive, harmful, inaccurate or otherwise inappropriate, or in some cases, postings that have been mislabeled or are otherwise deceptive. Under no circumstances will Retrospring be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the Services or broadcast elsewhere. + %h2 4. Limitation of Liability + %p Retrospring makes no guarantee of availability of service and reserves the right to change, withdraw, suspend, or discontinue any functionality or feature of Retrospring's services. In no event shall Retrospring be liable for any damages whatsoever. This includes direct, indirect, incidental, special, consequential, or punitive damages arising out of the use of or inability to use Retrospring's services or any content thereon. + %h2 5. Restrictions on Content and Use of the Services %p We reserve the right at all times (but will not have an obligation) to remove or refuse to distribute any Content on the Services, to suspend or terminate users, and to reclaim usernames without liability to you. We also reserve the right to access, read, preserve, and disclose any information as we reasonably believe is necessary to satisfy any applicable law, regulation, legal process or governmental request, enforce the Terms, including investigation of potential violations hereof, detect, prevent, or otherwise address fraud, security or technical issues, respond to user support requests, or protect the rights, property or safety of Retrospring, its users and the public. - %h2 9. Copyright Policy + %h2 6. Maintenance + %p Retrospring may perform maintenance services at any time. You acknowledge that such maintenance may require downtime, and contents or features on Retrospring may not load during this time as well as client functionality being disabled. + %p Retrospring requires occasional maintenances to improve, resolve, or update our service. These maintenances can take time, and can result in time without client functionality. We are not responsible for any loss of profile information or any other Content posted on the Service in these times. + %h2 7. Copyright Policy %p Retrospring respects the intellectual property rights of others and expects users of the Services to do the same. We will respond to notices of alleged copyright infringement that comply with applicable law and are properly provided to us. If you believe that your Content has been copied in a way that constitutes copyright infringement, please provide us with the following information: a physical or electronic signature of the copyright owner or a person authorized to act on their behalf; identification of the copyrighted work claimed to have been infringed; identification of the material that is claimed to be infringing or to be the subject of infringing activity and that is to be removed or access to which is to be disabled, and information reasonably sufficient to permit us to locate the material; your contact information, including your address, telephone number, and an email address; a statement by you that you have a good faith belief that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law; and a statement that the information in the notification is accurate, and, under penalty of perjury, that you are authorized to act on behalf of the copyright owner. %p We reserve the right to remove Content alleged to be infringing without prior notice, at our sole discretion, and without liability to you. In appropriate circumstances, Retrospring will also terminate a user’s account if the user is determined to be a repeat infringer. %p - %em Effective: 18th January 2015 \ No newline at end of file + %em Effective: the time we will actually publish it plus some days \ No newline at end of file From 5e9d455a2f335707799f6aae5d8be2a6a23c9bfe Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 10 Feb 2015 22:08:00 +0100 Subject: [PATCH 073/231] typo --- app/views/static/terms.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/static/terms.html.haml b/app/views/static/terms.html.haml index 892ab4a5..036621c7 100644 --- a/app/views/static/terms.html.haml +++ b/app/views/static/terms.html.haml @@ -13,7 +13,7 @@ , which governs our collection and use of your information. You understand that through your use of the Services you consent to the collection and use (as set forth in the Privacy Policy) of this information. As part of providing you the Services, we may need to provide you with certain communications, such as service announcements and administrative messages. These communications are considered part of the Services and your Retrospring account, which you may not be able to opt-out from receiving. %h2 3. Conducts %p All Content, whether publicly posted or privately transmitted, is the sole responsibility of the person who originated such Content. We may not monitor or control the Content posted via the Services and, we cannot take responsibility for such Content. Any use or reliance on any Content or materials posted via the Services or obtained by you through the Services is at your own risk. - %p We do not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Content or communications posted via the Services or endorse any opinions expressed via the Services excluding official information represented by the "Staff" of the Services.. You understand that by using the Services, you may be exposed to Content that might be offensive, harmful, inaccurate or otherwise inappropriate, or in some cases, postings that have been mislabeled or are otherwise deceptive. Under no circumstances will Retrospring be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the Services or broadcast elsewhere. + %p We do not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Content or communications posted via the Services or endorse any opinions expressed via the Services excluding official information represented by the "Staff" of the Services. You understand that by using the Services, you may be exposed to Content that might be offensive, harmful, inaccurate or otherwise inappropriate, or in some cases, postings that have been mislabeled or are otherwise deceptive. Under no circumstances will Retrospring be liable in any way for any Content, including, but not limited to, any errors or omissions in any Content, or any loss or damage of any kind incurred as a result of the use of any Content posted, emailed, transmitted or otherwise made available via the Services or broadcast elsewhere. %h2 4. Limitation of Liability %p Retrospring makes no guarantee of availability of service and reserves the right to change, withdraw, suspend, or discontinue any functionality or feature of Retrospring's services. In no event shall Retrospring be liable for any damages whatsoever. This includes direct, indirect, incidental, special, consequential, or punitive damages arising out of the use of or inability to use Retrospring's services or any content thereon. %h2 5. Restrictions on Content and Use of the Services From cb13903493eea69dca7d51575d7224793e337186 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 15:57:05 +0100 Subject: [PATCH 074/231] update moderator display --- app/assets/stylesheets/base.css.scss | 8 ++++++++ app/views/static/about.html.haml | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index ac7d4c73..98fa582d 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -68,6 +68,14 @@ body { list-style: none; } +.about--moderator a { + text-decoration: none; +} + +.about--moderator a:hover { + text-decoration: none; +} + .j2-up { text-transform: uppercase; } diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml index b8abc228..4ae341ab 100644 --- a/app/views/static/about.html.haml +++ b/app/views/static/about.html.haml @@ -42,10 +42,8 @@ that look after you! %ul.about--moderator - User.where(moderator: true).each do |mod| - %li - %a{href: show_user_profile_path(mod.screen_name)} - %img.answerbox--img-small{src: User.find_by_screen_name(mod.screen_name).profile_picture.url(:medium)} - = mod.screen_name + %a{href: show_user_profile_path(mod.screen_name), title: mod.screen_name, data: { toggle: :tooltip, placement: :top }} + %img.img-rounded.answerbox--img-small{src: mod.profile_picture.url(:small)} .col-sm-4 .panel.panel-default .panel-body From 0dfbac0bda70921524ab6f9b4eecba8a83282812 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:37:07 +0100 Subject: [PATCH 075/231] update profile dropdown, first draft --- app/assets/stylesheets/scss/navbar.scss | 16 ++++++++++++++ app/views/layouts/_header.html.haml | 17 +-------------- app/views/layouts/_profile.html.haml | 29 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 app/views/layouts/_profile.html.haml diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index daa4c796..afd4a8fc 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -84,4 +84,20 @@ margin-right: 7px; margin-bottom: 7px; z-index: 99; +} + +.profile--dropdown { + min-width: 220px; + margin-top: 0px !important; +} + +.profile--dropdown-media { + padding: 3px 5px; +} + +.profile--dropdown-img { + min-height: 45px; + min-width: 45px; + height: 45px; + width: 45px; } \ No newline at end of file diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 6bfaf658..dbacfbe9 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -27,22 +27,7 @@ %li.hidden-xs{"data-toggle" => "tooltip", "data-placement" => "bottom", title: "Ask a question"} .btn.btn-link.navbar-btn{name: "toggle-all-ask", "data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"} %i.fa.fa-pencil-square-o - %li.dropdown - %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} - %img.img-rounded.answerbox--img-small.hidden-xs{src: current_user.profile_picture.url(:small)} - = current_user.screen_name - %b.caret - %ul.dropdown-menu - %li= link_to "View profile", show_user_profile_path(current_user.screen_name) - %li= link_to "Settings", edit_user_registration_path - %li.divider - - if current_user.admin? - %li= link_to "Kontrollzentrum", rails_admin_path - %li= link_to "Sidekiq", sidekiq_web_path - - if current_user.mod? - %li= link_to "Moderation panel", moderation_path - %li.divider - %li= link_to "Logout", destroy_user_session_path, method: :delete + = render "layouts/profile" - else %ul.nav.navbar-nav.navbar-right = nav_entry "Sign in", new_user_session_path diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml new file mode 100644 index 00000000..82eb0860 --- /dev/null +++ b/app/views/layouts/_profile.html.haml @@ -0,0 +1,29 @@ +%li.dropdown + %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} + %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} + %span.visible-xs= current_user.screen_name + %b.caret + %ul.dropdown-menu.profile--dropdown + %li.hidden-xs + .media.profile--dropdown-media + .pull-left + %img.img-rounded.profile--dropdown-img{src: current_user.profile_picture.url(:medium)} + .media-body + - if @user.display_name.blank? + .profile--displayname + = @user.screen_name + - else + .profile--displayname + = @user.display_name + .profile--username + = @user.screen_name + %li= link_to "View profile", show_user_profile_path(current_user.screen_name) + %li= link_to "Settings", edit_user_registration_path + %li.divider + - if current_user.admin? + %li= link_to "Kontrollzentrum", rails_admin_path + %li= link_to "Sidekiq", sidekiq_web_path + - if current_user.mod? + %li= link_to "Moderation panel", moderation_path + %li.divider + %li= link_to "Logout", destroy_user_session_path, method: :delete \ No newline at end of file From 55a4278c34452ef5c40387cdfa26b7c078cf2666 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:39:28 +0100 Subject: [PATCH 076/231] copycat failures --- app/views/layouts/_profile.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index 82eb0860..7a396a54 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -9,14 +9,14 @@ .pull-left %img.img-rounded.profile--dropdown-img{src: current_user.profile_picture.url(:medium)} .media-body - - if @user.display_name.blank? + - if current_user.display_name.blank? .profile--displayname - = @user.screen_name + = current_user.screen_name - else .profile--displayname - = @user.display_name + = current_user.display_name .profile--username - = @user.screen_name + = current_user.screen_name %li= link_to "View profile", show_user_profile_path(current_user.screen_name) %li= link_to "Settings", edit_user_registration_path %li.divider From 1ef032e69e27c092952035bf2c6654638ccf451b Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:48:14 +0100 Subject: [PATCH 077/231] some more changes --- app/assets/stylesheets/scss/navbar.scss | 14 ++++++++++++++ app/views/layouts/_profile.html.haml | 7 ++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index afd4a8fc..49d459ad 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -100,4 +100,18 @@ min-width: 45px; height: 45px; width: 45px; +} + +.profile--dropdown-username { + font-weight: 700; + font-size: 1.2em; + line-height: 1.33em; + margin-top: 9.5px; +} + +.profile--dropdown-displayname { + font-weight: 700; + font-size: 1.2em; + line-height: 1.33em; + margin-top: 2px; } \ No newline at end of file diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index 7a396a54..89504703 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -10,14 +10,15 @@ %img.img-rounded.profile--dropdown-img{src: current_user.profile_picture.url(:medium)} .media-body - if current_user.display_name.blank? - .profile--displayname + .profile--dropdown-username = current_user.screen_name - else - .profile--displayname + .profile--dropdown-displayname = current_user.display_name .profile--username = current_user.screen_name - %li= link_to "View profile", show_user_profile_path(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 - if current_user.admin? From 89ea02e7af76625a55fd0bea852a94ca77742e33 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:51:04 +0100 Subject: [PATCH 078/231] the navbar is kinda broken --- app/assets/stylesheets/scss/navbar.scss | 5 +++++ app/views/layouts/_profile.html.haml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 49d459ad..62dd944a 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -114,4 +114,9 @@ font-size: 1.2em; line-height: 1.33em; margin-top: 2px; +} + +.profile--image-dropdown { + padding-top: 16px; + padding-bottom: 16px; } \ No newline at end of file diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index 89504703..ba986ca0 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -1,4 +1,4 @@ -%li.dropdown +%li.dropdown.profile--image-dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} %span.visible-xs= current_user.screen_name From ed3490c40c111175c8c5e4d3f15efadfd7f1a528 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:52:08 +0100 Subject: [PATCH 079/231] whoops --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 62dd944a..ac5e3b3f 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -116,7 +116,7 @@ margin-top: 2px; } -.profile--image-dropdown { +.profile--image-dropdown a { padding-top: 16px; padding-bottom: 16px; } \ No newline at end of file From 8e9a893c7949e7a00f911cd5ffcdd77a9f0b2ac8 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:54:48 +0100 Subject: [PATCH 080/231] trying to fix this --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index ac5e3b3f..98f5b0d1 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -116,7 +116,7 @@ margin-top: 2px; } -.profile--image-dropdown a { +.profile--image-dropdown .dropdown-toggle { padding-top: 16px; padding-bottom: 16px; } \ No newline at end of file From 136b4dbba5c986ca4498baaa7c76f86b23177b85 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:57:51 +0100 Subject: [PATCH 081/231] =?UTF-8?q?trying=20to=20fix=20this=C2=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/scss/navbar.scss | 6 +++--- app/views/layouts/_profile.html.haml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 98f5b0d1..9566777d 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -116,7 +116,7 @@ margin-top: 2px; } -.profile--image-dropdown .dropdown-toggle { - padding-top: 16px; - padding-bottom: 16px; +.profile--image-dropdown { + padding-top: 16px !important; + padding-bottom: 16px !important; } \ No newline at end of file diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index ba986ca0..93e5a9f4 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -1,5 +1,5 @@ -%li.dropdown.profile--image-dropdown - %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} +%li.dropdown + %a.dropdown-toggle.profile--image-dropdown{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} %span.visible-xs= current_user.screen_name %b.caret From 4e7c0ec81907dab055f47bc4558d77bcbeccb97c Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 16:59:54 +0100 Subject: [PATCH 082/231] =?UTF-8?q?trying=20to=20fix=20this=C2=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/stylesheets/scss/navbar.scss | 2 +- app/views/layouts/_profile.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 9566777d..15879c64 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -116,7 +116,7 @@ margin-top: 2px; } -.profile--image-dropdown { +.profile--image-dropdown > a { padding-top: 16px !important; padding-bottom: 16px !important; } \ No newline at end of file diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index 93e5a9f4..ba986ca0 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -1,5 +1,5 @@ -%li.dropdown - %a.dropdown-toggle.profile--image-dropdown{href: "#", "data-toggle" => "dropdown"} +%li.dropdown.profile--image-dropdown + %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} %span.visible-xs= current_user.screen_name %b.caret From b9874ff423e6fc39b24cea6353324dce5c273332 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:01:50 +0100 Subject: [PATCH 083/231] more centered alignment for single usernames --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 15879c64..c1fc3462 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -106,7 +106,7 @@ font-weight: 700; font-size: 1.2em; line-height: 1.33em; - margin-top: 9.5px; + margin-top: 10px; } .profile--dropdown-displayname { From 8a83db4291295c7603ec79c5520b67f8fb1d2679 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:02:14 +0100 Subject: [PATCH 084/231] can we remove the important here? --- app/assets/stylesheets/scss/navbar.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index c1fc3462..53a2c6a7 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -117,6 +117,6 @@ } .profile--image-dropdown > a { - padding-top: 16px !important; - padding-bottom: 16px !important; + padding-top: 16px; + padding-bottom: 16px; } \ No newline at end of file From 2e75649b71a9bfab286d868b281885ae3453c831 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:08:22 +0100 Subject: [PATCH 085/231] optimization to mobile display --- app/views/layouts/_profile.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index ba986ca0..020eaf6e 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -1,8 +1,8 @@ %li.dropdown.profile--image-dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} - %span.visible-xs= current_user.screen_name - %b.caret + .visible-xs= current_user.screen_name + %b.caret.visible-xs %ul.dropdown-menu.profile--dropdown %li.hidden-xs .media.profile--dropdown-media From f46ebe5a30d9f326e69500b5396fb52f86952501 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:11:21 +0100 Subject: [PATCH 086/231] doing the worst things to css since its existence --- app/assets/stylesheets/scss/navbar.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 53a2c6a7..c1fc3462 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -117,6 +117,6 @@ } .profile--image-dropdown > a { - padding-top: 16px; - padding-bottom: 16px; + padding-top: 16px !important; + padding-bottom: 16px !important; } \ No newline at end of file From 42dd275b2fba1c1a226c50042e218029bd628834 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:22:40 +0100 Subject: [PATCH 087/231] more optimizations to mobile display --- app/assets/stylesheets/scss/navbar.scss | 4 ++++ app/views/layouts/_profile.html.haml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index c1fc3462..c7dda8eb 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -119,4 +119,8 @@ .profile--image-dropdown > a { padding-top: 16px !important; padding-bottom: 16px !important; +} + +.navbar--inline-block { + display: inline-block !important; } \ No newline at end of file diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index 020eaf6e..f1caee58 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -2,7 +2,7 @@ %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} .visible-xs= current_user.screen_name - %b.caret.visible-xs + %b.caret.visible-xs.navbar--inline-block %ul.dropdown-menu.profile--dropdown %li.hidden-xs .media.profile--dropdown-media From f2678cac0f50ec4b39c599e742031a33978803a9 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:23:46 +0100 Subject: [PATCH 088/231] applied to wrong item --- app/views/layouts/_profile.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index f1caee58..033b28f2 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -1,7 +1,7 @@ %li.dropdown.profile--image-dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} - .visible-xs= current_user.screen_name + .visible-xs.navbar--inline-block= current_user.screen_name %b.caret.visible-xs.navbar--inline-block %ul.dropdown-menu.profile--dropdown %li.hidden-xs From 06d2af92cece5c9ca67680e73989eb7318eccd61 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:25:46 +0100 Subject: [PATCH 089/231] another way to fix this --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index c7dda8eb..6f8dcdeb 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -121,6 +121,6 @@ padding-bottom: 16px !important; } -.navbar--inline-block { +.profile--image-dropdown .visible-xs { display: inline-block !important; } \ No newline at end of file From 910c1a81d65031d2809fe14c4e41cbcde43b6741 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:44:07 +0100 Subject: [PATCH 090/231] I heard you like importants in media queries so I put an important in your media query --- app/assets/stylesheets/scss/navbar.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 6f8dcdeb..8890e6ad 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -121,6 +121,8 @@ padding-bottom: 16px !important; } -.profile--image-dropdown .visible-xs { - display: inline-block !important; +@media (max-width: $screen-xs-max) { + .profile--image-dropdown > .visible-xs { + display: inline-block !important; + } } \ No newline at end of file From 0f8940435d2228862fcf09b42dfd15a611697336 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:46:19 +0100 Subject: [PATCH 091/231] impoooortant --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 8890e6ad..4a002d10 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -123,6 +123,6 @@ @media (max-width: $screen-xs-max) { .profile--image-dropdown > .visible-xs { - display: inline-block !important; + display: inline-block; } } \ No newline at end of file From c033f1f4b280f73dd72456262957d520af8c10ee Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:48:19 +0100 Subject: [PATCH 092/231] media queries for min and max size --- app/assets/stylesheets/scss/navbar.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 4a002d10..0022037c 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -123,6 +123,12 @@ @media (max-width: $screen-xs-max) { .profile--image-dropdown > .visible-xs { - display: inline-block; + display: inline-block !important; + } +} + +@media (min-width: $screen-sm-min) { + .profile--image-dropdown > .visible-xs { + display: none !important; } } \ No newline at end of file From 5c2d75ece96e55e636b5fad0ca02fb5aef733035 Mon Sep 17 00:00:00 2001 From: nilsding Date: Thu, 12 Feb 2015 17:48:46 +0100 Subject: [PATCH 093/231] now marking multiple "smiled" and "commented" notifications as read at once --- app/controllers/answer_controller.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/controllers/answer_controller.rb b/app/controllers/answer_controller.rb index 4c8bd73e..9924b9bf 100644 --- a/app/controllers/answer_controller.rb +++ b/app/controllers/answer_controller.rb @@ -9,16 +9,10 @@ class AnswerController < ApplicationController notif.new = false notif.save end - notif = Notification.where(target_type: "Comment", target_id: @answer.comments.pluck(:id), recipient_id: current_user.id, new: true).first - unless notif.nil? - notif.new = false - notif.save - end - notif = Notification.where(target_type: "Smile", target_id: @answer.smiles.pluck(:id), recipient_id: current_user.id, new: true).first - unless notif.nil? - notif.new = false - notif.save - end + notif = Notification.where(target_type: "Comment", target_id: @answer.comments.pluck(:id), recipient_id: current_user.id, new: true) + notif.update_all(new: false) unless notif.empty? + notif = Notification.where(target_type: "Smile", target_id: @answer.smiles.pluck(:id), recipient_id: current_user.id, new: true) + notif.update_all(new: false) unless notif.empty? end end end From f58ec9f2a6149c9b1a630f7c0987e4ed853c911a Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 17:50:13 +0100 Subject: [PATCH 094/231] another try to fix --- app/assets/stylesheets/scss/navbar.scss | 12 ------------ app/views/layouts/_profile.html.haml | 5 +++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index 0022037c..c1fc3462 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -119,16 +119,4 @@ .profile--image-dropdown > a { padding-top: 16px !important; padding-bottom: 16px !important; -} - -@media (max-width: $screen-xs-max) { - .profile--image-dropdown > .visible-xs { - display: inline-block !important; - } -} - -@media (min-width: $screen-sm-min) { - .profile--image-dropdown > .visible-xs { - display: none !important; - } } \ No newline at end of file diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index 033b28f2..a8f599de 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -1,8 +1,9 @@ %li.dropdown.profile--image-dropdown %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} %img.img-rounded.answerbox--img.hidden-xs{src: current_user.profile_picture.url(:small)} - .visible-xs.navbar--inline-block= current_user.screen_name - %b.caret.visible-xs.navbar--inline-block + %span.visible-xs + = current_user.screen_name + %b.caret %ul.dropdown-menu.profile--dropdown %li.hidden-xs .media.profile--dropdown-media From 9aabccdddc2ac3382d5556d69a107d0e3ae2fa6d Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 18:10:16 +0100 Subject: [PATCH 095/231] add links to profile --- app/views/layouts/_profile.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_profile.html.haml b/app/views/layouts/_profile.html.haml index a8f599de..49d16329 100644 --- a/app/views/layouts/_profile.html.haml +++ b/app/views/layouts/_profile.html.haml @@ -12,10 +12,12 @@ .media-body - if current_user.display_name.blank? .profile--dropdown-username - = current_user.screen_name + %a{href: show_user_profile_path(current_user.screen_name)} + = current_user.screen_name - else .profile--dropdown-displayname - = current_user.display_name + %a{href: show_user_profile_path(current_user.screen_name)} + = current_user.display_name .profile--username = current_user.screen_name %li.divider.hidden-xs From 2a854c1cda66ba9d5720027cc319cf44d86f2573 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 18:14:23 +0100 Subject: [PATCH 096/231] update paddings --- app/assets/stylesheets/scss/navbar.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/scss/navbar.scss b/app/assets/stylesheets/scss/navbar.scss index c1fc3462..1511f8fb 100644 --- a/app/assets/stylesheets/scss/navbar.scss +++ b/app/assets/stylesheets/scss/navbar.scss @@ -92,7 +92,7 @@ } .profile--dropdown-media { - padding: 3px 5px; + padding: 3px 15px; } .profile--dropdown-img { From e3bc0d6300bdeb8a82f0976c3178f21c834980e8 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Thu, 12 Feb 2015 21:59:46 +0100 Subject: [PATCH 097/231] add inbox pagination --- app/views/inbox/show.html.haml | 6 ++++++ app/views/inbox/show.js.erb | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 app/views/inbox/show.js.erb diff --git a/app/views/inbox/show.html.haml b/app/views/inbox/show.html.haml index 0d9098b2..0619f301 100644 --- a/app/views/inbox/show.html.haml +++ b/app/views/inbox/show.html.haml @@ -8,6 +8,12 @@ - @inbox.each do |i| = render 'inbox/entry', i: i + #pagination= will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false + + - if @inbox.next_page + %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @inbox.current_page }} + Load more + - if @inbox.empty? Nothing to see here. diff --git a/app/views/inbox/show.js.erb b/app/views/inbox/show.js.erb new file mode 100644 index 00000000..5b6366c9 --- /dev/null +++ b/app/views/inbox/show.js.erb @@ -0,0 +1,8 @@ +$('#timeline').append('<% @timeline.each do |answer| + %><%= j render 'inbox/entry', a: answer +%><% end %>'); +<% if @timeline.next_page %> +$('#pagination').html('<%= j will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false %>'); +<% else %> +$('#pagination, #load-more-btn').remove(); +<% end %> \ No newline at end of file From cb606f942a2868ca628b4b446b82fc6c00bf3384 Mon Sep 17 00:00:00 2001 From: Georg G Date: Thu, 12 Feb 2015 22:09:11 +0100 Subject: [PATCH 098/231] fixed pagination for real --- app/controllers/inbox_controller.rb | 6 +++++- app/views/inbox/show.html.haml | 14 +++++++------- app/views/inbox/show.js.erb | 7 ++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/controllers/inbox_controller.rb b/app/controllers/inbox_controller.rb index 076e1264..728141bd 100644 --- a/app/controllers/inbox_controller.rb +++ b/app/controllers/inbox_controller.rb @@ -2,6 +2,10 @@ class InboxController < ApplicationController before_filter :authenticate_user! def show - @inbox = Inbox.where(user: current_user).order(:created_at).reverse_order + @inbox = Inbox.where(user: current_user).order(:created_at).reverse_order.paginate(page: params[:page]) + respond_to do |format| + format.html + format.js + end end end diff --git a/app/views/inbox/show.html.haml b/app/views/inbox/show.html.haml index 0619f301..ced60bd5 100644 --- a/app/views/inbox/show.html.haml +++ b/app/views/inbox/show.html.haml @@ -8,15 +8,15 @@ - @inbox.each do |i| = render 'inbox/entry', i: i - #pagination= will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false - - - if @inbox.next_page - %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @inbox.current_page }} - Load more - - if @inbox.empty? - Nothing to see here. + + #pagination= will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false + + - if @inbox.next_page + %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @inbox.current_page }} + Load more + .col-md-9.col-xs-12.col-sm-9.visible-xs = render 'inbox/sidebar' diff --git a/app/views/inbox/show.js.erb b/app/views/inbox/show.js.erb index 5b6366c9..e2463c02 100644 --- a/app/views/inbox/show.js.erb +++ b/app/views/inbox/show.js.erb @@ -1,8 +1,9 @@ -$('#timeline').append('<% @timeline.each do |answer| - %><%= j render 'inbox/entry', a: answer +$('#entries').append('<% @inbox.each do |i| + %><%= j render 'inbox/entry', i: i %><% end %>'); <% if @timeline.next_page %> $('#pagination').html('<%= j will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false %>'); <% else %> $('#pagination, #load-more-btn').remove(); -<% end %> \ No newline at end of file +<% end %> +<% @inbox.update_all(new: false) %> \ No newline at end of file From 66c5e46a78287e59da2b6bcdb577236548366b4b Mon Sep 17 00:00:00 2001 From: Georg G Date: Thu, 12 Feb 2015 22:10:50 +0100 Subject: [PATCH 099/231] this happens all the time --- app/views/inbox/show.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/inbox/show.js.erb b/app/views/inbox/show.js.erb index e2463c02..8c2e959e 100644 --- a/app/views/inbox/show.js.erb +++ b/app/views/inbox/show.js.erb @@ -1,7 +1,7 @@ $('#entries').append('<% @inbox.each do |i| %><%= j render 'inbox/entry', i: i %><% end %>'); -<% if @timeline.next_page %> +<% if @inbox.next_page %> $('#pagination').html('<%= j will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false %>'); <% else %> $('#pagination, #load-more-btn').remove(); From d5fcec4d7d1c67230072e65670d20dd8d7d1524a Mon Sep 17 00:00:00 2001 From: Georg G Date: Thu, 12 Feb 2015 22:15:01 +0100 Subject: [PATCH 100/231] hide that "Load more" button if you delete all questions --- app/assets/javascripts/inbox.coffee | 1 + app/views/inbox/_sidebar.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/inbox.coffee b/app/assets/javascripts/inbox.coffee index ff553e0b..0741ce09 100644 --- a/app/assets/javascripts/inbox.coffee +++ b/app/assets/javascripts/inbox.coffee @@ -40,6 +40,7 @@ success: (data, status, jqxhr) -> if data.success succ = yes + ($ "div#pagination, button#load-more-btn").slideUp() entries = ($ "div#entries") entries.slideUp 400, -> entries.html("Nothing to see here.") diff --git a/app/views/inbox/_sidebar.html.haml b/app/views/inbox/_sidebar.html.haml index c9629caf..dedb5906 100644 --- a/app/views/inbox/_sidebar.html.haml +++ b/app/views/inbox/_sidebar.html.haml @@ -17,4 +17,4 @@ .panel-heading %h3.panel-title Actions .panel-body - %button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (@inbox.empty? ? 'disabled' : nil), data: { ib_count: @inbox.count }} Delete all questions \ No newline at end of file + %button.btn.btn-block.btn-danger{type: :button, id: 'ib-delete-all', disabled: (Inbox.where(user: current_user).empty? ? 'disabled' : nil), data: { ib_count: Inbox.where(user: current_user).count }} Delete all questions \ No newline at end of file From 8f9472a61192773bee778bfbb44da3406b3f8886 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 16 Feb 2015 16:32:29 +0100 Subject: [PATCH 101/231] update privacy policy --- app/views/static/privacy_policy.html.haml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml index 2b9706f0..7d179f55 100644 --- a/app/views/static/privacy_policy.html.haml +++ b/app/views/static/privacy_policy.html.haml @@ -5,17 +5,16 @@ %p This Privacy Policy describes how and when Retrospring uses and collects your data, checks your information and shares with other Services. %h2 Information Collection and Use %h4 Basic Account Information - %p When you create a Retrospring account, you provide some personal information, such as your username, password, and email address. Asking questions anonymously or looking at user profiles does not require registration. - %h4 Additional Information - %p You may provide us with information for public displaying, like a short biography, a link to your website, your location or a profile picture. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. + %p Upon creation of a Retrospring account, some personal information such as your username, password, and email address is collected and stored internally. Asking questions anonymously or browsing any other areas of the service does not require registration or the providing of any further information. + %p Public information like a short biography, a link to your website, your location or a profile picture can be provided after registration. This information is viewable by any visitor of the site, registered or unregistered, and therefore should not contain any critical information about you or someone else. %h4 Answers and Questions %p Our Service primarily is designed to ask your friends and other people from around the world questions or answer them. Most of the information you provide us is information you are asking us to make public. This information does not only include the questions, answers, comments and smiles, but also the groups you create, the people you follow and other bits of information that result from using our Service. %h4 Cookies %p Like many websites, we use cookies and similar technologies to collect additional website usage data and to improve our Services. A cookie is a small data file that is transferred to your computer's hard disk. Retrospring uses persistant cookies to improve the users browsing experience and to to better understand how you interact with our Services. Most Internet browsers automatically accept cookies. You can instruct your browser, by changing its settings, to stop accepting cookies or to prompt you before accepting a cookie from the websites you visit. However, the Services may not function properly if you disable cookies. - %h4 Log Data - %p When you use our Services, we may receive information ("Log Data") such as your IP address, browser type, operating system, the referring web page, pages visited, location, your mobile carrier, device information (including device and application IDs), search terms, and cookie information. We receive Log Data when you interact with our Services, for example, when you visit our websites or sign into our Services. + %h4 Non-personal Identification Information + %p When using our Services, we may receive technical information ("Non-personal Identification") information such as your IP address, browser type, operating system, the referring web page, pages visited, location, search terms, and cookie information. We receive this data when you interact with our Services, for example, when you visit our websites or sign into our Services. %h4 Third-Party Services - %p Retrospring uses a variety of third-party services to help provide our Services and to help us understand and improve the use of our Services, such as Piwik Analytics, or to share your answers to, if connected, other Services like Twitter, Tumblr or Facebook. These third-party service providers may collect information sent by your browser as part of a web page request, such as cookies or your IP address. + %p Retrospring uses a variety of third-party services to help provide our Services and to help us understand and improve the use of our Services, such as Piwik Analytics, or to share your answers to, if connected, other Services like Twitter, Tumblr or Facebook. These third-party service providers may collect information sent by your browser as part of a web page request, such as cookies or your IP address. Please refer to their Privacy Policies in regard to how they handle your data. %h2 Information Sharing %p Retrospring will keep any collected data (see "Information Collection and Use" above) encrypted on our servers. Any information shared with other Services is controlled by the user itself, as we only supply sharing to these. If a user isn't satisfied with Terms from another Service they shouldn't connect their accounts or remove access over the Sharing page on the profile settings page. %p Notwithstanding anything to the contrary in this Policy, we may preserve or disclose your information if we believe that it is reasonably necessary to comply with a law, regulation or legal request; to protect the safety of any person; to address fraud, security or technical issues; or to protect Retrospring's rights or property. However, nothing in this Privacy Policy is intended to limit any legal defenses or objections that you may have to a third party’s, including a government’s, request to disclose your information. From d87d18ae9dfa1135e15d99c4b5fe37ea231c0bb0 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Mon, 16 Feb 2015 19:23:58 +0100 Subject: [PATCH 102/231] change effective date --- app/views/static/privacy_policy.html.haml | 2 +- app/views/static/terms.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/static/privacy_policy.html.haml b/app/views/static/privacy_policy.html.haml index 7d179f55..81bd95c7 100644 --- a/app/views/static/privacy_policy.html.haml +++ b/app/views/static/privacy_policy.html.haml @@ -24,4 +24,4 @@ %h2 Our Policy Towards Children %p Our Services are not directed to persons under 14. If you become aware that your child has provided us with personal information without your consent, contact us on privacy@retrospring.net . We do not knowingly collect personal information from children under 14. If we become aware that a child under 14 has provided us with personal information, we take steps to remove such information and terminate the child's account. %p - %em Effective: the time we will actually publish it plus some days \ No newline at end of file + %em Effective: 16th February 2015 \ No newline at end of file diff --git a/app/views/static/terms.html.haml b/app/views/static/terms.html.haml index 036621c7..81ae346c 100644 --- a/app/views/static/terms.html.haml +++ b/app/views/static/terms.html.haml @@ -25,4 +25,4 @@ %p Retrospring respects the intellectual property rights of others and expects users of the Services to do the same. We will respond to notices of alleged copyright infringement that comply with applicable law and are properly provided to us. If you believe that your Content has been copied in a way that constitutes copyright infringement, please provide us with the following information: a physical or electronic signature of the copyright owner or a person authorized to act on their behalf; identification of the copyrighted work claimed to have been infringed; identification of the material that is claimed to be infringing or to be the subject of infringing activity and that is to be removed or access to which is to be disabled, and information reasonably sufficient to permit us to locate the material; your contact information, including your address, telephone number, and an email address; a statement by you that you have a good faith belief that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law; and a statement that the information in the notification is accurate, and, under penalty of perjury, that you are authorized to act on behalf of the copyright owner. %p We reserve the right to remove Content alleged to be infringing without prior notice, at our sole discretion, and without liability to you. In appropriate circumstances, Retrospring will also terminate a user’s account if the user is determined to be a repeat infringer. %p - %em Effective: the time we will actually publish it plus some days \ No newline at end of file + %em Effective: 16th February 2015 \ No newline at end of file From 6c4f5c11df5dc2950941545f21933ee5bebd1338 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 17 Feb 2015 00:53:09 +0100 Subject: [PATCH 103/231] fix growl notification positioning --- app/assets/stylesheets/base.css.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index 98fa582d..2187476a 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -115,4 +115,8 @@ body { padding-left: 0px; padding-right: 0px; } +} + +#growls .default { + top: 64px; } \ No newline at end of file From 9bffdec2a5e9c318a6c0536143bfe5de1efe9548 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 17 Feb 2015 00:56:12 +0100 Subject: [PATCH 104/231] fix growl notification positioning, this time for real --- app/assets/stylesheets/base.css.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index 2187476a..6eb4184f 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -117,6 +117,7 @@ body { } } -#growls .default { - top: 64px; +#growls.default{ + top:64px; + right:10px } \ No newline at end of file From c61b9ddf50c0019c904e3b7fda0d383a1dba5e00 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Tue, 17 Feb 2015 23:57:34 +0100 Subject: [PATCH 105/231] fix #83 --- app/views/shared/_answerbox.html.haml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index f46c90c3..f94909bf 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -54,7 +54,17 @@ = render 'shared/answerbox_buttons', a: a - else .row - .col-md-6.col-md-offset-6.col-sm-8.col-sm-offset-4.col-xs-6.col-xs-offset-6.text-right + .col-md-6.col-sm-4.col-xs-6.text-left.text-muted + - if a.question.author_is_anonymous? + %i.fa.fa-clock-o + %a{href: show_user_answer_path(a.user.screen_name, a.id)} + %span= time_ago_in_words(a.created_at) + ago + - else + %i.fa.fa-clock-o + %span= time_ago_in_words(a.created_at) + ago + .col-md-6.col-sm-8.col-xs-6.text-right = render 'shared/answerbox_buttons', a: a .panel-footer{id: "ab-comments-section-#{a.id}", style: @display_all.nil? ? 'display: none' : nil } %div{id: "ab-smiles-#{a.id}"}= render 'shared/smiles', a: a From a451cab3e91b927c50641d22c71ce9420ebefd52 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Wed, 18 Feb 2015 00:07:38 +0100 Subject: [PATCH 106/231] show answer link in all cases --- app/views/shared/_answerbox.html.haml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index f94909bf..36062247 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -55,13 +55,8 @@ - else .row .col-md-6.col-sm-4.col-xs-6.text-left.text-muted - - if a.question.author_is_anonymous? - %i.fa.fa-clock-o - %a{href: show_user_answer_path(a.user.screen_name, a.id)} - %span= time_ago_in_words(a.created_at) - ago - - else - %i.fa.fa-clock-o + %i.fa.fa-clock-o + %a{href: show_user_answer_path(a.user.screen_name, a.id)} %span= time_ago_in_words(a.created_at) ago .col-md-6.col-sm-8.col-xs-6.text-right From a3bfa41baa349b18d78cf1ff55010f26f4cfc3fa Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 20 Feb 2015 00:18:43 +0100 Subject: [PATCH 107/231] add date tooltips to relative dates --- app/views/shared/_answerbox.html.haml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index 36062247..114a5699 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -10,10 +10,12 @@ = user_screen_name a.question.user, a.question.author_is_anonymous asked - if @user.nil? or a.question.author_is_anonymous - = time_ago_in_words(a.question.created_at) + %span{title: a.question.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(a.question.created_at) - else %a{href: show_user_question_path(a.question.user.screen_name, a.question.id)} - = time_ago_in_words(a.question.created_at) + %span{title: a.question.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(a.question.created_at) ago - unless a.question.author_is_anonymous - if a.question.answer_count > 1 @@ -48,7 +50,8 @@ = user_screen_name a.user .answerbox--answer-date %a{href: show_user_answer_path(a.user.screen_name, a.id)} - %span= time_ago_in_words(a.created_at) + %span{title: a.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(a.created_at) ago .col-md-6.col-sm-8.col-xs-6.text-right = render 'shared/answerbox_buttons', a: a @@ -57,7 +60,8 @@ .col-md-6.col-sm-4.col-xs-6.text-left.text-muted %i.fa.fa-clock-o %a{href: show_user_answer_path(a.user.screen_name, a.id)} - %span= time_ago_in_words(a.created_at) + %span{title: a.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(a.created_at) ago .col-md-6.col-sm-8.col-xs-6.text-right = render 'shared/answerbox_buttons', a: a From 66cc15971e7d4b75fe954ca9901970c313e09208 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 20 Feb 2015 00:40:41 +0100 Subject: [PATCH 108/231] more date tooltips --- app/views/inbox/_entry.html.haml | 3 ++- app/views/moderation/_moderationbox.html.haml | 3 ++- app/views/notifications/_notification.html.haml | 12 ++++++++---- app/views/question/show.html.haml | 3 ++- app/views/shared/_question.html.haml | 1 + 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/views/inbox/_entry.html.haml b/app/views/inbox/_entry.html.haml index 821daa36..c93e7817 100644 --- a/app/views/inbox/_entry.html.haml +++ b/app/views/inbox/_entry.html.haml @@ -8,7 +8,8 @@ %h6.text-muted.media-heading.answerbox--question-user = user_screen_name i.question.user, i.question.author_is_anonymous asked - = time_ago_in_words(i.question.created_at) + %span{title: i.question.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(i.question.created_at) ago - unless i.question.author_is_anonymous - if i.question.answer_count > 0 diff --git a/app/views/moderation/_moderationbox.html.haml b/app/views/moderation/_moderationbox.html.haml index 51eae25e..a671a220 100644 --- a/app/views/moderation/_moderationbox.html.haml +++ b/app/views/moderation/_moderationbox.html.haml @@ -4,7 +4,8 @@ = user_screen_name report.user reported a = report.type.sub('Reports::', '') - = time_ago_in_words(report.created_at) + %span{title: report.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(report.created_at) ago .panel-body %p diff --git a/app/views/notifications/_notification.html.haml b/app/views/notifications/_notification.html.haml index 00fb1ccb..efc508f6 100644 --- a/app/views/notifications/_notification.html.haml +++ b/app/views/notifications/_notification.html.haml @@ -11,7 +11,8 @@ answered %a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id), title: "#{notification.target.content[0..40]}...", data: { toggle: :tooltip, placement: :top }} your question - = time_ago_in_words notification.target.created_at + %span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words notification.target.created_at ago .notification--icon %i.fa.fa-exclamation @@ -23,7 +24,8 @@ = user_screen_name notification.target.source %p.notification--text followed you - = time_ago_in_words notification.target.created_at + %span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words notification.target.created_at ago .notification--icon %i.fa.fa-users @@ -37,7 +39,8 @@ smiled at %a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }} your answer - = time_ago_in_words notification.target.created_at + %span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words notification.target.created_at ago .notification--icon %i.fa.fa-smile-o @@ -51,7 +54,8 @@ commented on %a{href: show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id), title: "#{notification.target.answer.content[0..40]}...", data: { toggle: :tooltip, placement: :top }} your answer - = time_ago_in_words notification.target.created_at + %span{title: notification.target.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words notification.target.created_at ago .notification--icon %i.fa.fa-comments \ No newline at end of file diff --git a/app/views/question/show.html.haml b/app/views/question/show.html.haml index b259bfa5..b02aeaf5 100644 --- a/app/views/question/show.html.haml +++ b/app/views/question/show.html.haml @@ -10,7 +10,8 @@ %h6.text-muted.media-heading.answerbox--question-user = user_screen_name @question.user, @question.author_is_anonymous asked - = time_ago_in_words(@question.created_at) + %span{title: @question.created_at, data: { toggle: :tooltip, placement: :bottom }} + = time_ago_in_words(@question.created_at) ago %p.answerbox--question-text= @question.content diff --git a/app/views/shared/_question.html.haml b/app/views/shared/_question.html.haml index d2b79ee3..f2f4da75 100644 --- a/app/views/shared/_question.html.haml +++ b/app/views/shared/_question.html.haml @@ -6,6 +6,7 @@ = user_screen_name q.user asked %a{href: show_user_question_path(q.user.screen_name, q.id)} + %span{title: q.created_at, data: { toggle: :tooltip, placement: :bottom }} = time_ago_in_words(q.created_at) ago - if q.answer_count > 1 From af598f585a4ffda3e9e76dd8811cecc35d9e4e5a Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 20 Feb 2015 01:12:24 +0100 Subject: [PATCH 109/231] added link to blog in the footer --- app/views/shared/_links.html.haml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/shared/_links.html.haml b/app/views/shared/_links.html.haml index 96c05265..63ae9842 100644 --- a/app/views/shared/_links.html.haml +++ b/app/views/shared/_links.html.haml @@ -6,3 +6,6 @@ = link_to "About", about_path · = link_to "Bugs", 'https://github.com/retrospring/bugs/issues' + · + / Tyler wanted this so much, here it is! + = link_to "Blog", 'https://blog.retrospring.net' \ No newline at end of file From da7b6845139077336b44ab1cfca95e409f966672 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Fri, 20 Feb 2015 01:23:48 +0100 Subject: [PATCH 110/231] add links to privacy policy and terms of service in footer --- app/views/shared/_links.html.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_links.html.haml b/app/views/shared/_links.html.haml index 63ae9842..1c507e92 100644 --- a/app/views/shared/_links.html.haml +++ b/app/views/shared/_links.html.haml @@ -8,4 +8,8 @@ = link_to "Bugs", 'https://github.com/retrospring/bugs/issues' · / Tyler wanted this so much, here it is! - = link_to "Blog", 'https://blog.retrospring.net' \ No newline at end of file + = link_to "Blog", 'https://blog.retrospring.net' + · + = link_to "Terms of Service", terms_path + · + = link_to "Privacy Policy", privacy_policy_path \ No newline at end of file From 92d4eafbbadd363705373bd5157f73713828de49 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sat, 28 Feb 2015 17:21:11 +0100 Subject: [PATCH 111/231] update questiongenerator --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 63dca713..c34fdbaa 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ gem 'rails_admin' gem 'sidekiq' gem 'sinatra', require: false -gem 'questiongenerator', git: 'https://github.com/justask/questiongenerator.git' +gem 'questiongenerator', git: 'https://github.com/retrospring/questiongenerator.git' gem 'sanitize' gem 'redcarpet' diff --git a/Gemfile.lock b/Gemfile.lock index fc086541..50d396ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT - remote: https://github.com/justask/questiongenerator.git - revision: 4f85dafbaf226e3dfbfad9ed3f169bab03b9a84c + remote: https://github.com/retrospring/questiongenerator.git + revision: 326d82728a96ff58bad4516c46f9abba06ba31df specs: questiongenerator (0.1.0) From 487de37477bc400d729e703793eeafcdfa8a0820 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sat, 28 Feb 2015 17:29:10 +0100 Subject: [PATCH 112/231] fix jihad issue #86 --- app/views/inbox/show.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/inbox/show.js.erb b/app/views/inbox/show.js.erb index 8c2e959e..32154b61 100644 --- a/app/views/inbox/show.js.erb +++ b/app/views/inbox/show.js.erb @@ -6,4 +6,4 @@ $('#pagination').html('<%= j will_paginate @inbox, renderer: BootstrapPagination <% else %> $('#pagination, #load-more-btn').remove(); <% end %> -<% @inbox.update_all(new: false) %> \ No newline at end of file +<% Inbox.where(id: @inbox.pluck(:id)).update_all(new: false) %> \ No newline at end of file From 40c3690c122237faad819d6496cbb3041ca8d963 Mon Sep 17 00:00:00 2001 From: pixeldesu Date: Tue, 3 Mar 2015 19:58:22 +0100 Subject: [PATCH 113/231] change default font to Lato --- app/assets/stylesheets/application.css.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 8bf94e9c..65e8a599 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -6,9 +6,9 @@ *= require_self */ -@import url(https://fonts.googleapis.com/css?family=Exo+2:400,700); +@import url(http://fonts.googleapis.com/css?family=Lato:400,700); -$font-family-sans-serif: "Exo 2","Open Sans", "Helvetica Neue", Helvetica, "DejaVu Sans", Arial, sans-serif; +$font-family-sans-serif: "Lato","Open Sans", "Helvetica Neue", Helvetica, "DejaVu Sans", Arial, sans-serif; $font-family-serif: Georgia, "DejaVu Serif", "Times New Roman", Times, serif; //** Default monospace fonts for ``, ``, and `
`.
 $font-family-monospace:   "PragmataPro", Monaco, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace;

From 642b3e57101ae6f3cb5052e5c223f842e226aa7f Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Tue, 3 Mar 2015 20:15:43 +0100
Subject: [PATCH 114/231] HTTPS

---
 app/assets/stylesheets/application.css.scss | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss
index 65e8a599..26273c74 100644
--- a/app/assets/stylesheets/application.css.scss
+++ b/app/assets/stylesheets/application.css.scss
@@ -6,7 +6,7 @@
  *= require_self
  */
 
-@import url(http://fonts.googleapis.com/css?family=Lato:400,700);
+@import url(https://fonts.googleapis.com/css?family=Lato:400,700);
 
 $font-family-sans-serif:  "Lato","Open Sans", "Helvetica Neue", Helvetica, "DejaVu Sans", Arial, sans-serif;
 $font-family-serif:       Georgia, "DejaVu Serif", "Times New Roman", Times, serif;

From 1773ff0b33852b2a084d36a8213745837c5cd6b4 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Wed, 18 Mar 2015 21:26:42 +0100
Subject: [PATCH 115/231] remove myself from about page

---
 app/views/static/about.html.haml | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml
index 4ae341ab..693446d5 100644
--- a/app/views/static/about.html.haml
+++ b/app/views/static/about.html.haml
@@ -13,13 +13,6 @@
           = succeed '!' do
             = APP_CONFIG['site_name']
           %br/
-          .media
-            .pull-left
-              %a{href: show_user_profile_path('nilsding')}
-                %img.img-rounded.answerbox--img{src: User.find_by_screen_name('nilsding').profile_picture.url(:medium)}
-            .media-body
-              %h4.entry-text.entry-about nilsding
-              %h6.entry-subtext Backend, Server & Code
           .media
             .pull-left
               %a{href: show_user_profile_path('pixeldesu')}

From 5d3cd6ee7506d5c01c6a8d93d3383ec541e22f62 Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Fri, 27 Mar 2015 13:17:16 +0100
Subject: [PATCH 116/231] add deletion message to index

---
 app/views/static/index.html.haml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml
index a3e2f94b..989f5089 100644
--- a/app/views/static/index.html.haml
+++ b/app/views/static/index.html.haml
@@ -5,7 +5,13 @@
       = render 'shared/sidebar'
     .col-md-9.col-xs-12.col-sm-9.j2-col-reset
       = render 'layouts/messages'
-
+      .alert.alert-danger.alert-dismissible{"role": "alert"}
+        %button.close{data: {dismiss: :alert}, aria: {label: "Close"}}
+          %span{aria: {hidden: true}}
+            ×
+        %strong
+          Retrospring will shut down
+        on 1.4.2015!
       #timeline
         - @timeline.each do |answer|
           = render 'shared/answerbox', a: answer

From 644b1b1316460c0c7e5c365b0d0d0fe395d6b90d Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Fri, 27 Mar 2015 13:21:46 +0100
Subject: [PATCH 117/231] add deletion message to index

---
 app/views/static/index.html.haml | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml
index 989f5089..412679e1 100644
--- a/app/views/static/index.html.haml
+++ b/app/views/static/index.html.haml
@@ -5,10 +5,7 @@
       = render 'shared/sidebar'
     .col-md-9.col-xs-12.col-sm-9.j2-col-reset
       = render 'layouts/messages'
-      .alert.alert-danger.alert-dismissible{"role": "alert"}
-        %button.close{data: {dismiss: :alert}, aria: {label: "Close"}}
-          %span{aria: {hidden: true}}
-            ×
+      .alert.alert-danger
         %strong
           Retrospring will shut down
         on 1.4.2015!

From fbb494f3ea65e5e1f45631809c083aa02227bf3d Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Fri, 27 Mar 2015 13:24:09 +0100
Subject: [PATCH 118/231] add deletion message to index

---
 app/views/static/index.html.haml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml
index 412679e1..d30dd3fd 100644
--- a/app/views/static/index.html.haml
+++ b/app/views/static/index.html.haml
@@ -5,7 +5,9 @@
       = render 'shared/sidebar'
     .col-md-9.col-xs-12.col-sm-9.j2-col-reset
       = render 'layouts/messages'
-      .alert.alert-danger
+      .alert.alert-danger.alert-dismissible{role: "alert"}
+        %button.close{type: "button", "data-dismiss" => "alert"}
+          %span{"aria-hidden" => "true"} ×
         %strong
           Retrospring will shut down
         on 1.4.2015!

From 09b30506fdbad3fdbadbc1ff66c8c66f2e7e6c6c Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Fri, 27 Mar 2015 13:25:50 +0100
Subject: [PATCH 119/231] add deletion message to index

---
 app/views/static/index.html.haml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml
index d30dd3fd..bee582eb 100644
--- a/app/views/static/index.html.haml
+++ b/app/views/static/index.html.haml
@@ -8,9 +8,7 @@
       .alert.alert-danger.alert-dismissible{role: "alert"}
         %button.close{type: "button", "data-dismiss" => "alert"}
           %span{"aria-hidden" => "true"} ×
-        %strong
-          Retrospring will shut down
-        on 1.4.2015!
+        Retrospring will shut down on 1st April 2015!
       #timeline
         - @timeline.each do |answer|
           = render 'shared/answerbox', a: answer

From 4035ae4c7f6cb37f4df0abc02366d2adf07eb607 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Fri, 27 Mar 2015 16:51:04 +0100
Subject: [PATCH 120/231] added export rake task

---
 Rakefile | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)

diff --git a/Rakefile b/Rakefile
index cce9964f..9bda58b7 100644
--- a/Rakefile
+++ b/Rakefile
@@ -264,4 +264,118 @@ namespace :justask do
       print "\033[0m"
     end
   end
+
+  desc "Export data for an user"
+  task :export, [:email] => :environment do |t, args|
+    require 'json'
+    require 'yaml'
+    return if args[:email].nil?
+    obj = {}
+    format = '%t (%c/%C) [%b>%i] %e'
+    u = User.where("LOWER(email) = ?", args[:email].downcase).first!
+    export_dirname = "export_#{u.screen_name}_#{Time.now.to_i}"
+    export_filename = u.screen_name
+
+    %i(id screen_name display_name created_at sign_in_count last_sign_in_at friend_count follower_count asked_count answered_count commented_count smiled_count motivation_header bio website location moderator admin supporter banned blogger).each do |f|
+      obj[f] = u.send f
+    end
+
+    total = u.questions.count
+    progress = ProgressBar.create title: 'Processing questions', format: format, starting_at: 0, total: total
+    obj[:questions] = []
+    u.questions.each do |q|
+      qobj = {}
+      %i(id content author_is_anonymous created_at answer_count).each do |f|
+        qobj[f] = q.send f
+      end
+      obj[:questions] << qobj
+      progress.increment
+    end
+
+    total = u.answers.count
+    progress = ProgressBar.create title: 'Processing answers', format: format, starting_at: 0, total: total
+    obj[:answers] = []
+    u.answers.each do |a|
+      aobj = {}
+      %i(id content comment_count smile_count created_at).each do |f|
+        aobj[f] = a.send f
+      end
+      aobj[:question] = {}
+      %i(id content author_is_anonymous created_at answer_count).each do |f|
+        aobj[:question][f] = a.question.send f
+      end
+      aobj[:question][:user] = a.question.user.screen_name unless a.question.author_is_anonymous
+      aobj[:comments] = []
+      a.comments.each do |c|
+        cobj = {}
+        %i(id content created_at).each do |f|
+          cobj[f] = c.send f
+        end
+        cobj[:user] = c.user.screen_name
+        aobj[:comments] << cobj
+      end
+      obj[:answers] << aobj
+      progress.increment
+    end
+
+    total = u.comments.count
+    progress = ProgressBar.create title: 'Processing comments', format: format, starting_at: 0, total: total
+    obj[:comments] = []
+    u.comments.each do |c|
+      cobj = {}
+      %i(id content created_at).each do |f|
+        cobj[f] = c.send f
+      end
+      cobj[:answer] = {}
+      %i(id content comment_count smile_count created_at).each do |f|
+        cobj[:answer][f] = c.answer.send f
+      end
+      cobj[:answer][:question] = {}
+      %i(id content author_is_anonymous created_at answer_count).each do |f|
+        cobj[:answer][:question][f] = c.answer.question.send f
+      end
+      cobj[:answer][:question][:user] = c.answer.question.user.screen_name unless c.answer.question.author_is_anonymous
+      obj[:comments] << cobj
+      progress.increment
+    end
+
+    total = u.smiles.count
+    progress = ProgressBar.create title: 'Processing smiles', format: format, starting_at: 0, total: total
+    obj[:smiles] = []
+    u.smiles.each do |s|
+      sobj = {}
+      %i(id created_at).each do |f|
+        sobj[f] = s.send f
+      end
+
+      sobj[:answer] = {}
+      %i(id content comment_count smile_count created_at).each do |f|
+        sobj[:answer][f] = s.answer.send f
+      end
+      sobj[:answer][:question] = {}
+      %i(id content author_is_anonymous created_at answer_count).each do |f|
+        sobj[:answer][:question][f] = s.answer.question.send f
+      end
+      sobj[:answer][:question][:user] = s.answer.question.user.screen_name unless s.answer.question.author_is_anonymous
+
+      obj[:smiles] << sobj
+      progress.increment
+    end
+
+    `mkdir -p /usr/home/justask/justask/public/export`
+    `mkdir -p /tmp/rs_export/#{export_dirname}/picture`
+    if u.profile_picture
+      %i(large medium small original).each do |s|
+        `cp #{u.profile_picture.path s} /tmp/rs_export/#{export_dirname}/picture/#{s}_#{File.basename u.profile_picture.path}`
+      end
+    end
+    File.open "/tmp/rs_export/#{export_dirname}/#{export_filename}.json", 'w' do |f|
+      f.puts obj.to_json
+    end
+    File.open "/tmp/rs_export/#{export_dirname}/#{export_filename}.yml", 'w' do |f|
+      f.puts obj.to_yaml
+    end
+    `tar czvf public/export/#{export_dirname}.tar.gz -C /tmp/rs_export #{export_dirname}`
+    puts "\033[1mhttps://retrospring.net/export/#{export_dirname}.tar.gz\033[0m"
+  end
 end

From 242bc965567ac1e11d27854381ccbdebc85447a6 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Fri, 27 Mar 2015 18:06:30 +0100
Subject: [PATCH 121/231] update Rakefile

---
 Rakefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Rakefile b/Rakefile
index 9bda58b7..61aa95b2 100644
--- a/Rakefile
+++ b/Rakefile
@@ -366,7 +366,8 @@ namespace :justask do
     `mkdir -p /tmp/rs_export/#{export_dirname}/picture`
     if u.profile_picture
       %i(large medium small original).each do |s|
-        `cp #{u.profile_picture.path s} /tmp/rs_export/#{export_dirname}/picture/#{s}_#{File.basename u.profile_picture.path}`
+        x = u.profile_picture.path(s).gsub('"', '\\"')
+        `cp "#{x}" "/tmp/rs_export/#{export_dirname}/picture/#{s}_#{File.basename x}"`
       end
     end
     File.open "/tmp/rs_export/#{export_dirname}/#{export_filename}.json", 'w' do |f|

From adee82bdf1350d1ed9f817b92b103c2c02d4f871 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Fri, 27 Mar 2015 23:10:57 +0100
Subject: [PATCH 122/231] le instant troll mode activated

---
 app/views/static/index.html.haml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml
index bee582eb..98982c4a 100644
--- a/app/views/static/index.html.haml
+++ b/app/views/static/index.html.haml
@@ -8,7 +8,7 @@
       .alert.alert-danger.alert-dismissible{role: "alert"}
         %button.close{type: "button", "data-dismiss" => "alert"}
           %span{"aria-hidden" => "true"} ×
-        Retrospring will shut down on 1st April 2015!
+        Retrospring will shut down on 31st March 2015!
       #timeline
         - @timeline.each do |answer|
           = render 'shared/answerbox', a: answer

From 4857c47b9ea00b6aa3b8dcf8109ce79d1bd627a9 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Mon, 30 Mar 2015 09:36:10 +0200
Subject: [PATCH 123/231] update README

---
 README.md | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 9e20f73d..91973dec 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# justask [![build status](https://ci.rrerr.net/projects/9/status.png?ref=master)](https://ci.rrerr.net/projects/9?ref=master)
+# justask
 
 ## Requirements
 
-- UNIX-like system (Linux, *BSD, ...)
+- UNIX-like system (Linux, FreeBSD, ...)
 - Ruby 2.0.0+
 - Bundler
 - PostgreSQL
@@ -90,4 +90,8 @@ Add/remove moderators:
 Add/remove supporters:
 
     $ bundle exec rake 'justask:sup[someone_else]' RAILS_ENV=production
-    $ bundle exec rake 'justask:desup[someone_else]' RAILS_ENV=production
\ No newline at end of file
+    $ bundle exec rake 'justask:desup[someone_else]' RAILS_ENV=production
+
+Export user data:
+
+    $ bundle exec rake 'justask:export[jdoe@example.tld]' RAILS_ENV=production

From 64405b32ff25bf04ca93c67738a68f33d2c281a6 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:12:01 +0200
Subject: [PATCH 124/231] added nginx configuration, ASS runscript

---
 docs/ass.rb     | 33 +++++++++++++++++++++++
 docs/nginx.conf | 71 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+)
 create mode 100644 docs/ass.rb
 create mode 100644 docs/nginx.conf

diff --git a/docs/ass.rb b/docs/ass.rb
new file mode 100644
index 00000000..8e2043df
--- /dev/null
+++ b/docs/ass.rb
@@ -0,0 +1,33 @@
+# This ASS runscript starts justask in development mode on a FreeBSD host.
+# (c) 2015 nilsding
+# This file is a modification of https://github.com/retrospring/ass/blob/master/scripts/example-rails.rb
+
+Runscript.new do
+  before_start do
+    # set Rails environment to development
+    setenv :RAILS_ENV, 'development'
+
+    # install bundle
+    sh %|bundle install --without production mysql|
+
+    # edit and copy example justask config
+    sh %|sed -i .old -e 's/justask.rrerr.net/justask.local/g' -e 's/"Anonymous"/"Arno Nym"/g' -e 's/enabled: tru/enabled: fals/g' ./config/justask.yml.example|
+    sh %|cp ./config/justask.yml.example ./config/justask.yml|
+
+    # edit and copy postgres database config
+    sh %|sed -i .old -e 's/_production/_producktion/g' -e 's/justask_development/ja_devel/g' -e 's/username: postgres/username: nilsding/g' ./config/database.yml.postgres|
+    sh %|cp ./config/database.yml.postgres ./config/database.yml|
+
+    # migrate the database
+    sh %|bundle exec rake db:migrate|
+  end
+
+  start do
+    sh %|bundle exec rails server -b 127.0.0.1 -p 16933|, pid: :rails, wait: false
+  end
+
+  stop do
+    unset :RAILS_ENV
+    kill :rails, with: :SIGINT
+  end
+end
diff --git a/docs/nginx.conf b/docs/nginx.conf
new file mode 100644
index 00000000..ffb72b34
--- /dev/null
+++ b/docs/nginx.conf
@@ -0,0 +1,71 @@
+# justask nginx config
+
+# Redirect www.retrospring.net to retrospring.net, because it looks nicer.
+server {
+    listen *:80;
+    listen *:443;
+    server_name www.retrospring.net;
+    return 301 $scheme://retrospring.net$request_uri;
+}
+
+
+# This is a normal HTTP host which redirects all traffic to the HTTPS host.
+server {
+    listen *:80;
+    # Replace retrospring.net with your FQDN.
+    server_name retrospring.net;
+    server_tokens off;
+    # root doesn't have to be a valid path since we are redirecting
+    root /nowhere;
+    rewrite ^ https://$server_name$request_uri permanent;
+}
+
+
+# The actual configuration.
+server {
+    # SSL settings
+    listen 443 ssl;
+
+    ssl on;
+    ssl_certificate /usr/local/etc/nginx/ssl/certs/retrospring.net/retrospring.net.pem;
+    ssl_certificate_key /usr/local/etc/nginx/ssl/certs/retrospring.net/retrospring.net.key;
+
+    # use this header only if all subdomains support HTTPS!
+    #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
+
+    ssl_session_cache  builtin:1000  shared:SSL:10m;
+
+    # forward secrecy settings
+    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
+    ssl_prefer_server_ciphers   on;
+    ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA';
+
+    # Replace retrospring.net with your FQDN
+    server_name retrospring.net;
+    server_tokens off;
+
+    # Replace /usr/home/justask/justask with the path to your justask installation
+    root /usr/home/justask/justask/public;
+    access_log /var/log/nginx/justask.log;
+
+    client_max_body_size 5M;
+    
+    error_page 404 = /404.html;
+    error_page 422 = /422.html;
+    error_page 500 = /500.html;
+    error_page 502 = /502.html;
+
+    try_files $uri @justask;
+
+    location @justask {
+        proxy_set_header  X-Real-IP  $remote_addr;
+        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header Host $http_host;
+        proxy_max_temp_file_size 0;
+        
+        # Replace /usr/home/justask/justask with the path to your justask installation
+        proxy_pass http://unix:/usr/home/justask/justask/tmp/sockets/justask.sock;
+        break;
+    }
+}
+

From 7236a8c46f2f59df29558e29b062850445346e17 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:14:54 +0200
Subject: [PATCH 125/231] updated readme

---
 README.md | 45 +++++++++++++++++++++++++++++++++++++++------
 1 file changed, 39 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 91973dec..a2294ac4 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,7 @@
-# justask
+# justask (aka. the software behind Retrospring)
+
+This is the source code that powered Retrospring.  Yep, all of it.  Including
+all the branches where we left off.
 
 ## Requirements
 
@@ -6,12 +9,26 @@
 - Ruby 2.0.0+
 - Bundler
 - PostgreSQL
-- Redis
+- Redis (for Sidekiq)
+- ImageMagick (for image processing)
 
 ## Installation (production)
 
+We've installed justask on FreeBSD 10 using rvm.  What we also did was
+creating a new, seperate user just for justask to run in.  On FreeBSD, this
+is done with:
+
+    # pw user add justask
+
 ### Database
 
+At Retrospring, we were using PostgreSQL as the database backend.  The
+software might work on MySQL too, but that was not tested.
+
+Installation from Ports (using `portmaster`):
+
+    # portmaster databases/postgresql93-server
+
 #### PostgreSQL
 
     $ sudo -u postgres psql -d template1
@@ -23,11 +40,16 @@ Try connecting to the database:
 
     $ psql -U justask -d justask_production
 
+### nginx
+
+See [docs/nginx.conf](https://github.com/nilsding/justask/blob/master/docs/nginx.conf)
+for the configuration we used on Retrospring.
+
 ### justask
 
 #### Clone the Source
 
-    $ git clone https://git.rrerr.net/nilsding/justask.git justask
+    $ git clone https://github.com/nilsding/justask.git justask
 
 #### Configure It
 
@@ -72,7 +94,7 @@ Try connecting to the database:
     # Development mode:
     $ bundle exec rails server
 
-Create an account on your justask installation.
+Now, create an account on your justask installation.
 
 To make yourself an admin, just execute:
 
@@ -82,12 +104,12 @@ If you want to remove admin status from a certain user, you can do this:
 
     $ bundle exec rake 'justask:deadmin[get_rekt]' RAILS_ENV=production
 
-Add/remove moderators:
+Add/remove moderators (this can be done via the web interface by visiting an user as an admin):
 
     $ bundle exec rake 'justask:mod[someone_else]' RAILS_ENV=production
     $ bundle exec rake 'justask:demod[someone_else]' RAILS_ENV=production
 
-Add/remove supporters:
+Add/remove supporters (this can be done via the web interface by visiting an user as an admin/mod):
 
     $ bundle exec rake 'justask:sup[someone_else]' RAILS_ENV=production
     $ bundle exec rake 'justask:desup[someone_else]' RAILS_ENV=production
@@ -95,3 +117,14 @@ Add/remove supporters:
 Export user data:
 
     $ bundle exec rake 'justask:export[jdoe@example.tld]' RAILS_ENV=production
+
+Find the user(s) with the most self-asked anonymous questions:
+
+    $ bundle exec rake justask:loners
+
+## The Official Retrospring Closedown Soundtrack™
+
+* [Scooter - Can't Stop The Hardcore](https://www.youtube.com/watch?v=nJ3bet-Y79w)
+* [Darude - Sandstorm](https://www.youtube.com/watch?v=y6120QOlsfU)
+* [Max Raabe - Oops I Did It Again](https://www.youtube.com/watch?v=qYr9kIyambE)
+

From 47cbbed7193cc1283c4c112614cccb3d925291c4 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:28:42 +0200
Subject: [PATCH 126/231] made admin listing changeable in justask.yml

---
 app/views/static/about.html.haml | 22 ++++++++--------------
 config/justask.yml.example       | 15 ++++++++++++++-
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml
index 693446d5..625d81c9 100644
--- a/app/views/static/about.html.haml
+++ b/app/views/static/about.html.haml
@@ -13,20 +13,14 @@
           = succeed '!' do
             = APP_CONFIG['site_name']
           %br/
-          .media
-            .pull-left
-              %a{href: show_user_profile_path('pixeldesu')}
-                %img.img-rounded.answerbox--img{src: User.find_by_screen_name('pixeldesu').profile_picture.url(:medium)}
-            .media-body
-              %h4.entry-text.entry-about pixeldesu
-              %h6.entry-subtext Frontend Design & Layout
-          .media
-            .pull-left
-              %a{href: show_user_profile_path('Filippus')}
-                %img.img-rounded.answerbox--img{src: User.find_by_screen_name('Filippus').profile_picture.url(:medium)}
-            .media-body
-              %h4.entry-text.entry-about Filippus
-              %h6.entry-subtext Moderator Management & Support
+          - APP_CONFIG['admins'].each do |adm|
+            .media
+              .pull-left
+                %a{href: show_user_profile_path(adm['screen_name'])}
+                  %img.img-rounded.answerbox--img{src: User.find_by_screen_name(adm['screen_name']).profile_picture.url(:medium)}
+              .media-body
+                %h4.entry-text.entry-about= adm['about_text']
+                %h6.entry-subtext= adm['subtext']
       .panel.panel-default
         .panel-body
           %h3 Moderators
diff --git a/config/justask.yml.example b/config/justask.yml.example
index b5a5cf72..2fa3321b 100644
--- a/config/justask.yml.example
+++ b/config/justask.yml.example
@@ -28,4 +28,17 @@ sharing:
     consumer_secret: ''
 
 # Redis
-redis_url: "redis://localhost:6379"
\ No newline at end of file
+redis_url: "redis://localhost:6379"
+
+# Site admins
+admins:
+  - screen_name: 'nilsding'
+    about_text: nilsding
+    subtext: Backend, Server & Code
+  - screen_name: 'pixeldesu'
+    about_text: pixeldesu
+    subtext: Frontend Design & Layout
+  - screen_name: 'Filippus'
+    about_text: Filippus
+    subtext: Moderator Management & Support
+

From c357036047f8d8a5202a1bfaf6a29768ff398f04 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:29:42 +0200
Subject: [PATCH 127/231] removed deployment-related stuff

---
 Capfile                     | 24 --------------------
 config/deploy.rb            | 31 -------------------------
 config/deploy/production.rb |  7 ------
 config/deploy/staging.rb    | 45 -------------------------------------
 4 files changed, 107 deletions(-)
 delete mode 100644 Capfile
 delete mode 100644 config/deploy.rb
 delete mode 100644 config/deploy/production.rb
 delete mode 100644 config/deploy/staging.rb

diff --git a/Capfile b/Capfile
deleted file mode 100644
index 6e64843e..00000000
--- a/Capfile
+++ /dev/null
@@ -1,24 +0,0 @@
-# Load DSL and set up stages
-require 'capistrano/setup'
-
-# Include default deployment tasks
-require 'capistrano/deploy'
-
-# Include tasks from other gems included in your Gemfile
-#
-# For documentation on these, see for example:
-#
-#   https://github.com/capistrano/rvm
-#   https://github.com/capistrano/rbenv
-#   https://github.com/capistrano/chruby
-#   https://github.com/capistrano/bundler
-#   https://github.com/capistrano/rails
-#   https://github.com/capistrano/passenger
-#
-require 'capistrano/rvm'
-require 'capistrano/bundler'
-require 'capistrano/rails'
-require 'capistrano/console'
-
-# Load custom tasks from `lib/capistrano/tasks' if you have any defined
-Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
diff --git a/config/deploy.rb b/config/deploy.rb
deleted file mode 100644
index 01f44e6d..00000000
--- a/config/deploy.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# config valid only for current version of Capistrano
-lock '3.3.5'
-
-set :application, 'justask'
-set :repo_url, 'git@git.rrerr.net:justask/justask.git'
-ask :branch, :master
-set :deploy_to, '/home/justask/cap/'
-set :scm, :git
-set :format, :pretty
-set :log_level, :debug
-
-# RVM
-set :rvm_type, :user
-set :rvm_ruby_version, '2.0.0'
-
-# Rails
-set :conditionally_migrate, true
-
-namespace :deploy do
-
-  after :updated do
-
-  end
-
-  after :restart, :clear_cache do
-    on roles(:web), in: :groups, limit: 3, wait: 10 do
-
-    end
-  end
-
-end
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
deleted file mode 100644
index d79adf18..00000000
--- a/config/deploy/production.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-server 'rrerr.net', user: 'justask', roles: %w{web app}
-
-set :ssh_options, {
-  keys: %w(~/.ssh/id_rsa),
-  forward_agent: false,
-  auth_methods: %w(publickey)
-}
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb
deleted file mode 100644
index e664a6cd..00000000
--- a/config/deploy/staging.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# Simple Role Syntax
-# ==================
-# Supports bulk-adding hosts to roles, the primary server in each group
-# is considered to be the first unless any hosts have the primary
-# property set.  Don't declare `role :all`, it's a meta role.
-
-role :app, %w{deploy@example.com}
-role :web, %w{deploy@example.com}
-role :db,  %w{deploy@example.com}
-
-
-# Extended Server Syntax
-# ======================
-# This can be used to drop a more detailed server definition into the
-# server list. The second argument is a, or duck-types, Hash and is
-# used to set extended properties on the server.
-
-server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
-
-
-# Custom SSH Options
-# ==================
-# You may pass any option but keep in mind that net/ssh understands a
-# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
-#
-# Global options
-# --------------
-#  set :ssh_options, {
-#    keys: %w(/home/rlisowski/.ssh/id_rsa),
-#    forward_agent: false,
-#    auth_methods: %w(password)
-#  }
-#
-# And/or per server (overrides global)
-# ------------------------------------
-# server 'example.com',
-#   user: 'user_name',
-#   roles: %w{web app},
-#   ssh_options: {
-#     user: 'user_name', # overrides user setting above
-#     keys: %w(/home/user_name/.ssh/id_rsa),
-#     forward_agent: false,
-#     auth_methods: %w(publickey password)
-#     # password: 'please use keys'
-#   }

From 434e1a21bc73ef5136fd9e955505cebab632114e Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:31:09 +0200
Subject: [PATCH 128/231] removed shutdown message

---
 app/views/static/index.html.haml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/app/views/static/index.html.haml b/app/views/static/index.html.haml
index 98982c4a..3f76c635 100644
--- a/app/views/static/index.html.haml
+++ b/app/views/static/index.html.haml
@@ -5,10 +5,6 @@
       = render 'shared/sidebar'
     .col-md-9.col-xs-12.col-sm-9.j2-col-reset
       = render 'layouts/messages'
-      .alert.alert-danger.alert-dismissible{role: "alert"}
-        %button.close{type: "button", "data-dismiss" => "alert"}
-          %span{"aria-hidden" => "true"} ×
-        Retrospring will shut down on 31st March 2015!
       #timeline
         - @timeline.each do |answer|
           = render 'shared/answerbox', a: answer

From 9131b29d968c91c5bd4a77ecac50e4ec696eb383 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:32:13 +0200
Subject: [PATCH 129/231] removed capistrano gem

---
 .capistrano/metrics |  1 -
 Gemfile             |  5 -----
 Gemfile.lock        | 26 --------------------------
 3 files changed, 32 deletions(-)
 delete mode 100644 .capistrano/metrics

diff --git a/.capistrano/metrics b/.capistrano/metrics
deleted file mode 100644
index 94a4335e..00000000
--- a/.capistrano/metrics
+++ /dev/null
@@ -1 +0,0 @@
-full
\ No newline at end of file
diff --git a/Gemfile b/Gemfile
index c34fdbaa..752f53f1 100644
--- a/Gemfile
+++ b/Gemfile
@@ -60,11 +60,6 @@ gem 'redis'
 
 group :development do
   gem 'spring'
-
-  # Capistrano for deployment
-  gem 'capistrano', '~> 3.1'
-  gem 'capistrano-rvm', group: :rvm
-  gem 'capistrano-rails', '~> 1.1'
 end
 
 group :production do
diff --git a/Gemfile.lock b/Gemfile.lock
index 50d396ef..2824f547 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -44,21 +44,6 @@ GEM
       railties (>= 3.1)
     buftok (0.2.0)
     builder (3.2.2)
-    capistrano (3.3.5)
-      capistrano-stats (~> 1.1.0)
-      i18n
-      rake (>= 10.0.0)
-      sshkit (~> 1.3)
-    capistrano-bundler (1.1.3)
-      capistrano (~> 3.1)
-      sshkit (~> 1.2)
-    capistrano-rails (1.1.2)
-      capistrano (~> 3.1)
-      capistrano-bundler (~> 1.1)
-    capistrano-rvm (0.1.2)
-      capistrano (~> 3.0)
-      sshkit (~> 1.2)
-    capistrano-stats (1.1.1)
     capybara (2.4.4)
       mime-types (>= 1.16)
       nokogiri (>= 1.3.3)
@@ -79,7 +64,6 @@ GEM
       coffee-script-source
       execjs
     coffee-script-source (1.8.0)
-    colorize (0.7.5)
     connection_pool (2.1.0)
     crass (1.0.1)
     daemons (1.1.9)
@@ -158,9 +142,6 @@ GEM
     mysql2 (0.3.17)
     naught (1.0.0)
     nested_form (0.3.2)
-    net-scp (1.2.1)
-      net-ssh (>= 2.6.5)
-    net-ssh (2.9.1)
     nokogiri (1.6.5)
       mini_portile (~> 0.6.0)
     nokogumbo (1.2.0)
@@ -303,10 +284,6 @@ GEM
       actionpack (>= 3.0)
       activesupport (>= 3.0)
       sprockets (>= 2.8, < 4.0)
-    sshkit (1.6.1)
-      colorize (>= 0.7.0)
-      net-scp (>= 1.1.2)
-      net-ssh (>= 2.8.0)
     sweetalert-rails (0.3.3)
       railties (>= 3.1.0)
     thin (1.6.3)
@@ -364,9 +341,6 @@ DEPENDENCIES
   bootstrap-sass (~> 3.2.0.1)
   bootstrap_form
   bootswatch-rails
-  capistrano (~> 3.1)
-  capistrano-rails (~> 1.1)
-  capistrano-rvm
   capybara
   coffee-rails (~> 4.1.0)
   database_cleaner

From 296308402f2b96ee5b395cc11830aa1d08c976bf Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:35:55 +0200
Subject: [PATCH 130/231] update README

---
 README.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/README.md b/README.md
index a2294ac4..8ad42bac 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,12 @@
 This is the source code that powered Retrospring.  Yep, all of it.  Including
 all the branches where we left off.
 
+
+
 ## Requirements
 
 - UNIX-like system (Linux, FreeBSD, ...)

From 7c64b771c2e2a4c7d3751ead0f1a3c17fecf797d Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Fri, 1 Aug 2014 11:50:37 +0200
Subject: [PATCH 131/231] added license (AGPLv3)

---
 LICENSE | 662 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 662 insertions(+)
 create mode 100644 LICENSE

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..a871fcfd
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,662 @@
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU Affero General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    
+    Copyright (C)   
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
+

From 24c7cd49b982cd0ee679c1a25c3b39d449f56880 Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:39:55 +0200
Subject: [PATCH 132/231] update README

---
 README.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.md b/README.md
index 8ad42bac..26a53b1a 100644
--- a/README.md
+++ b/README.md
@@ -134,3 +134,6 @@ Find the user(s) with the most self-asked anonymous questions:
 * [Darude - Sandstorm](https://www.youtube.com/watch?v=y6120QOlsfU)
 * [Max Raabe - Oops I Did It Again](https://www.youtube.com/watch?v=qYr9kIyambE)
 
+## License
+
+AGPLv3.  

From 337bf93bb730df6c7350020c19005527abf9524e Mon Sep 17 00:00:00 2001
From: nilsding 
Date: Thu, 2 Apr 2015 01:47:21 +0200
Subject: [PATCH 133/231] update TODO, lel.

---
 TODO | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/TODO b/TODO
index d3161e88..f9c7619f 100644
--- a/TODO
+++ b/TODO
@@ -2,10 +2,8 @@ Not done:
 [001|  0%] user blocking (prohibits blocked user from asking question to that person and seeing their answers)
 [007|  0%] (?) keyboard shortcuts
 [010|  0%] locales (these can wait for now)
-[012|  0%] (?) open source the entire thing – in late 2015 or 2016 maybe, after we got bought by fakelook.
 [015|  0%] make a public accessible API (maybe even as an oauth provider?)
 [016|  5%] WRYYYYte more specs
-[017| 50%] write "terms of service" and a privacy policy.
 [018|  0%] that annoying "we use cookies" thing every website in the EU must? add
 [020|  0%] helper function for profile headings to resize on certain string length
 [022|  0%] recommended follows
@@ -34,3 +32,5 @@ Finished:
 [019|100%] omniAuth (twatter, fakelook, goggles plus) for social networking elitists
 [021|100%] deleting comments
     |----- restructure comment design
+[012|100%] (?) open source the entire thing – in late 2015 or 2016 maybe, after we got bought by fakelook.
+[017|100%] write "terms of service" and a privacy policy.

From e023987398aec3769fbbfcc80aa5b13ebad89db6 Mon Sep 17 00:00:00 2001
From: "Andreas N." 
Date: Thu, 2 Apr 2015 02:07:17 +0200
Subject: [PATCH 134/231] Update TODO

---
 TODO | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/TODO b/TODO
index f9c7619f..42ab8b31 100644
--- a/TODO
+++ b/TODO
@@ -1,10 +1,11 @@
 Not done:
 [001|  0%] user blocking (prohibits blocked user from asking question to that person and seeing their answers)
-[007|  0%] (?) keyboard shortcuts
+[007| 20%] (?) keyboard shortcuts
+    |----- Open "Ask your followers" with Ctrl/Meta+M
 [010|  0%] locales (these can wait for now)
+    |----- (somewhat) working in justask/feature-semantic
 [015|  0%] make a public accessible API (maybe even as an oauth provider?)
 [016|  5%] WRYYYYte more specs
-[018|  0%] that annoying "we use cookies" thing every website in the EU must? add
 [020|  0%] helper function for profile headings to resize on certain string length
 [022|  0%] recommended follows
 [023|  0%] disabling group-questions
@@ -29,6 +30,7 @@ Finished:
 [009|100%] a notification view or something
 [013|100%] restructure questions (has_many :answers) for less redundancy in the DB when implementing #002
 [014|100%] generate questions if there are none in the inbox (probably make it as a gem)
+[018|100%] that annoying "we use cookies" thing every website in the EU must? add
 [019|100%] omniAuth (twatter, fakelook, goggles plus) for social networking elitists
 [021|100%] deleting comments
     |----- restructure comment design

From 865bbbd6b95d9788336faae8385c66147f12b5bb Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Sat, 18 Apr 2015 21:08:20 +0200
Subject: [PATCH 135/231] add Github link to footer

---
 app/views/shared/_links.html.haml | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/app/views/shared/_links.html.haml b/app/views/shared/_links.html.haml
index 1c507e92..f2910364 100644
--- a/app/views/shared/_links.html.haml
+++ b/app/views/shared/_links.html.haml
@@ -5,10 +5,7 @@
   ·
   = link_to "About", about_path
   ·
-  = link_to "Bugs", 'https://github.com/retrospring/bugs/issues'
-  ·
-  / Tyler wanted this so much, here it is!
-  = link_to "Blog", 'https://blog.retrospring.net'
+  = link_to "Github", 'https://github.com/retrospring/retrospring'
   ·
   = link_to "Terms of Service", terms_path
   ·

From 723d72c5874216f20fa0a8f32aa16d6b96e70459 Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Sat, 18 Apr 2015 21:11:18 +0200
Subject: [PATCH 136/231] update about page

---
 app/views/static/about.html.haml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml
index 625d81c9..555aff0a 100644
--- a/app/views/static/about.html.haml
+++ b/app/views/static/about.html.haml
@@ -34,11 +34,13 @@
     .col-sm-4
       .panel.panel-default
         .panel-body
-          %h3 Alpha version
-          %p This is an alpha version, full of bugs.  Caveat emptor.
+          %h3 Unfinished
+          %p Retrospring is running on unfinished code, full of bugs. Caveat emptor.
           %p
-            Found a bug?  Have an idea for a must-have feature?  Please
-            = link_to "report them!", 'https://github.com/retrospring/bugs/issues'
+            Want to contribute? If you are a Ruby developer, CoffeeScript coder or frontend designer, you can now help
+            = APP_CONFIG['site_name']
+            to get the features everyone wanted! If you are not, you can still report bugs at our 
+            = link_to "Github repository!", 'https://github.com/retrospring/retrospring'
 
           %p
             Still have some questions? Check our

From d46a6ecb38f479b09f013280b0ea5eab708ddff4 Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Sat, 18 Apr 2015 21:21:45 +0200
Subject: [PATCH 137/231] update about page

---
 app/views/static/about.html.haml | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml
index 555aff0a..4dbc5c4a 100644
--- a/app/views/static/about.html.haml
+++ b/app/views/static/about.html.haml
@@ -70,21 +70,9 @@
     .col-sm-4
       .panel.panel-default
         .panel-body
-          %h3 Donate
-          We are not backed by any company, but we need some money to keep
-          our server infrastructure running.
-
-          %form{:action => "https://www.paypal.com/cgi-bin/webscr", :method => "post", :target => "_top"}
-            %input{:name => "cmd", :type => "hidden", :value => "_s-xclick"}/
-            %input{:name => "hosted_button_id", :type => "hidden", :value => "6ZT5MS6UGU6HC"}/
-            %input{:alt => "PayPal - The safer, easier way to pay online!", :border => "0", :name => "submit", :src => "https://www.paypalobjects.com/en_US/AT/i/btn/btn_donateCC_LG.gif", :type => "image"}/
-            %img{:alt => "", :border => "0", :height => "1", :src => "https://www.paypalobjects.com/de_DE/i/scr/pixel.gif", :width => "1"}/
-
-          Want to support us over a longer timespan? We also have a Patreon campaign!
-          %a.btn.btn-primary.btn-block{href: "https://patreon.com/retrospring"} Patreon
-      .panel.panel-default
-        .panel-body
-          %h3 Patrons
+          %h3 Funding
+          Currently Retrospring is running of the developers funds and will be able to sustain at the current needs of servers. Hereby 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.
+          %h3 Supporter
           People that believe in our vision, and that's why we love them <3
           %ul.about--moderator
             - User.where(supporter: true).each do |sup|

From af170671ec67afd374376a653978b4484e016be5 Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sat, 18 Apr 2015 21:50:08 +0200
Subject: [PATCH 138/231] update gems

---
 Gemfile      |   2 +-
 Gemfile.lock | 221 ++++++++++++++++++++++++++++-----------------------
 2 files changed, 123 insertions(+), 100 deletions(-)

diff --git a/Gemfile b/Gemfile
index 752f53f1..da648c94 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,7 @@
 source 'https://rubygems.org'
 source 'https://rails-assets.org'
 
-gem 'rails', '4.1.8'
+gem 'rails', '4.2.1'
 
 gem 'pg', group: :postgres
 gem 'mysql2', group: :mysql
diff --git a/Gemfile.lock b/Gemfile.lock
index 2824f547..0ccea24c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
 GIT
   remote: https://github.com/retrospring/questiongenerator.git
-  revision: 326d82728a96ff58bad4516c46f9abba06ba31df
+  revision: 902de3d7f930a4f67bbbbc414cc3556cc7114839
   specs:
     questiongenerator (0.1.0)
 
@@ -8,38 +8,47 @@ GEM
   remote: https://rubygems.org/
   remote: https://rails-assets.org/
   specs:
-    actionmailer (4.1.8)
-      actionpack (= 4.1.8)
-      actionview (= 4.1.8)
+    actionmailer (4.2.1)
+      actionpack (= 4.2.1)
+      actionview (= 4.2.1)
+      activejob (= 4.2.1)
       mail (~> 2.5, >= 2.5.4)
-    actionpack (4.1.8)
-      actionview (= 4.1.8)
-      activesupport (= 4.1.8)
-      rack (~> 1.5.2)
+      rails-dom-testing (~> 1.0, >= 1.0.5)
+    actionpack (4.2.1)
+      actionview (= 4.2.1)
+      activesupport (= 4.2.1)
+      rack (~> 1.6)
       rack-test (~> 0.6.2)
-    actionview (4.1.8)
-      activesupport (= 4.1.8)
+      rails-dom-testing (~> 1.0, >= 1.0.5)
+      rails-html-sanitizer (~> 1.0, >= 1.0.1)
+    actionview (4.2.1)
+      activesupport (= 4.2.1)
       builder (~> 3.1)
       erubis (~> 2.7.0)
-    activemodel (4.1.8)
-      activesupport (= 4.1.8)
+      rails-dom-testing (~> 1.0, >= 1.0.5)
+      rails-html-sanitizer (~> 1.0, >= 1.0.1)
+    activejob (4.2.1)
+      activesupport (= 4.2.1)
+      globalid (>= 0.3.0)
+    activemodel (4.2.1)
+      activesupport (= 4.2.1)
       builder (~> 3.1)
-    activerecord (4.1.8)
-      activemodel (= 4.1.8)
-      activesupport (= 4.1.8)
-      arel (~> 5.0.0)
-    activesupport (4.1.8)
-      i18n (~> 0.6, >= 0.6.9)
+    activerecord (4.2.1)
+      activemodel (= 4.2.1)
+      activesupport (= 4.2.1)
+      arel (~> 6.0)
+    activesupport (4.2.1)
+      i18n (~> 0.7)
       json (~> 1.7, >= 1.7.7)
       minitest (~> 5.1)
-      thread_safe (~> 0.1)
+      thread_safe (~> 0.3, >= 0.3.4)
       tzinfo (~> 1.1)
-    addressable (2.3.6)
-    arel (5.0.1.20140414130214)
-    bcrypt (3.1.9)
+    addressable (2.3.8)
+    arel (6.0.0)
+    bcrypt (3.1.10)
     bootstrap-sass (3.2.0.2)
       sass (~> 3.2)
-    bootstrap_form (2.2.0)
+    bootstrap_form (2.3.0)
     bootswatch-rails (3.2.4)
       railties (>= 3.1)
     buftok (0.2.0)
@@ -55,20 +64,20 @@ GEM
     climate_control (0.0.3)
       activesupport (>= 3.0)
     cliver (0.3.2)
-    cocaine (0.5.5)
+    cocaine (0.5.7)
       climate_control (>= 0.0.3, < 1.0)
     coffee-rails (4.1.0)
       coffee-script (>= 2.2.0)
       railties (>= 4.0.0, < 5.0)
-    coffee-script (2.3.0)
+    coffee-script (2.4.1)
       coffee-script-source
       execjs
-    coffee-script-source (1.8.0)
-    connection_pool (2.1.0)
-    crass (1.0.1)
-    daemons (1.1.9)
-    database_cleaner (1.3.0)
-    delayed_paperclip (2.9.0)
+    coffee-script-source (1.9.1.1)
+    connection_pool (2.2.0)
+    crass (1.0.2)
+    daemons (1.2.2)
+    database_cleaner (1.4.1)
+    delayed_paperclip (2.9.1)
       paperclip (>= 3.3)
     devise (3.4.1)
       bcrypt (~> 3.0)
@@ -81,11 +90,10 @@ GEM
       devise (~> 3.2)
     diff-lcs (1.2.5)
     docile (1.1.5)
-    dotenv (1.0.2)
-    equalizer (0.0.9)
+    equalizer (0.0.11)
     erubis (2.7.0)
-    eventmachine (1.0.3)
-    execjs (2.2.2)
+    eventmachine (1.0.7)
+    execjs (2.5.2)
     factory_girl (4.5.0)
       activesupport (>= 3.0.0)
     factory_girl_rails (4.5.0)
@@ -93,7 +101,7 @@ GEM
       railties (>= 3.0.0)
     faker (1.4.3)
       i18n (~> 0.5)
-    faraday (0.9.0)
+    faraday (0.9.1)
       multipart-post (>= 1.2, < 3)
     faraday_middleware (0.9.1)
       faraday (>= 0.7.4, < 0.10)
@@ -101,52 +109,56 @@ GEM
       railties (>= 3.2, < 5.0)
     font-kit-rails (1.1.0)
       rails
-    foreman (0.76.0)
-      dotenv (~> 1.0.2)
+    foreman (0.78.0)
       thor (~> 0.19.1)
+    globalid (0.3.5)
+      activesupport (>= 4.1.0)
     haml (4.0.6)
       tilt
-    hashie (3.3.2)
+    hashie (3.4.1)
     hike (1.2.3)
     hitimes (1.2.2)
-    http (0.6.3)
+    http (0.6.4)
       http_parser.rb (~> 0.6.0)
-    http_accept_language (2.0.2)
+    http_accept_language (2.0.5)
     http_parser.rb (0.6.0)
-    i18n (0.6.11)
-    jbuilder (2.2.5)
+    i18n (0.7.0)
+    jbuilder (2.2.13)
       activesupport (>= 3.0.0, < 5)
       multi_json (~> 1.2)
-    jquery-rails (3.1.2)
-      railties (>= 3.0, < 5.0)
+    jquery-rails (4.0.3)
+      rails-dom-testing (~> 1.0)
+      railties (>= 4.2.0)
       thor (>= 0.14, < 2.0)
     jquery-turbolinks (2.1.0)
       railties (>= 3.1.0)
       turbolinks
     jquery-ui-rails (5.0.3)
       railties (>= 3.2.16)
-    json (1.8.1)
-    kaminari (0.16.1)
+    json (1.8.2)
+    kaminari (0.16.3)
       actionpack (>= 3.0.0)
       activesupport (>= 3.0.0)
-    kgio (2.9.2)
+    kgio (2.9.3)
+    loofah (2.0.1)
+      nokogiri (>= 1.5.9)
     mail (2.6.3)
       mime-types (>= 1.16, < 3)
     memoizable (0.4.2)
       thread_safe (~> 0.3, >= 0.3.1)
     mime-types (2.4.3)
-    mini_portile (0.6.1)
-    minitest (5.4.3)
-    multi_json (1.10.1)
+    mini_portile (0.6.2)
+    minitest (5.6.0)
+    multi_json (1.11.0)
     multipart-post (2.0.0)
-    mysql2 (0.3.17)
+    mysql2 (0.3.18)
     naught (1.0.0)
     nested_form (0.3.2)
-    nokogiri (1.6.5)
+    nokogiri (1.6.6.2)
       mini_portile (~> 0.6.0)
     nokogumbo (1.2.0)
       nokogiri
-    nprogress-rails (0.1.6.3)
+    nprogress-rails (0.1.6.6)
     oauth (0.4.7)
     omniauth (1.2.2)
       hashie (>= 1.2, < 4)
@@ -165,39 +177,48 @@ GEM
       activesupport (>= 3.0.0)
       cocaine (~> 0.5.3)
       mime-types
-    pg (0.17.1)
-    poltergeist (1.5.1)
+    pg (0.18.1)
+    poltergeist (1.6.0)
       capybara (~> 2.1)
       cliver (~> 0.3.1)
       multi_json (~> 1.0)
       websocket-driver (>= 0.2.0)
-    rack (1.5.2)
+    rack (1.6.0)
     rack-pjax (0.8.0)
       nokogiri (~> 1.5)
       rack (~> 1.1)
     rack-protection (1.5.3)
       rack
-    rack-test (0.6.2)
+    rack-test (0.6.3)
       rack (>= 1.0)
-    rails (4.1.8)
-      actionmailer (= 4.1.8)
-      actionpack (= 4.1.8)
-      actionview (= 4.1.8)
-      activemodel (= 4.1.8)
-      activerecord (= 4.1.8)
-      activesupport (= 4.1.8)
+    rails (4.2.1)
+      actionmailer (= 4.2.1)
+      actionpack (= 4.2.1)
+      actionview (= 4.2.1)
+      activejob (= 4.2.1)
+      activemodel (= 4.2.1)
+      activerecord (= 4.2.1)
+      activesupport (= 4.2.1)
       bundler (>= 1.3.0, < 2.0)
-      railties (= 4.1.8)
-      sprockets-rails (~> 2.0)
-    rails-assets-growl (1.2.4)
+      railties (= 4.2.1)
+      sprockets-rails
+    rails-assets-growl (1.2.5)
       rails-assets-jquery
-    rails-assets-jquery (2.1.1)
-    rails_admin (0.6.5)
+    rails-assets-jquery (2.1.3)
+    rails-deprecated_sanitizer (1.0.3)
+      activesupport (>= 4.2.0.alpha)
+    rails-dom-testing (1.0.6)
+      activesupport (>= 4.2.0.beta, < 5.0)
+      nokogiri (~> 1.6.0)
+      rails-deprecated_sanitizer (>= 1.0.1)
+    rails-html-sanitizer (1.0.2)
+      loofah (~> 2.0)
+    rails_admin (0.6.7)
       builder (~> 3.1)
       coffee-rails (~> 4.0)
       font-awesome-rails (>= 3.0, < 5)
       haml (~> 4.0)
-      jquery-rails (~> 3.0)
+      jquery-rails (>= 3.0, < 5)
       jquery-ui-rails (~> 5.0)
       kaminari (~> 0.14)
       nested_form (~> 0.3)
@@ -205,23 +226,23 @@ GEM
       rails (~> 4.0)
       remotipart (~> 1.0)
       safe_yaml (~> 1.0)
-      sass-rails (~> 4.0)
-    railties (4.1.8)
-      actionpack (= 4.1.8)
-      activesupport (= 4.1.8)
+      sass-rails (>= 4.0, < 6)
+    railties (4.2.1)
+      actionpack (= 4.2.1)
+      activesupport (= 4.2.1)
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
     raindrops (0.13.0)
     rake (10.4.2)
     rdoc (4.2.0)
       json (~> 1.4)
-    redcarpet (3.2.2)
-    redis (3.2.0)
-    redis-namespace (1.5.1)
+    redcarpet (3.2.3)
+    redis (3.2.1)
+    redis-namespace (1.5.2)
       redis (~> 3.0, >= 3.0.4)
     remotipart (1.2.1)
-    responders (1.1.2)
-      railties (>= 3.2, < 4.2)
+    responders (2.1.0)
+      railties (>= 4.2.0, < 5)
     rspec-core (3.0.4)
       rspec-support (~> 3.0.0)
     rspec-expectations (3.0.4)
@@ -238,9 +259,9 @@ GEM
       rspec-mocks (~> 3.0.0)
       rspec-support (~> 3.0.0)
     rspec-support (3.0.4)
-    ruby-progressbar (1.7.0)
+    ruby-progressbar (1.7.5)
     safe_yaml (1.0.4)
-    sanitize (3.1.0)
+    sanitize (3.1.2)
       crass (~> 1.0.1)
       nokogiri (>= 1.4.4)
       nokogumbo (= 1.2.0)
@@ -253,45 +274,45 @@ GEM
     sdoc (0.4.1)
       json (~> 1.7, >= 1.7.7)
       rdoc (~> 4.0)
-    sidekiq (3.3.0)
+    sidekiq (3.3.3)
       celluloid (>= 0.16.0)
-      connection_pool (>= 2.0.0)
+      connection_pool (>= 2.1.1)
       json
       redis (>= 3.0.6)
       redis-namespace (>= 1.3.1)
-    simple_oauth (0.3.0)
-    simplecov (0.9.1)
+    simple_oauth (0.3.1)
+    simplecov (0.10.0)
       docile (~> 1.1.0)
-      multi_json (~> 1.0)
-      simplecov-html (~> 0.8.0)
-    simplecov-html (0.8.0)
+      json (~> 1.8)
+      simplecov-html (~> 0.10.0)
+    simplecov-html (0.10.0)
     simplecov-json (0.2)
       json
       simplecov
     simplecov-rcov (0.2.3)
       simplecov (>= 0.4.1)
-    sinatra (1.4.5)
+    sinatra (1.4.6)
       rack (~> 1.4)
       rack-protection (~> 1.4)
-      tilt (~> 1.3, >= 1.3.4)
-    spring (1.2.0)
+      tilt (>= 1.3, < 3)
+    spring (1.3.4)
     sprockets (2.12.3)
       hike (~> 1.2)
       multi_json (~> 1.0)
       rack (~> 1.0)
       tilt (~> 1.1, != 1.3.0)
-    sprockets-rails (2.2.2)
+    sprockets-rails (2.2.4)
       actionpack (>= 3.0)
       activesupport (>= 3.0)
       sprockets (>= 2.8, < 4.0)
-    sweetalert-rails (0.3.3)
+    sweetalert-rails (0.5.0)
       railties (>= 3.1.0)
     thin (1.6.3)
       daemons (~> 1.0, >= 1.0.9)
       eventmachine (~> 1.0)
       rack (~> 1.0)
     thor (0.19.1)
-    thread_safe (0.3.4)
+    thread_safe (0.3.5)
     tilt (1.4.1)
     timers (4.0.1)
       hitimes
@@ -304,7 +325,7 @@ GEM
       simple_oauth
     turbolinks (2.5.3)
       coffee-rails
-    twitter (5.13.0)
+    twitter (5.14.0)
       addressable (~> 2.3)
       buftok (~> 0.2.0)
       equalizer (~> 0.0.9)
@@ -317,7 +338,7 @@ GEM
       simple_oauth (~> 0.3.0)
     tzinfo (1.2.2)
       thread_safe (~> 0.1)
-    uglifier (2.5.3)
+    uglifier (2.7.1)
       execjs (>= 0.3.0)
       json (>= 1.8.0)
     unicorn (4.8.3)
@@ -326,7 +347,9 @@ GEM
       raindrops (~> 0.7)
     warden (1.2.3)
       rack (>= 1.0)
-    websocket-driver (0.4.0)
+    websocket-driver (0.5.4)
+      websocket-extensions (>= 0.1.0)
+    websocket-extensions (0.1.2)
     will_paginate (3.0.7)
     will_paginate-bootstrap (1.0.1)
       will_paginate (>= 3.0.3)
@@ -366,7 +389,7 @@ DEPENDENCIES
   pg
   poltergeist
   questiongenerator!
-  rails (= 4.1.8)
+  rails (= 4.2.1)
   rails-assets-growl
   rails_admin
   redcarpet

From 77c8026e2f00b2b8efef8111d9b018d7d0d26442 Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sat, 18 Apr 2015 21:56:05 +0200
Subject: [PATCH 139/231] renamed config.serve_static_assets to
 config.serve_static_files

---
 config/environments/production.rb | 2 +-
 config/environments/test.rb       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/config/environments/production.rb b/config/environments/production.rb
index f37fd1a3..62f40aeb 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -20,7 +20,7 @@ Rails.application.configure do
   # config.action_dispatch.rack_cache = true
 
   # Disable Rails's static asset server (Apache or nginx will already do this).
-  config.serve_static_assets = false
+  config.serve_static_files = false
 
   # Compress JavaScripts and CSS.
   config.assets.js_compressor = :uglifier
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 053f5b66..0d6459df 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -13,7 +13,7 @@ Rails.application.configure do
   config.eager_load = false
 
   # Configure static asset server for tests with Cache-Control for performance.
-  config.serve_static_assets  = true
+  config.serve_static_files   = true
   config.static_cache_control = 'public, max-age=3600'
 
   # Show full error reports and disable caching.

From 71a7effa29746c899869bcd10870260ca9bb7869 Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sat, 18 Apr 2015 22:01:00 +0200
Subject: [PATCH 140/231] changed faq entry

---
 app/views/static/faq.html.haml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/views/static/faq.html.haml b/app/views/static/faq.html.haml
index 5704b81a..aba7387b 100644
--- a/app/views/static/faq.html.haml
+++ b/app/views/static/faq.html.haml
@@ -119,5 +119,8 @@
             8. Is this open-source software?
       .panel-collapse.collapse{id: "collapseNine", role: "tabpanel", aria: {labelledby: "faqNine"}}
         .panel-body
-          Currently not. We haven't decided if we want to publish the underlying software stack at some point.
+          Yep!  #{APP_CONFIG['site_name']} runs
+          = succeed ',' do
+            %a{href: 'https://github.com/nilsding/justask'} justask
+          an open source (AGPLv3) question and answer platform.
 

From e1d20db3e076bb4006514c90325d9df852ba7348 Mon Sep 17 00:00:00 2001
From: pixeldesu 
Date: Sat, 18 Apr 2015 22:06:36 +0200
Subject: [PATCH 141/231] update faq and about

---
 app/views/static/about.html.haml | 8 ++++----
 app/views/static/faq.html.haml   | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml
index 4dbc5c4a..439835cf 100644
--- a/app/views/static/about.html.haml
+++ b/app/views/static/about.html.haml
@@ -35,7 +35,9 @@
       .panel.panel-default
         .panel-body
           %h3 Unfinished
-          %p Retrospring is running on unfinished code, full of bugs. Caveat emptor.
+          %p
+            = APP_CONFIG['site_name']
+            is running on unfinished code, full of bugs. Caveat emptor.
           %p
             Want to contribute? If you are a Ruby developer, CoffeeScript coder or frontend designer, you can now help
             = APP_CONFIG['site_name']
@@ -71,9 +73,7 @@
       .panel.panel-default
         .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 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.
-          %h3 Supporter
-          People that believe in our vision, and that's why we love them <3
+          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
             - User.where(supporter: true).each do |sup|
               %a{href: show_user_profile_path(sup.screen_name), title: sup.screen_name, data: { toggle: :tooltip, placement: :top }}
diff --git a/app/views/static/faq.html.haml b/app/views/static/faq.html.haml
index aba7387b..554a4e5f 100644
--- a/app/views/static/faq.html.haml
+++ b/app/views/static/faq.html.haml
@@ -122,5 +122,7 @@
           Yep!  #{APP_CONFIG['site_name']} runs
           = succeed ',' do
             %a{href: 'https://github.com/nilsding/justask'} justask
-          an open source (AGPLv3) question and answer platform.
+          an open source (AGPLv3) question and answer platform. If you want to contribute or report bugs you find in  #{APP_CONFIG['site_name']}, please look at our 
+          = link_to "Github repository!", "https://github.com/retrospring/retrospring"
+
 

From c917f5f59d18bb72fdc4fcccb41ab14facecf45a Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sat, 18 Apr 2015 22:12:58 +0200
Subject: [PATCH 142/231] removed support

---
 app/validators/screen_name_validator.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/validators/screen_name_validator.rb b/app/validators/screen_name_validator.rb
index 9edbaa5c..4191dca4 100644
--- a/app/validators/screen_name_validator.rb
+++ b/app/validators/screen_name_validator.rb
@@ -1,5 +1,5 @@
 class ScreenNameValidator < ActiveModel::EachValidator
-  FORBIDDEN_SCREEN_NAMES = %w(justask_admin retrospring_admin admin justask retrospring support about public
+  FORBIDDEN_SCREEN_NAMES = %w(justask_admin retrospring_admin admin justask retrospring about public
                               notifications inbox sign_in sign_up sidekiq moderation moderator mod administrator
                               siteadmin site_admin help retro_spring retroospring retrosprlng niisding nllsding 
                               pixeidesu plxeldesu plxeidesu terms privacy)
@@ -9,4 +9,4 @@ class ScreenNameValidator < ActiveModel::EachValidator
       record.errors[attribute] << "Thou shalt not use this username!  Please choose another one."
     end
   end
-end
\ No newline at end of file
+end

From 87a68768c3f15b47e9aa7198f10c4305912a28c8 Mon Sep 17 00:00:00 2001
From: Yuki 
Date: Sun, 19 Apr 2015 02:45:47 +0530
Subject: [PATCH 143/231] Don't tag people in questions with twitter

---
 app/models/services/twitter.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/models/services/twitter.rb b/app/models/services/twitter.rb
index 243536c7..b27720a9 100644
--- a/app/models/services/twitter.rb
+++ b/app/models/services/twitter.rb
@@ -28,7 +28,7 @@ class Services::Twitter < Service
 
     def prepare_tweet(answer)
       # TODO: improve this.
-      question_content = twitter_markdown answer.question.content
+      question_content = twitter_markdown answer.question.content.gsub(/\@(\w+)/, '\1')
       answer_content = twitter_markdown answer.content
       answer_url = show_user_answer_url(
         id: answer.id,
@@ -39,4 +39,4 @@ class Services::Twitter < Service
       "#{question_content[0..54]}#{'…' if question_content.length > 55}" \
         " — #{answer_content[0..55]}#{'…' if answer_content.length > 56} #{answer_url}"
     end
-end
\ No newline at end of file
+end

From e48f18bf7e99bd9df00f2080cf84aec40fc8fd1e Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sat, 18 Apr 2015 23:35:08 +0200
Subject: [PATCH 144/231] remove (markdown) parsing for questions in tweets

---
 app/models/services/twitter.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/models/services/twitter.rb b/app/models/services/twitter.rb
index 243536c7..c632a8cf 100644
--- a/app/models/services/twitter.rb
+++ b/app/models/services/twitter.rb
@@ -28,7 +28,7 @@ class Services::Twitter < Service
 
     def prepare_tweet(answer)
       # TODO: improve this.
-      question_content = twitter_markdown answer.question.content
+      question_content = answer.question.content
       answer_content = twitter_markdown answer.content
       answer_url = show_user_answer_url(
         id: answer.id,
@@ -39,4 +39,4 @@ class Services::Twitter < Service
       "#{question_content[0..54]}#{'…' if question_content.length > 55}" \
         " — #{answer_content[0..55]}#{'…' if answer_content.length > 56} #{answer_url}"
     end
-end
\ No newline at end of file
+end

From 8453c4482736b52c043f1878bf61f4539a04fbd9 Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sat, 18 Apr 2015 23:39:28 +0200
Subject: [PATCH 145/231] Revert "remove (markdown) parsing for questions in
 tweets"

This reverts commit e48f18bf7e99bd9df00f2080cf84aec40fc8fd1e.
---
 app/models/services/twitter.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/models/services/twitter.rb b/app/models/services/twitter.rb
index c632a8cf..243536c7 100644
--- a/app/models/services/twitter.rb
+++ b/app/models/services/twitter.rb
@@ -28,7 +28,7 @@ class Services::Twitter < Service
 
     def prepare_tweet(answer)
       # TODO: improve this.
-      question_content = answer.question.content
+      question_content = twitter_markdown answer.question.content
       answer_content = twitter_markdown answer.content
       answer_url = show_user_answer_url(
         id: answer.id,
@@ -39,4 +39,4 @@ class Services::Twitter < Service
       "#{question_content[0..54]}#{'…' if question_content.length > 55}" \
         " — #{answer_content[0..55]}#{'…' if answer_content.length > 56} #{answer_url}"
     end
-end
+end
\ No newline at end of file

From 1032363b5ac2d303fe08c3a443bfd0239351d5f7 Mon Sep 17 00:00:00 2001
From: Howl 
Date: Sat, 18 Apr 2015 23:45:52 +0200
Subject: [PATCH 146/231] fix horrible link section in about page

---
 app/assets/stylesheets/base.css.scss | 4 ++++
 app/views/shared/_links.html.haml    | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss
index 6eb4184f..911a7c3b 100644
--- a/app/assets/stylesheets/base.css.scss
+++ b/app/assets/stylesheets/base.css.scss
@@ -120,4 +120,8 @@ body {
 #growls.default{
   top:64px;
   right:10px
+}
+
+.links {
+  padding-bottom: 10px;
 }
\ No newline at end of file
diff --git a/app/views/shared/_links.html.haml b/app/views/shared/_links.html.haml
index f2910364..2d3294a9 100644
--- a/app/views/shared/_links.html.haml
+++ b/app/views/shared/_links.html.haml
@@ -1,4 +1,4 @@
-.centre.text-muted
+.centre.text-muted.links
   ©
   = Date.today.year
   = APP_CONFIG['site_name']

From e2bfc26c75cba0f1815a3626b0181fade84d490d Mon Sep 17 00:00:00 2001
From: Yuki 
Date: Sun, 19 Apr 2015 03:47:13 +0530
Subject: [PATCH 147/231] Markdown preview through AJAX (/ajax/preview)

---
 app/controllers/ajax/question_controller.rb   | 16 ++++++++++++++++
 app/views/ajax/question/preview.json.jbuilder |  2 ++
 config/routes.rb                              |  3 ++-
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 app/views/ajax/question/preview.json.jbuilder

diff --git a/app/controllers/ajax/question_controller.rb b/app/controllers/ajax/question_controller.rb
index 68af9982..ddd0d095 100644
--- a/app/controllers/ajax/question_controller.rb
+++ b/app/controllers/ajax/question_controller.rb
@@ -46,4 +46,20 @@ class Ajax::QuestionController < ApplicationController
     @message = "Question asked successfully."
     @success = true
   end
+
+  def preview
+    params.require :md
+
+    @message = "Failed to render markdown."
+    begin
+      @markdown = markdown(params[:md], Time.new)
+      @message = "Successfully rendered markdown."
+    rescue
+      @status = :fail
+      @success = false
+      return
+    end
+    @status = :okay
+    @success = true
+  end
 end
diff --git a/app/views/ajax/question/preview.json.jbuilder b/app/views/ajax/question/preview.json.jbuilder
new file mode 100644
index 00000000..6bf01010
--- /dev/null
+++ b/app/views/ajax/question/preview.json.jbuilder
@@ -0,0 +1,2 @@
+json.partial! 'ajax/shared/status'
+json.markdown @markdown if @markdown
diff --git a/config/routes.rb b/config/routes.rb
index 1e1f1f3e..d4af3769 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -81,6 +81,7 @@ Rails.application.routes.draw do
     match '/create_group', to: 'group#create', via: :post, as: :create_group
     match '/destroy_group', to: 'group#destroy', via: :post, as: :destroy_group
     match '/group_membership', to: 'group#membership', via: :post, as: :group_membership
+    match '/preview', to: "question#preview", via: :post, as: :preview
   end
 
   match '/public', to: 'public#index', via: :get, as: :public_timeline
@@ -89,7 +90,7 @@ Rails.application.routes.draw do
   match '/notifications(/:type)', to: 'notifications#index', via: :get, as: :notifications, defaults: {type: 'all'}
 
   match '/inbox', to: 'inbox#show', via: 'get'
-  
+
   match '/user/:username(/p/:page)', to: 'user#show', via: 'get', defaults: {page: 1}
   match '/@:username(/p/:page)', to: 'user#show', via: 'get', as: :show_user_profile_alt, defaults: {page: 1}
   match '/@:username/a/:id', to: 'answer#show', via: 'get', as: :show_user_answer_alt

From 399bdf21eebcc8702859b87a7c4d0748bf087981 Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sun, 19 Apr 2015 00:42:58 +0200
Subject: [PATCH 148/231] include MarkdownHelper

---
 app/controllers/ajax/question_controller.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/controllers/ajax/question_controller.rb b/app/controllers/ajax/question_controller.rb
index 68af9982..d1da4359 100644
--- a/app/controllers/ajax/question_controller.rb
+++ b/app/controllers/ajax/question_controller.rb
@@ -1,4 +1,6 @@
 class Ajax::QuestionController < ApplicationController
+  include MarkdownHelper
+
   def create
     params.require :question
     params.require :anonymousQuestion

From 5ce34de74f50c46f1988c6240fcedf55b2579460 Mon Sep 17 00:00:00 2001
From: Georg G 
Date: Sun, 19 Apr 2015 01:24:50 +0200
Subject: [PATCH 149/231] added Rack initializer

---
 config/initializers/rack.rb | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 config/initializers/rack.rb

diff --git a/config/initializers/rack.rb b/config/initializers/rack.rb
new file mode 100644
index 00000000..554b1d85
--- /dev/null
+++ b/config/initializers/rack.rb
@@ -0,0 +1 @@
+Rack::Utils.multipart_part_limit = 0

From 74fbfd1b244ade7ba87aae6acb7792a8a543535e Mon Sep 17 00:00:00 2001
From: "Jona H." 
Date: Sun, 19 Apr 2015 14:10:15 +0200
Subject: [PATCH 150/231] poweRS

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 26a53b1a..5958cf85 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # justask (aka. the software behind Retrospring)
 
-This is the source code that powered Retrospring.  Yep, all of it.  Including
+This is the source code that powers Retrospring.  Yep, all of it.  Including
 all the branches where we left off.