code
stringlengths
0
56.1M
repo_name
stringclasses
515 values
path
stringlengths
2
147
language
stringclasses
447 values
license
stringclasses
7 values
size
int64
0
56.8M
- if a.comments.all.count == 0 = t 'views.answerbox.no_comment' - else %ul.comments - a.comments.order(:created_at).each do |comment| %li{data: { comment_id: comment.id }} %div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "shared/comment_smiles", comment: comment .media.comments--media .pull-left %img.img-rounded.answerbox--img{src: gravatar_url(comment.user)} .media-body.comments--body %h6.media-heading.answerbox--question-user = user_screen_name comment.user %span.text-muted{title: comment.created_at, data: { toggle: :tooltip, placement: :right }} = "#{time_ago_in_words(comment.created_at)} ago" .pull-right %span.hidden-xs.text-muted - unless user_signed_in? - if comment.smile_count > 0 %button.btn.btn-info.btn-sm{name: 'ab-smile-comment', disabled: true} %i.fa.fa-smile-o %span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count - if user_signed_in? - if current_user.smiled_comment? comment %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :unsmile }} %i.fa.fa-frown-o %span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count - else %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile-comment', data: { c_id: comment.id, action: :smile }} %i.fa.fa-smile-o %span{id: "ab-comment-smile-count-#{comment.id}"}= comment.smile_count .btn-group %button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} %span.caret %ul.dropdown-menu.dropdown-menu-right{role: :menu} %li %a{href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal}} %i.fa.fa-smile-o = t 'views.actions.view' - if privileged?(comment.user) or privileged?(a.user) %li.text-danger %a{href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id }} %i.fa.fa-trash-o = t 'views.actions.delete' - unless comment.user == current_user %li %a{href: '#', data: { action: 'ab-comment-report', c_id: comment.id }} %i.fa.fa-exclamation-triangle = t 'views.acions.report' .comments--content = markdown comment.content - if user_signed_in? .form-group.has-feedback{name: 'ab-comment-new-group', data: { a_id: a.id }} %input.form-control.comments--box{type: :text, placeholder: t('views.placeholder.comment'), name: 'ab-comment-new', data: {a_id: a.id }} %span.text-muted.form-control-feedback.comments--count{id: "ab-comment-charcount-#{a.id}"} 160
Sapphire/spring.moe
app/views/shared/_comments.html.haml
haml
mit
3,250
.centre.text-muted.links © = Date.today.year = APP_CONFIG['site_name'] · = link_to t('views.general.about'), about_path · = link_to "Github", 'https://github.com/retrospring/retrospring' · = link_to t('views.general.terms'), terms_path · = link_to t('views.general.privacy'), privacy_policy_path
Sapphire/spring.moe
app/views/shared/_links.html.haml
haml
mit
327
#modal-ask-followers.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-ask-followers-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= t 'views.actions.close' %h4#modal-ask-followers-label.modal-title= t 'views.modal.ask.title' .modal-body %textarea.form-control{:name => "qb-all-question", :placeholder => t('views.placeholder.question')} .modal-footer - if current_user.groups.count > 0 %label = t 'views.modal.ask.choose' %select{name: 'qb-all-rcpt', class: 'form-control', autocomplete: 'off'} %option{value: 'followers', selected: true}= t('views.general.follower').pluralize(2) %optgroup{label: t('views.group.title').pluralize(2)} - current_user.groups.each do |group| %option{value: "grp:#{group.name}"}= group.display_name %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"}= t 'views.actions.cancel' %button.btn.btn-primary{name: 'qb-all-ask', :type => "button", data: {loading_text: t('views.modal.ask.loading') }}= t 'views.actions.ask'
Sapphire/spring.moe
app/views/shared/_modal_ask_followers.html.haml
haml
mit
1,317
.panel.panel-default.questionbox{data: { id: q.id }} .panel-body .media - if type == "discover" .pull-left %a{href: show_user_profile_path(q.user.screen_name)} %img.answerbox--img{src: q.user.profile_picture.url(:medium)} .media-body - if user_signed_in? .pull-right .btn-group %button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} %span.caret %ul.dropdown-menu.dropdown-menu-right{role: :menu} - if current_user.mod? or q.user == current_user %li.text-danger %a{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: q.id }} %i.fa.fa-trash-o = t 'views.actions.delete' - unless q.user == current_user %li %a{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: q.id }} %i.fa.fa-exclamation-triangle = t 'views.actions.report' %h6.media-heading.text-muted.answerbox--question-user = raw t('views.answerbox.asked', user: user_screen_name(q.user), time: time_tooltip(q)) - if q.answer_count > 1 · %a{href: show_user_question_path(q.user.screen_name, q.id)} = pluralize(q.answer_count, t('views.general.answer')) %p.answerbox--question-text = q.content
Sapphire/spring.moe
app/views/shared/_question.html.haml
haml
mit
1,531
.panel.panel-question{class: if hidden then 'question-hidden' end, tabindex: if hidden then '-1' end, aria: { hidden: if hidden then :true end }} .container .panel-body .media.question-media - unless question.author_is_anonymous %a.pull-left{href: unless hidden then show_user_profile_path(question.user.screen_name) end} %img.img-rounded.answerbox--img{src: gravatar_url(question.user)} .media-body.question-body - if user_signed_in? .pull-right .btn-group %button.btn.btn-link.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} %span.caret - unless hidden %ul.dropdown-menu.dropdown-menu-right{role: :menu} - if current_user.mod? or question.user == current_user %li.text-danger %a{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: question.id, redirect: if question.author_is_anonymous? then "/" else show_user_questions_path(question.user.screen_name) end }} %i.fa.fa-trash-o = t 'views.actions.delete' - unless question.user == current_user %li %a{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: question.id }} %i.fa.fa-exclamation-triangle = t 'views.actions.report' %h6.text-muted.media-heading.answerbox--question-user - if hidden = user_screen_name question.user, question.author_is_anonymous, false - else = raw t('views.answerbox.asked', user: user_screen_name(question.user, question.author_is_anonymous), time: time_tooltip(question)) %p.answerbox--question-text= question.content
Sapphire/spring.moe
app/views/shared/_question_header.haml
haml
mit
1,926
.panel.panel-default .panel-heading %h3.panel-title - if @user.motivation_header.blank? = t 'views.questionbox.title' - else = @user.motivation_header .panel-body - if @user.banned? .row .col-xs-12.text-center %strong= t 'views.questionbox.banned' - else - if user_signed_in? or @user.privacy_allow_anonymous_questions? #question-box .row .col-xs-12 %textarea.form-control{:name => "qb-question", :placeholder => t('views.placeholder.question')} .row{:style => "padding-top: 5px; padding-left: 5px; padding-right: 5px;"} .col-xs-6 - if user_signed_in? - if @user.privacy_allow_anonymous_questions? %input{:name => "qb-anonymous", :type => "checkbox"}/ = t 'views.actions.anonymous' %br/ - else %input{:name => "qb-anonymous", :type => "hidden", :value => "false"}/ .col-xs-6 %p.pull-right %input{name: 'qb-to', type: 'hidden', :value => @user.id}/ %button.btn.btn-primary{name: 'qb-ask', :type => "button", data: {loading_text: t('views.questionbox.load'), promote: user_signed_in? ? "false" : "true" }} Ask - unless user_signed_in? - if @user.privacy_allow_anonymous_questions? #question-box-promote.row{:style => "display: none;"} .row .col-xs-12.text-center %strong= t 'views.questionbox.promote.message' .row .col-sm-1 .col-sm-5 %button#create-account.btn.btn-block.btn-primary= t 'views.questionbox.promote.create' .col-sm-5 %button#new-question.btn.btn-block.btn-default= t 'views.questionbox.promote.another' .col-sm-1 .row .col-sm-1 .col-xs-12.col-sm-10.text-center %small= t('views.questionbox.promote.join', app_title: APP_CONFIG['site_name']) .col-sm-1 - else %p= raw t 'views.questionbox.required', signup: link_to(t('views.sessions.new'),new_user_registration_path)
Sapphire/spring.moe
app/views/shared/_questionbox.html.haml
haml
mit
2,249
.panel.panel-default.hidden-xs %img.profile--avatar{src: current_user.profile_picture.url(:large)} .panel-body - 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 %h4.entry-text#follower-count= current_user.follower_count %h6.entry-subtext= t('views.general.follower').pluralize(current_user.follower_count) %a{href: show_user_friends_path(current_user.screen_name)} .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#friend-count= current_user.friend_count %h6.entry-subtext= t('views.general.following') .panel.panel-default.hidden-xs %ul.nav.nav-pills.nav-stacked = list_group_item t('views.general.timeline'), root_path = list_group_item t('views.general.public'), public_timeline_path - current_user.groups.each do |group| = list_group_item group.display_name, group_timeline_path(group.name) - unless @group.nil? .panel.panel-default.profile--panel.hidden-xs .panel-heading %h3.panel-title= t('views.group.members') .panel-body - @group.members.each do |member| %a{href: show_user_profile_path(member.user.screen_name), title: member.user.screen_name, data: { toggle: :tooltip, placement: :top }} %img.img-rounded.answerbox--img-small{src: member.user.profile_picture.url(:medium)} .hidden-xs= render 'shared/links'
Sapphire/spring.moe
app/views/shared/_sidebar.html.haml
haml
mit
1,633
.media.smiles .pull-left %i.fa.fa-smile-o .media-body - if a.smiles.all.count == 0 = t 'views.answerbox.no_smile' - else - a.smiles.all.each do |smile| %a{href: show_user_profile_path(smile.user.screen_name), title: smile.user.screen_name, data: { toggle: :tooltip, placement: :top, smile_id: smile.id }} %img.img-rounded.answerbox--img-small{src: gravatar_url(smile.user)}
Sapphire/spring.moe
app/views/shared/_smiles.html.haml
haml
mit
419
/ TODO: pixeldesu pls - type ||= @type || :nil .panel.panel-default .panel-body .media .pull-left %img.img-rounded.profile--img{src: gravatar_url(user)} .media-body - if user.display_name.blank? %h2 %a{href: show_user_profile_path(user.screen_name)} = user.screen_name - else %h2.profile--displayname %a{href: show_user_profile_path(user.screen_name)} = user.display_name %h4.text-muted.profile--username= user.screen_name .row .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#asked-count= user.asked_count %h6.entry-subtext= t('views.general.question').pluralize(user.asked_count) .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#answered-count= user.answered_count %h6.entry-subtext= t('views.general.answer').pluralize(user.answered_count) = render 'user/actions', user: user, type: type
Sapphire/spring.moe
app/views/shared/_userbox.html.haml
haml
mit
955
.jumbotron.j2-jumbo.text-center.particle-jumbotron #particles .particle-content .container = render 'layouts/messages' %h1= APP_CONFIG['site_name'] %p= t 'views.front.subtitle' %p %a.btn.btn-primary.btn-lg{href: url_for(new_user_registration_path)} Register now %small Already a member? = link_to 'Sign in', new_user_session_path .container-fluid .row.text-center .col-md-4.col-sm-4.col-xs-12 .icon-showcase %i.fa.fa-comments %h3.heading-showcase= t 'views.front.ask.title' %p= t('views.front.ask.desc', app_title: APP_CONFIG['site_name']) .col-md-4.col-sm-4.col-xs-12 .icon-showcase %i.fa.fa-users %h3.heading-showcase= t 'views.front.follow.title' %p= t 'views.front.follow.desc' .col-md-4.col-sm-4.col-xs-12 .icon-showcase %i.fa.fa-share-square-o %h3.heading-showcase= t 'views.front.share.title' %p= t 'views.front.share.desc' = render "shared/links"
Sapphire/spring.moe
app/views/static/_front.html.haml
haml
mit
1,019
%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: "/"} Timelines #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)
Sapphire/spring.moe
app/views/static/_mobile_nav.html.haml
haml
mit
634
- provide(:title, generate_title("About")) .jumbotron.j2-jumbo.text-center.particle-jumbotron #particles .particle-content %h1= APP_CONFIG['site_name'] %p= t 'views.about.subtitle' .container .panel.panel-default .panel-body .row .col-md-3 %h3= t 'views.about.links.title' %p= t('views.about.links.desc', app_title: APP_CONFIG['site_name']) .col-md-3.col-sm-4 %a{href: "https://twitter.com/retro_spring"} .icon-showcase %i.fa.fa-twitter %h4.heading-about.text-center Twitter .col-md-3.col-sm-4 %a{href: "https://github.com/Retrospring/bugs"} .icon-showcase %i.fa.fa-bug %h4.heading-about.text-center Bug Tracker .col-md-3.col-sm-4 %a{href: help_faq_path} .icon-showcase %i.fa.fa-question %h4.heading-about.text-center FAQ .panel.panel-default .panel-body .row .col-md-4 %h3= t 'views.about.opensource.title' %p= t('views.about.opensource.warning', app_title: APP_CONFIG['site_name']) %p= raw t('views.about.opensource.desc', app_title: APP_CONFIG['site_name'], github: link_to(t('views.about.opensource.github'), "https://github.com/Retrospring/retrospring"), bugtracker: link_to(t('views.about.opensource.bugtracker'), "https://github.com/Retrospring/bugs")) .col-md-4 %a{href: "https://github.com/Retrospring/retrospring"} .icon-showcase %i.fa.fa-github %h4.heading-about.text-center= t 'views.about.repository.title' %p.text-center %em= t 'views.about.repository.desc' .col-md-4 %h3= t 'views.about.contributors.title' %p= t('views.about.contributors.desc', app_title: APP_CONFIG['site_name']) %p= raw t('views.about.contributors.howto', fork: link_to(t('views.about.contributors.fork'), "https://github.com/retrospring/retrospring")) %ul.about--moderator - User.where(contributor: true).each do |sup| %a{href: show_user_profile_path(sup.screen_name), title: sup.screen_name, data: { toggle: :tooltip, placement: :top }} %img.img-rounded.answerbox--img-small{src: sup.profile_picture.url(:medium)} .panel.panel-default .panel-body .row .col-md-4 %h3= t 'views.about.team.title' = t('views.about.team.desc', app_title: APP_CONFIG['site_name']) %br/ - 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'] .col-md-4 %h3= t 'views.about.moderators.title' %p= t('views.about.moderators.desc', app_title: APP_CONFIG['site_name']) %ul.about--moderator - User.where(moderator: true).each do |mod| %a{href: show_user_profile_path(mod.screen_name), title: mod.screen_name, data: { toggle: :tooltip, placement: :top }} %img.img-rounded.answerbox--img{src: mod.profile_picture.url(:medium)} .col-md-4 %h3= t 'views.about.funding.title' %p= t('views.about.funding.desc', app_title: APP_CONFIG['site_name']) %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 }} %img.img-rounded.answerbox--img{src: sup.profile_picture.url(:medium)} .panel.panel-default .panel-body .row .col-md-3.col-sm-12.col-xs-12 %h3= t 'views.about.statistics.title' %p= t('views.about.statistics.desc', app_title: APP_CONFIG['site_name']) .col-md-3.col-sm-6.col-xs-6.statistics %h2.entry-text#asked-count= Question.count %h4.entry-subtext= t('views.general.question').pluralize(Question.count) %h2.entry-text#answered-count= Answer.count %h4.entry-subtext= t('views.general.answer').pluralize(Answer.count) .col-md-3.col-sm-6.col-xs-6.statistics %h2.entry-text#asked-count= Comment.count %h4.entry-subtext= t('views.general.comment').pluralize(Comment.count) %h2.entry-text#answered-count= Smile.count + CommentSmile.count %h4.entry-subtext= t('views.general.smile').pluralize(Smile.count) .col-md-3.col-sm-12.col-xs-12.users .entry-text#follower-count= User.count %h6.entry-subtext= t('views.general.user').pluralize(User.count) = render "shared/links"
Sapphire/spring.moe
app/views/static/about.html.haml
haml
mit
4,960
- provide(:title, generate_title("Frequently Asked Questions")) .jumbotron.j2-jumbo.text-center.particle-jumbotron #particles .particle-content %h1 Frequently Asked Questions %p Everything you want to know about = succeed '!' do = APP_CONFIG['site_name'] .container .panel.panel-default .panel-body = raw_markdown_io "service-docs/en/help/faq.md"
Sapphire/spring.moe
app/views/static/faq.html.haml
haml
mit
391
- provide(:title, "#{APP_CONFIG['site_name']}") - if user_signed_in? = render 'static/mobile_nav' .container.j2-page .col-md-3.col-sm-3 = render 'shared/sidebar' .col-md-9.col-xs-12.col-sm-9.j2-col-reset = render 'layouts/messages' #timeline - @timeline.each do |answer| = render 'shared/answerbox', a: answer #pagination= will_paginate @timeline, renderer: BootstrapPagination::Rails, page_links: false - if @timeline.next_page %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @timeline.current_page }} Load more .visible-xs= render 'shared/links' - else = render 'static/front'
Sapphire/spring.moe
app/views/static/index.html.haml
haml
mit
690
$('#timeline').append('<% @timeline.each do |answer| %><%= j render 'shared/answerbox', a: answer %><% end %>'); <% if @timeline.next_page %> $('#pagination').html('<%= j will_paginate @timeline, renderer: BootstrapPagination::Rails, page_links: false %>'); <% else %> $('#pagination, #load-more-btn').remove(); <% end %>
Sapphire/spring.moe
app/views/static/index.js.erb
erb
mit
327
- provide(:title, generate_title("Privacy Policy")) .container.j2-page .panel.panel-default .panel-body = raw_markdown_io "service-docs/en/policy/privacy.md"
Sapphire/spring.moe
app/views/static/privacy_policy.html.haml
haml
mit
170
- provide(:title, generate_title("Terms of Service")) .container.j2-page .panel.panel-default .panel-body = raw_markdown_io "service-docs/en/policy/terms.md"
Sapphire/spring.moe
app/views/static/terms.html.haml
haml
mit
170
- provide(:title, generate_title("Account Settings")) .container.j2-page = render 'user/settings_tabs' .col-md-9.col-xs-12.col-sm-9 = render 'layouts/messages' .panel.panel-default .panel-body = bootstrap_form_for(resource, as: resource_name, url: '/settings/account', html: { method: :put }) do |f| / Password field modal #modal-passwd.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-passwd-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= t 'views.actions.close' %h4#modal-passwd-label.modal-title= t 'views.settings.account.modal.title' .modal-body = f.password_field :current_password, autocomplete: "off", label: t('views.settings.account.password_current'), help: t('views.settings.account.password_current_help') .modal-footer %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"}= t 'views.actions.cancel' %button.btn.btn-primary{:type => "submit"}= t 'views.actions.save' = devise_error_messages! = f.text_field :screen_name, autofocus: true, label: t('views.settings.account.username') = f.email_field :email, label: t('views.settings.account.email') - if devise_mapping.confirmable? && resource.pending_reconfirmation? %div= raw t('views.settings.account.email_confirm', resource: resource.unconfirmed_email) = f.password_field :password, autocomplete: "off", label: t('views.settings.account.password'), help: t('views.settings.account.password_help') = f.password_field :password_confirmation, autocomplete: "off", label: t('views.settings.account.password_confirm') %button.btn.btn-primary{"data-target" => "#modal-passwd", "data-toggle" => "modal", :type => "button"} = t 'views.actions.save' %hr/ %p = t 'views.settings.account.unsatisfied' =button_to t('views.settings.account.delete'), '/settings/account', data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger btn-xs" = link_to t('views.settings.account.back'), :back .visible-xs= render "shared/links"
Sapphire/spring.moe
app/views/user/_account.html.haml
haml
mit
2,473
- if user_signed_in? - type ||= :nil - if user == current_user %a.btn.btn-default.btn-block.profile--follow-btn{href: edit_user_profile_path} Edit profile - else - if current_user.following? user %button#editprofile.btn.btn-default.btn-block.profile--follow-btn{type: :button, name: 'user-action', data: { action: :unfollow, type: type, target: user.screen_name }} = t 'views.actions.unfollow' - else %button#editprofile.btn.btn-primary.btn-block.profile--follow-btn{type: :button, name: 'user-action', data: { action: :follow, type: type, target: user.screen_name }} = t 'views.actions.follow' - unless user == current_user .btn-group.btn-block %button.btn.btn-default.btn-block.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} = t 'views.actions.title' %span.caret %ul.dropdown-menu / %li %a{href: '#', name: 'user-action', data: { action: :block, type: type, target: user.screen_name }} %i.fa.fa-minus-circle Block %li.visible-xs %a{href: '#', data: { target: "#modal-group-memberships", toggle: :modal }} %i.fa.fa-users = t 'views.actions.group' %li %a{href: '#', data: { action: 'report-user', target: user.screen_name }} %i.fa.fa-exclamation-triangle = t 'views.actions.report' - if current_user.mod? %li %a{href: '#', data: { target: "#modal-privileges", toggle: :modal }} %i.fa.fa-wrench = raw t('views.actions.privilege', user: user.screen_name) - unless user.admin? %li %a{href: '#', data: { target: "#modal-ban", toggle: :modal }} %i.fa.fa-ban = t 'views.actions.ban'
Sapphire/spring.moe
app/views/user/_actions.html.haml
haml
mit
1,858
#modal-ban.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-ban-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-ban-label.modal-title = t 'views.modal.bancontrol.title' = bootstrap_form_tag(url: '/mod/ban', html: { method: :post, novalidate: "novalidate" }) do |f| = f.hidden_field :user, value: @user.screen_name #ban-control-super.modal-body = f.check_box :ban, label: t('views.modal.bancontrol.ban'), checked: @user.banned? #ban-controls{style: "#{"display: none" unless @user.banned?}"} = f.check_box :permaban, label: t('views.modal.bancontrol.permanent'), checked: @user.permanently_banned? #ban-controls-time{style: "#{"display: none" unless not @user.permanently_banned?}"} = f.text_field :until, label: "", required: true, value: (@user.banned_until || DateTime.current).strftime("%m/%d/%Y %I:%M %p") = f.text_field :reason, placeholder: t('views.modal.bancontrol.reason'), value: @user.ban_reason .modal-footer %button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }}= t 'views.actions.close' = f.submit t('views.modal.bancontrol.hammertime'), class: "btn btn-primary", name: 'hammer-time'
Sapphire/spring.moe
app/views/user/_modal_ban.html.haml
haml
mit
1,486
%li.list-group-item{id: "group-#{group.name}"} .media .pull-left.j2-table %input.input--center{type: :checkbox, name: 'gm-group-check', data: { group: group.name, user: user.screen_name }, checked: user.member_of?(group), autocomplete: 'off'} .media-body .list-group-item-heading= group.display_name .list-group-item-text.text-muted.j2-up %span{id: "#{group.name}-members"}= group.members.count = t 'views.modal.group.members' · %a.j2-delete#delete-group{href: "#", data: { group: group.name }} %i.fa.fa-close = t 'views.actions.delete'
Sapphire/spring.moe
app/views/user/_modal_group_item.html.haml
haml
mit
618
#modal-group-memberships.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-group-memberships-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= t 'views.actions.close' %h4#modal-group-memberships-label.modal-title= t 'views.modal.group.title' %div{role: "tabpanel"} %ul.nav.nav-tabs{role: "tablist"} %li.active{role: "presentation"} %a{href: "#grouplist", aria: {controls: "grouplist"}, data: {toggle: "tab"}, role: "tab"} = t 'views.modal.group.tabs.main' %li{role: "presentation"} %a{href: "#create", aria: {controls: "create"}, data: {toggle: "tab"}, role: "tab"} = t 'views.modal.group.tabs.create' .tab-content .tab-pane.active{role:"tabpanel", id: "grouplist"} %ul.list-group.groups--list - current_user.groups.each do |group| = render 'user/modal_group_item', group: group, user: @user .tab-pane{role:"tabpanel", id: "create"} .modal-body %input#new-group-name.form-control{type: :text, placeholder: t('views.modal.group.name')} %button#create-group.btn.btn-primary{type: :button, data: { user: @user.screen_name }}= t('views.modal.group.create') .modal-footer %button.btn.btn-primary{name: 'gm-save', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'
Sapphire/spring.moe
app/views/user/_modal_group_memberships.html.haml
haml
mit
1,595
#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= t 'views.actions.close' %h4#modal-privileges-label.modal-title = raw t('views.actions.privilege', user: @user.screen_name) %ul.list-group.groups--list = render 'user/modal_privileges_item', privilege: 'blogger', description: t('views.modal.privilege.blogger'), user: @user = render 'user/modal_privileges_item', privilege: 'contributor', description: t('views.modal.privilege.contributor'), user: @user = render 'user/modal_privileges_item', privilege: 'translator', description: t('views.modal.privilege.translator'), user: @user - if current_user.admin? = render 'user/modal_privileges_item', privilege: 'supporter', description: t('views.modal.privilege.supporter'), user: @user = render 'user/modal_privileges_item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user = render 'user/modal_privileges_item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user .modal-footer %button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'
Sapphire/spring.moe
app/views/user/_modal_privileges.html.haml
haml
mit
1,488
- 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= description
Sapphire/spring.moe
app/views/user/_modal_privileges_item.html.haml
haml
mit
445
.panel.panel-default#profile %img.profile--avatar{src: @user.profile_picture.url(:large)} - flag_info = get_flag_info - @user.flags_to_a.each do |key, value| - info = flag_info[key] - next if info.nil? - if value .profile--panel-badge{class: info[:class] || 'panel-badge-default'} -unless info[:icon].nil? %i.fa{class: info[:icon]} = t "views.user.title.#{info[:key] || key}" - if @user.banned? .profile--panel-badge.panel-badge-default %i.fa.fa-ban = t 'views.user.title.banned' - if @user.following? current_user .profile--panel-badge.panel-badge-default = t 'views.user.follows_you' .panel-body .profile--panel-name - if @user.display_name.blank? .profile--displayname = @user.screen_name - else .profile--displayname = @user.display_name .profile--username = @user.screen_name - unless @user.bio.blank? %p.profile--text= markdown @user.bio - unless @user.website.blank? %p.profile--text %i.fa.fa-globe %a{href: @user.website}= @user.display_website - unless @user.location.blank? %p.profile--text %i.fa.fa-location-arrow = @user.location = render 'user/actions', user: @user, type: :follower = render 'user/stats', user: @user
Sapphire/spring.moe
app/views/user/_profile_info.html.haml
haml
mit
1,349
.col-md-3.col-xs-12.col-sm-3 .panel.panel-default .list-group = list_group_item t('views.settings.tabs.account'), edit_user_registration_path = list_group_item t('views.settings.tabs.profile'), edit_user_profile_path = list_group_item t('views.settings.tabs.privacy'), edit_user_privacy_path = list_group_item t('views.settings.tabs.sharing'), services_path .hidden-xs= render "shared/links"
Sapphire/spring.moe
app/views/user/_settings_tabs.html.haml
haml
mit
428
.panel.panel-default.profile--panel#profile-stats .panel-heading %h3.panel-title Stats .panel-body .row %a{href: show_user_followers_path(@user.screen_name)} .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#follower-count= @user.follower_count %h6.entry-subtext= t('views.general.follower').pluralize(@user.follower_count) %a{href: show_user_friends_path(@user.screen_name)} .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#friend-count= @user.friend_count %h6.entry-subtext= t('views.general.following') .row %a{href: show_user_questions_path(@user.screen_name)} .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#asked-count= @user.asked_count %h6.entry-subtext= t('views.general.question').pluralize(@user.asked_count) %a{href: show_user_profile_path(@user.screen_name)} .col-md-6.col-sm-6.col-xs-6 %h4.entry-text#answered-count= @user.answered_count %h6.entry-subtext= t('views.general.answer').pluralize(@user.answered_count)
Sapphire/spring.moe
app/views/user/_stats.html.haml
haml
mit
1,063
- provide(:title, generate_title("Profile Settings")) .container.j2-page = render 'settings_tabs' .col-md-9.col-xs-12.col-sm-9 = render 'layouts/messages' .panel.panel-default .panel-body = bootstrap_form_for(current_user, url: {action: "edit"}, :html => { :multipart => true }, method: "patch") do |f| = f.text_field :display_name, label: t('views.settings.profile.displayname') .media#profile-picture-media .pull-left %img.img-rounded.profile--img{src: current_user.profile_picture.url(:medium)} .media-body = f.file_field :profile_picture, label: t('views.settings.profile.avatar') .row#profile-picture-crop-controls{style: 'display: none;'} .col-sm-10.col-md-8 %strong= t('views.settings.profile.avatar_adjust') %img#profile-picture-cropper{src: current_user.profile_picture.url(:medium)} .col-sm-2.col-md-4 .btn-group %button#cropper-zoom-out.btn.btn-inverse{type: :button} %i.fa.fa-search-minus %button#cropper-zoom-in.btn.btn-inverse{type: :button} %i.fa.fa-search-plus .media#profile-header-media .pull-left %img.img-rounded.header--img{src: current_user.profile_header.url(:mobile)} .media-body = f.file_field :profile_header, label: t('views.settings.profile.header') .row#profile-header-crop-controls{style: 'display: none;'} .col-sm-10.col-md-8 %strong= t('views.settings.profile.header_adjust') %img#profile-header-cropper{src: current_user.profile_header.url(:web)} .col-sm-2.col-md-4 .btn-group %button#cropper-header-zoom-out.btn.btn-inverse{type: :button} %i.fa.fa-search-minus %button#cropper-header-zoom-in.btn.btn-inverse{type: :button} %i.fa.fa-search-plus = f.text_field :motivation_header, label: t('views.settings.profile.motivation'), placeholder: t('views.settings.profile.placeholder.motivation') = f.text_field :website, label: t('views.settings.profile.website'), placeholder: 'http://example.com' = f.text_field :location, label: t('views.settings.profile.location'), placeholder: t('views.settings.profile.placeholder.location') = f.text_area :bio, label: t('views.settings.profile.bio'), placeholder: t('views.settings.profile.placeholder.bio') - for attrib in %i(crop_x crop_y crop_w crop_h) = f.hidden_field attrib, id: attrib - for attrib in %i(crop_h_x crop_h_y crop_h_w crop_h_h) = f.hidden_field attrib, id: attrib = f.submit t('views.actions.save'), class: 'btn btn-primary'
Sapphire/spring.moe
app/views/user/edit.html.haml
haml
mit
2,868
- provide(:title, generate_title("Privacy Settings")) .container.j2-page = render 'settings_tabs' .col-md-9.col-xs-12.col-sm-9 = render 'layouts/messages' .panel.panel-default .panel-body = bootstrap_form_for(current_user, url: {action: "edit_privacy"}, method: "patch") do |f| = f.check_box :privacy_allow_anonymous_questions, label: t('views.settings.privacy.anonymous') = f.check_box :privacy_allow_public_timeline, label: t('views.settings.privacy.public') = f.check_box :privacy_allow_stranger_answers, label: t('views.settings.privacy.stranger') = f.submit t('views.actions.save'), class: 'btn btn-primary'
Sapphire/spring.moe
app/views/user/edit_privacy.html.haml
haml
mit
681
.profile--header .container.j2-page .col-md-3.col-xs-12.col-sm-4 = render 'user/profile_info' .hidden-xs= render 'shared/links' .col-md-9.col-xs-12.col-sm-8 %h1.j2-lh.hidden-xs Groups %h1.visible-xs Groups %ul - @groups.each do |group| %li - if group.private? %i.fa.fa-lock = group.display_name .visible-xs= render 'shared/links' - if user_signed_in? = render 'user/modal_group_memberships'
Sapphire/spring.moe
app/views/user/groups.html.haml
haml
mit
466
- provide(:title, questions_title(@user)) .profile--header .container.j2-page .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.j2-col-reset %h1.j2-lh.hidden-xs= @title %h1.visible-xs= @title #questions - @questions.each do |q| = render 'shared/question', q: q, type: nil #pagination= will_paginate @questions, renderer: BootstrapPagination::Rails, page_links: false - if @questions.next_page %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @questions.current_page }} = t 'views.actions.load' .visible-xs= render 'shared/links'
Sapphire/spring.moe
app/views/user/questions.html.haml
haml
mit
703
$('#questions').append('<% @questions.each do |q| %><%= j render 'shared/question', q: q %><% end %>'); <% if @questions.next_page %> $('#pagination').html('<%= j will_paginate @questions, renderer: BootstrapPagination::Rails, page_links: false %>'); <% else %> $('#pagination, #load-more-btn').remove(); <% end %>
Sapphire/spring.moe
app/views/user/questions.js.erb
erb
mit
316
- provide(:title, user_title(@user)) - no_header = unless @user.profile_header.exists? then "profile--no-header" else "" end #profile--header{class: no_header} %img.profile--header-img{src: @user.profile_header.url(:web)} .container.j2-page.headerable{class: no_header} #profile-info.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.j2-col-reset .profile--panel-push-inner.hidden-xs{class: no_header} = render 'shared/questionbox' - unless @user.banned? #answers - @answers.each do |a| = render 'shared/answerbox', a: a #pagination= will_paginate @answers, renderer: BootstrapPagination::Rails, page_links: false - if @answers.next_page %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @answers.current_page }} = t 'views.actions.load' .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' = render 'user/modal_ban'
Sapphire/spring.moe
app/views/user/show.html.haml
haml
mit
1,146
$('#answers').append('<% @answers.each do |a| %><%= j render 'shared/answerbox', a: a %><% end %>'); <% if @answers.next_page %> $('#pagination').html('<%= j will_paginate @answers, renderer: BootstrapPagination::Rails, page_links: false %>'); <% else %> $('#pagination, #load-more-btn').remove(); <% end %>
Sapphire/spring.moe
app/views/user/show.js.erb
erb
mit
313
- provide(:title, user_title(@user, "friends and followers")) .profile--header .container.j2-page .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.j2-col-reset %h1.j2-lh.hidden-xs= @title %h1.visible-xs= @title #users - @users.each do |user| .col-sm-6 = render 'shared/userbox', user: user #pagination= will_paginate @users, renderer: BootstrapPagination::Rails, page_links: false - if @users.next_page %button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @users.current_page }} = t 'views.actions.load' .visible-xs= render 'shared/links' - if user_signed_in? = render 'user/modal_group_memberships'
Sapphire/spring.moe
app/views/user/show_follow.html.haml
haml
mit
783
$('#users').append('<% @users.each do |user| %><div class="col-sm-6"><%= j render 'shared/userbox', user: user %></div><% end %>'); <% if @users.next_page %> $('#pagination').html('<%= j will_paginate @users, renderer: BootstrapPagination::Rails, page_links: false %>'); <% else %> $('#pagination, #load-more-btn').remove(); <% end %>
Sapphire/spring.moe
app/views/user/show_follow.js.erb
erb
mit
340
class ShareWorker include Sidekiq::Worker sidekiq_options queue: :share # @param user_id [Integer] the user id # @param answer_id [Integer] the user id # @param services [Array] array containing strings def perform(user_id, answer_id, services) User.find(user_id).services.each do |service| begin service.post(Answer.find(answer_id)) if services.include? service.provider rescue => e Rails.logger.error "failed to post answer #{answer_id} to #{service.provider} for user #{user_id}: #{e.message}" end end end end
Sapphire/spring.moe
app/workers/share_worker.rb
Ruby
mit
570
#!/usr/bin/env ruby ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) load Gem.bin_path('bundler', 'bundle')
Sapphire/spring.moe
bin/bundle
none
mit
129
#!/usr/bin/env ruby begin load File.expand_path("../spring", __FILE__) rescue LoadError end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands'
Sapphire/spring.moe
bin/rails
none
mit
220
#!/usr/bin/env ruby begin load File.expand_path("../spring", __FILE__) rescue LoadError end require_relative '../config/boot' require 'rake' Rake.application.run
Sapphire/spring.moe
bin/rake
none
mit
164
#!/usr/bin/env ruby20 # # This file was generated by Bundler. # # The application 'rspec' is installed as part of a gem, and # this file is here to facilitate running it. # require 'pathname' ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath) require 'rubygems' require 'bundler/setup' load Gem.bin_path('rspec-core', 'rspec')
Sapphire/spring.moe
bin/rspec
none
mit
374
#!/usr/bin/env ruby # This file loads spring without using Bundler, in order to be fast # It gets overwritten when you run the `spring binstub` command unless defined?(Spring) require "rubygems" require "bundler" if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) ENV["GEM_HOME"] = "" Gem.paths = ENV gem "spring", match[1] require "spring/binstub" end end
Sapphire/spring.moe
bin/spring
none
mit
510
# This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Rails.application
Sapphire/spring.moe
config.ru
ru
mit
154
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module Justask class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de config.autoload_paths += %W["#{config.root}/app/validators"] # Use Sidekiq for background jobs config.active_job.queue_adapter = :sidekiq config.i18n.default_locale = "en" config.i18n.fallbacks = true config.i18n.enforce_available_locales = false # DEPRECATION WARNING: Currently, Active Record suppresses errors raised # within `after_rollback`/`after_commit` callbacks and only print them to the logs. # In the next version, these errors will no longer be suppressed. # Instead, the errors will propagate normally just like in other Active Record callbacks. # fix for this warning: config.active_record.raise_in_transactional_callbacks = true end end
Sapphire/spring.moe
config/application.rb
Ruby
mit
1,675
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
Sapphire/spring.moe
config/boot.rb
Ruby
mit
170
# # PRODUCTION # production: adapter: mysql2 encoding: utf8 collation: utf8_general_ci reconnect: false database: justask_production pool: 25 username: justask password: "hack me" # host: localhost # socket: /tmp/mysql.sock # # Development specific # development: adapter: mysql2 encoding: utf8 collation: utf8_general_ci reconnect: false database: justask_development pool: 5 username: root password: "hack me twice" # socket: /tmp/mysql.sock # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: &test adapter: mysql2 encoding: utf8 collation: utf8_general_ci reconnect: false database: justask_test pool: 5 username: root password: "hack me twice" # socket: /tmp/mysql.sock
Sapphire/spring.moe
config/database.yml.mysql
SQL
mit
878
# # PRODUCTION # production: adapter: postgresql encoding: unicode database: justask_production pool: 25 # username: justask # password: # host: localhost # port: 5432 # # Development specific # development: adapter: postgresql encoding: unicode database: justask_development pool: 5 username: postgres password: # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: &test adapter: postgresql encoding: unicode database: justask_test pool: 5 username: postgres password:
Sapphire/spring.moe
config/database.yml.postgres
postgres
mit
656
# Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. Rails.application.initialize!
Sapphire/spring.moe
config/environment.rb
Ruby
mit
150
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Do not eager load code on boot. config.eager_load = false # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false config.action_mailer.delivery_method = :sendmail config.action_mailer.default_url_options = { host: 'justask.local' } config.action_mailer.perform_deliveries = true # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = true # Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies. # Raises helpful error messages. config.assets.raise_runtime_errors = true # Raises error for missing translations # config.action_view.raise_on_missing_translations = true end
Sapphire/spring.moe
config/environments/development.rb
Ruby
mit
1,593
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers # and those relying on copy on write to perform better. # Rake tasks automatically ignore this option for performance. config.eager_load = true # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true # Enable Rack::Cache to put a simple HTTP cache in front of your application # Add `rack-cache` to your Gemfile before enabling this. # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. # config.action_dispatch.rack_cache = true # Disable Rails's static asset server (Apache or nginx will already do this). config.serve_static_files = false # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false # Generate digests for assets URLs. config.assets.digest = true # `config.assets.precompile` has moved to config/initializers/assets.rb # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true # Set to :debug to see everything in the log. config.log_level = :info # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] # Use a different logger for distributed setups. # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production. # config.cache_store = :mem_cache_store # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = "http://assets.example.com" # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # config.assets.precompile += %w( search.js ) # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify config.action_mailer.delivery_method = :sendmail config.action_mailer.default_url_options = { host: 'retrospring.net' } config.action_mailer.perform_deliveries = true # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. config.action_mailer.raise_delivery_errors = true # Disable automatic flushing of the log to improve performance. # config.autoflush_log = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false end
Sapphire/spring.moe
config/environments/production.rb
Ruby
mit
3,482
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that # preloads Rails for running tests, you may have to set it to true. config.eager_load = false # Configure static asset server for tests with Cache-Control for performance. config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr # Raises error for missing translations # config.action_view.raise_on_missing_translations = true end
Sapphire/spring.moe
config/environments/test.rb
Ruby
mit
1,661
# Split context in several files. # # By default only one file with all translations is exported and # no configuration is required. Your settings for asset pipeline # are automatically recognized. # # If you want to split translations into several files or specify # locale contexts that will be exported, just use this file to do # so. # # For more informations about the export options with this file, please # refer to the README # # # If you're going to use the Rails 3.1 asset pipeline, change # the following configuration to something like this: # # translations: # - file: "app/assets/javascripts/i18n/translations.js" # # If you're running an old version, you can use something # like this: # fallbacks: :default_locale translations: - file: 'public/javascripts/i18n/%{locale}.js' only: ['*.frontend.*', '*.views.actions.*']
Sapphire/spring.moe
config/i18n-js.yml
YAML
mit
844
APP_CONFIG = YAML.load_file(Rails.root.join('config', 'justask.yml'))
Sapphire/spring.moe
config/initializers/10_config.rb
Ruby
mit
71
Sidekiq.configure_server do |config| config.redis = { url: APP_CONFIG['redis_url'] } end Sidekiq.configure_client do |config| config.redis = { url: APP_CONFIG['redis_url'] } end
Sapphire/spring.moe
config/initializers/15_sidekiq.rb
Ruby
mit
182
WillPaginate.per_page = APP_CONFIG['items_per_page']
Sapphire/spring.moe
config/initializers/20_will_paginate.rb
Ruby
mit
52
Paperclip::Attachment.default_options[:storage] = :fog Paperclip::Attachment.default_options[:fog_credentials] = {:provider => "Local", :local_root => "#{Rails.root}/public"} Paperclip::Attachment.default_options[:fog_directory] = "/system" Paperclip::Attachment.default_options[:fog_host] = "/system" unless APP_CONFIG["fog"].nil? Paperclip::Attachment.default_options[:fog_credentials] = APP_CONFIG["fog"]["credentials"] unless APP_CONFIG["fog"]["credentials"].nil? Paperclip::Attachment.default_options[:fog_directory] = APP_CONFIG["fog"]["directory"] unless APP_CONFIG["fog"]["directory"].nil? Paperclip::Attachment.default_options[:fog_host] = APP_CONFIG["fog"]["host"] unless APP_CONFIG["fog"]["host"].nil? if not APP_CONFIG["fog"]["credentials"].nil? and APP_CONFIG["fog"]["host"].nil? Paperclip::Attachment.default_options[:fog_host] = nil end end
Sapphire/spring.moe
config/initializers/25_paperclip.rb
Ruby
mit
872
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. 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( moderation.js ) Rails.application.config.assets.precompile += %w( i18n.js )
Sapphire/spring.moe
config/initializers/assets.rb
Ruby
mit
439
# Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. # Rails.backtrace_cleaner.remove_silencers!
Sapphire/spring.moe
config/initializers/backtrace_silencers.rb
Ruby
mit
404
# Be sure to restart your server when you modify this file. Rails.application.config.action_dispatch.cookies_serializer = :json
Sapphire/spring.moe
config/initializers/cookies_serializer.rb
Ruby
mit
128
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmation, reset password and unlock tokens in the database. # config.secret_key = 'e3551005ecfb5c635b374afd51245b674ff956175597003be7d194b3f2ac8b0151a3ae38d88d9ad9845f6a839129b2996ad372e674fb8307ab31f824dc647b7a' # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class # with default "from" parameter. config.mailer_sender = "#{APP_CONFIG['site_name']} <#{APP_CONFIG['email_from']}>" # Configure the class responsible to send e-mails. # config.mailer = 'Devise::Mailer' # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be # available as additional gems. require 'devise/orm/active_record' # ==> Configuration for any authentication mechanism # Configure which keys are used when authenticating a user. The default is # just :email. You can configure it to use [:username, :subdomain], so for # authenticating a user, both parameters are required. Remember that those # parameters are used only when authenticating and not when retrieving from # session. If you need permissions, you should implement that in a before filter. # You can also supply a hash where the value is a boolean determining whether # or not authentication should be aborted when the value is not present. config.authentication_keys = [ :login ] # Configure parameters from the request object used for authentication. Each entry # given should be a request method and it will automatically be passed to the # find_for_authentication method and considered in your model lookup. For instance, # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. # The same considerations mentioned for authentication_keys also apply to request_keys. # config.request_keys = [] # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. config.case_insensitive_keys = [ :email ] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. config.strip_whitespace_keys = [ :email ] # Tell if authentication through request.params is enabled. True by default. # It can be set to an array that will enable params authentication only for the # given strategies, for example, `config.params_authenticatable = [:database]` will # enable it only for database (email + password) authentication. # config.params_authenticatable = true # Tell if authentication through HTTP Auth is enabled. False by default. # It can be set to an array that will enable http authentication only for the # given strategies, for example, `config.http_authenticatable = [:database]` will # enable it only for database authentication. The supported strategies are: # :database = Support basic authentication with authentication key + password # config.http_authenticatable = false # If http headers should be returned for AJAX requests. True by default. # config.http_authenticatable_on_xhr = true # The realm used in Http Basic Authentication. 'Application' by default. # config.http_authentication_realm = 'Application' # It will change confirmation, password recovery and other workflows # to behave the same regardless if the e-mail provided was right or wrong. # Does not affect registerable. # config.paranoid = true # By default Devise will store the user in session. You can skip storage for # particular strategies by setting this option. # Notice that if you are skipping storage for all authentication paths, you # may want to disable generating routes to Devise's sessions controller by # passing skip: :sessions to `devise_for` in your config/routes.rb config.skip_session_storage = [:http_auth] # By default, Devise cleans up the CSRF token on authentication to # avoid CSRF token fixation attacks. This means that, when using AJAX # requests for sign in and sign up, you need to get a new CSRF token # from the server. You can disable this option at your own risk. # config.clean_up_csrf_token_on_authentication = true # ==> Configuration for :database_authenticatable # For bcrypt, this is the cost for hashing the password and defaults to 10. If # using other encryptors, it sets how many times you want the password re-encrypted. # # Limiting the stretches to just one in testing will increase the performance of # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use # a value less than 10 in other environments. Note that, for bcrypt (the default # encryptor), the cost increases exponentially with the number of stretches (e.g. # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). config.stretches = Rails.env.test? ? 1 : 10 # Setup a pepper to generate the encrypted password. # config.pepper = 'd33f5cf853eb50878514389f7e6f4a74cfd76f6253774247becc76a39c5ddfdd1db28828a9d0ec2c8c9afcea433902923a48923a9dea01d536d2c2c2764df654' # ==> Configuration for :confirmable # A period that the user is allowed to access the website even without # confirming their account. For instance, if set to 2.days, the user will be # able to access the website for two days without confirming their account, # access will be blocked just in the third day. Default is 0.days, meaning # the user cannot access the website without confirming their account. # config.allow_unconfirmed_access_for = 2.days # A period that the user is allowed to confirm their account before their # token becomes invalid. For example, if set to 3.days, the user can confirm # their account within 3 days after the mail was sent, but on the fourth day # their account can't be confirmed with the token any more. # Default is nil, meaning there is no restriction on how long a user can take # before confirming their account. # config.confirm_within = 3.days # If true, requires any email changes to be confirmed (exactly the same way as # initial account confirmation) to be applied. Requires additional unconfirmed_email # db field (see migrations). Until confirmed, new email is stored in # unconfirmed_email column, and copied to email column on successful confirmation. config.reconfirmable = true # Defines which key will be used when confirming an account config.confirmation_keys = [ :screen_name ] # ==> Configuration for :rememberable # The time the user will be remembered without asking for credentials again. # config.remember_for = 2.weeks # If true, extends the user's remember period when remembered via cookie. # config.extend_remember_period = false # Options to be passed to the created cookie. For instance, you can set # secure: true in order to force SSL only cookies. # config.rememberable_options = {} # ==> Configuration for :validatable # Range for password length. config.password_length = 8..128 # Email regex used to validate email formats. It simply asserts that # one (and only one) @ exists in the given string. This is mainly # to give user feedback and not to assert the e-mail validity. # config.email_regexp = /\A[^@]+@[^@]+\z/ # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. Default is 30 minutes. # config.timeout_in = 30.minutes # If true, expires auth token on session timeout. # config.expire_auth_token_on_timeout = false # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. # :failed_attempts = Locks an account after a number of failed attempts to sign in. # :none = No lock strategy. You should handle locking by yourself. # config.lock_strategy = :failed_attempts # Defines which key will be used when locking and unlocking an account # config.unlock_keys = [ :email ] # Defines which strategy will be used to unlock an account. # :email = Sends an unlock link to the user email # :time = Re-enables login after a certain amount of time (see :unlock_in below) # :both = Enables both strategies # :none = No unlock strategy. You should handle unlocking by yourself. # config.unlock_strategy = :both # Number of authentication tries before locking an account if lock_strategy # is failed attempts. # config.maximum_attempts = 20 # Time interval to unlock the account if :time is enabled as unlock_strategy. # config.unlock_in = 1.hour # Warn on the last attempt before the account is locked. # config.last_attempt_warning = false # ==> Configuration for :recoverable # # Defines which key will be used when recovering the password for an account config.reset_password_keys = [ :login ] # Time interval you can reset your password with a reset password key. # Don't put a too small interval or your users won't have the time to # change their passwords. config.reset_password_within = 6.hours # ==> Configuration for :encryptable # Allow you to use another encryption algorithm besides bcrypt (default). You can use # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) # and :restful_authentication_sha1 (then you should set stretches to 10, and copy # REST_AUTH_SITE_KEY to pepper). # # Require the `devise-encryptable` gem when using anything other than bcrypt # config.encryptor = :sha512 # ==> Scopes configuration # Turn scoped views on. Before rendering "sessions/new", it will first check for # "users/sessions/new". It's turned off by default because it's slower if you # are using only default views. # config.scoped_views = false # Configure the default scope given to Warden. By default it's the first # devise role declared in your routes (usually :user). # config.default_scope = :user # Set this configuration to false if you want /users/sign_out to sign out # only the current scope. By default, Devise signs out all scopes. # config.sign_out_all_scopes = true # ==> Navigation configuration # Lists the formats that should be treated as navigational. Formats like # :html, should redirect to the sign in page when the user does not have # access, but formats like :xml or :json, should return 401. # # If you have any extra navigational formats, like :iphone or :mobile, you # should add them to the navigational formats lists. # # The "*/*" below is required to match Internet Explorer requests. # config.navigational_formats = ['*/*', :html] # The default HTTP method used to sign out a resource. Default is :delete. config.sign_out_via = :delete # ==> OmniAuth # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or # change the failure app, you can configure them inside the config.warden block. # # config.warden do |manager| # manager.intercept_401 = false # manager.default_strategies(scope: :user).unshift :some_external_strategy # end # ==> Mountable engine configurations # When using Devise inside an engine, let's call it `MyEngine`, and this engine # is mountable, there are some extra configurations to be taken into account. # The following options are available, assuming the engine is mounted as: # # mount MyEngine, at: '/my_engine' # # The router that invoked `devise_for`, in the example above, would be: # config.router_name = :my_engine # # When using omniauth, Devise cannot automatically set Omniauth path, # so you need to do it manually. For the users scope, it would be: # config.omniauth_path_prefix = '/my_engine/users/auth' end
Sapphire/spring.moe
config/initializers/devise.rb
Ruby
mit
12,629
Devise::Async.backend = :sidekiq
Sapphire/spring.moe
config/initializers/devise_async.rb
Ruby
mit
32
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += [:password]
Sapphire/spring.moe
config/initializers/filter_parameter_logging.rb
Ruby
mit
194
Haml::Template.options[:ugly] = true
Sapphire/spring.moe
config/initializers/haml.rb
Ruby
mit
37
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end # These inflection rules are supported but not enabled by default: # ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.acronym 'RESTful' # end
Sapphire/spring.moe
config/initializers/inflections.rb
Ruby
mit
647
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf
Sapphire/spring.moe
config/initializers/mime_types.rb
Ruby
mit
156
Rails.application.config.middleware.use OmniAuth::Builder do %w(facebook twitter tumblr).each do |service| if APP_CONFIG['sharing'][service]['enabled'] provider service.to_sym, APP_CONFIG['sharing'][service]['consumer_key'], APP_CONFIG['sharing'][service]['consumer_secret'] end end end
Sapphire/spring.moe
config/initializers/omniauth.rb
Ruby
mit
304
QuestionGenerator.compile
Sapphire/spring.moe
config/initializers/questiongenerator.rb
Ruby
mit
26
Rack::Utils.multipart_part_limit = 0
Sapphire/spring.moe
config/initializers/rack.rb
Ruby
mit
37
# workaround to get pagination right if defined? WillPaginate Kaminari.configure do |config| config.page_method_name = :per_page_kaminari end end RailsAdmin.config do |config| config.main_app_name = ['justask', 'Kontrollzentrum'] ## == Authentication == config.authenticate_with do redirect_to main_app.root_path unless current_user.try :admin? end config.current_user_method(&:current_user) config.actions do dashboard # mandatory index # mandatory new export bulk_delete show edit delete show_in_app ## With an audit adapter, you can add: # history_index # history_show end config.included_models = %w[ Answer Comment Group GroupMember Inbox Notification Question Relationship Report Service Services::Twitter Services::Tumblr Smile User ] end
Sapphire/spring.moe
config/initializers/rails_admin.rb
Ruby
mit
930
require 'redcarpet/render_strip' MARKDOWN_OPTS = { filter_html: true, escape_html: true, no_images: true, no_styles: true, safe_links_only: true, xhtml: false, hard_wrap: true, no_intra_emphasis: true, tables: true, fenced_code_blocks: true, autolink: true, disable_indented_code_blocks: true, strikethrough: true, superscript: false } RAW_MARKDOWN_OPTS = { tables: true, fenced_code_blocks: true, autolink: true, disable_indented_code_blocks: true, strikethrough: true, superscript: false }
Sapphire/spring.moe
config/initializers/redcarpet.rb
Ruby
mit
562
EVIL_TAGS = { elements: %w(blockquote a p i strong em del pre code table tr td th br ul ol li hr), attributes: { 'a' => %w(href) }, protocols: { 'a' => { 'href' => ['http', 'https', :relative] } } }
Sapphire/spring.moe
config/initializers/sanitize.rb
Ruby
mit
216
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_justask_session'
Sapphire/spring.moe
config/initializers/session_store.rb
Ruby
mit
139
# Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters format: [:json] if respond_to?(:wrap_parameters) end # To enable root element in JSON for ActiveRecord objects. # ActiveSupport.on_load(:active_record) do # self.include_root_in_json = true # end
Sapphire/spring.moe
config/initializers/wrap_parameters.rb
Ruby
mit
517
# The site name, shown everywhere. site_name: "justask" hostname: "justask.rrerr.net" https: true email_from: "noreply@justask.rrerr.net" # Name of the "Anonymous" user. (e.g. "Anonymous Coward", "Arno Nym", "Mr. X", ...) anonymous_name: "Anonymous" # How many items (questions, answers, ...) do you want to show per page? items_per_page: 10 # OAuth tokens sharing: twitter: enabled: true # Get the tokens from https://apps.twitter.com consumer_key: '' consumer_secret: '' facebook: enabled: false tumblr: enabled: true # Get the tokens from https://www.tumblr.com/oauth/apps consumer_key: '' consumer_secret: '' # Redis 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 # delete if using local storage fog: # fog credentials credentials: provider: 'AWS' aws_access_key_id: 'ACCESS KEY' aws_secret_access_key: 'SECRET KEY' region: 'space-pluto-1' # bucket name, required directory: 'retrospring' # URL host, comment out to use default, GENERALLY you don't want to define this # host: ''
Sapphire/spring.moe
config/justask.yml.example
example
mit
1,352
require 'sidekiq/web' Rails.application.routes.draw do # Admin panel mount RailsAdmin::Engine => '/justask_admin', as: 'rails_admin' # Sidekiq constraints ->(req) { req.env["warden"].authenticate?(scope: :user) && req.env['warden'].user.admin? } do mount Sidekiq::Web, at: "/sidekiq" end # Moderation panel constraints ->(req) { req.env['warden'].authenticate?(scope: :user) && (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 match '/mod/create_comment', to: 'moderation#create_comment', via: :post, as: :mod_create_comment 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 match '/mod/ban', to: 'moderation#ban', via: :post, as: :mod_ban end end root 'static#index' 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] as :user do # :sessions get 'sign_in' => 'devise/sessions#new', as: :new_user_session post 'sign_in' => 'devise/sessions#create', as: :user_session delete 'sign_out' => 'devise/sessions#destroy', as: :destroy_user_session # :registrations get 'settings/delete_account' => 'devise/registrations#cancel', as: :cancel_user_registration post '/user/create' => 'devise/registrations#create', as: :user_registration get '/sign_up' => 'devise/registrations#new', as: :new_user_registration get '/settings/account' => 'devise/registrations#edit', as: :edit_user_registration patch '/settings/account' => 'devise/registrations#update', as: :update_user_registration put '/settings/account' => 'devise/registrations#update' delete '/settings/account' => 'devise/registrations#destroy' end match '/settings/profile', to: 'user#edit', via: 'get', as: :edit_user_profile match '/settings/profile', to: 'user#update', via: 'patch', as: :update_user_profile # resources :services, only: [:index, :destroy] match '/settings/services', to: 'services#index', via: 'get', as: :services match '/settings/services/:id', to: 'services#destroy', via: 'delete', as: :service controller :services do scope "/auth", as: "auth" do get ':provider/callback' => :create get :failure end end match '/settings/privacy', to: 'user#edit_privacy', via: :get, as: :edit_user_privacy match '/settings/privacy', to: 'user#update_privacy', via: :patch, as: :update_user_privacy namespace :ajax do match '/ask', to: 'question#create', via: :post, as: :ask match '/destroy_question', to: 'question#destroy', via: :post, as: :destroy_question match '/generate_question', to: 'inbox#create', via: :post, as: :generate_question match '/delete_inbox', to: 'inbox#remove', via: :post, as: :delete_inbox match '/delete_all_inbox', to: 'inbox#remove_all', via: :post, as: :delete_all_inbox match '/answer', to: 'answer#create', via: :post, as: :answer match '/destroy_answer', to: 'answer#destroy', via: :post, as: :destroy_answer match '/create_friend', to: 'friend#create', via: :post, as: :create_friend match '/destroy_friend', to: 'friend#destroy', via: :post, as: :destroy_friend match '/create_smile', to: 'smile#create', via: :post, as: :create_smile match '/destroy_smile', to: 'smile#destroy', via: :post, as: :destroy_smile match '/create_comment_smile', to: 'smile#create_comment', via: :post, as: :create_comment_smile match '/destroy_comment_smile', to: 'smile#destroy_comment', via: :post, as: :destroy_comment_smile match '/create_comment', to: 'comment#create', via: :post, as: :create_comment match '/destroy_comment', to: 'comment#destroy', via: :post, as: :destroy_comment match '/report', to: 'report#create', via: :post, as: :report 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 match '/subscribe', to: 'subscription#subscribe', via: :post, as: :subscribe_answer match '/unsubscribe', to: 'subscription#unsubscribe', via: :post, as: :unsubscribe_answer end match '/discover', to: 'discover#index', via: :get, as: :discover match '/public', to: 'public#index', via: :get, as: :public_timeline match '/group/:group_name', to: 'group#index', via: :get, as: :group_timeline 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 match '/@:username/q/:id', to: 'question#show', via: 'get', as: :show_user_question_alt match '/@:username/followers(/p/:page)', to: 'user#followers', via: 'get', as: :show_user_followers_alt, defaults: {page: 1} match '/@:username/friends(/p/:page)', to: 'user#friends', via: 'get', as: :show_user_friends_alt, defaults: {page: 1} match '/:username(/p/:page)', to: 'user#show', via: 'get', as: :show_user_profile, defaults: {page: 1} match '/:username/a/:id', to: 'answer#show', via: 'get', as: :show_user_answer match '/:username/q/:id', to: 'question#show', via: 'get', as: :show_user_question match '/:username/followers(/p/:page)', to: 'user#followers', via: 'get', as: :show_user_followers, defaults: {page: 1} match '/:username/friends(/p/:page)', to: 'user#friends', via: 'get', as: :show_user_friends, defaults: {page: 1} match '/:username/groups(/p/:page)', to: 'user#groups', via: 'get', as: :show_user_groups, defaults: {page: 1} match '/:username/questions(/p/:page)', to: 'user#questions', via: 'get', as: :show_user_questions, defaults: {page: 1} end
Sapphire/spring.moe
config/routes.rb
Ruby
mit
6,782
# Be sure to restart your server when you modify this file. # Your secret key is used for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. # You can use `rake secret` to generate a secure secret key. # Make sure the secrets in this file are kept private # if you're sharing your code publicly. development: secret_key_base: 49efa1a2817c00a75bfc133a56502f311dc4e0997198a5fb43305e9aebc2059ec40e0115495f6fc5ff0c6cab8165511bcde08fdb0649c2d7472de14dfa622334 test: secret_key_base: dd1da9513398a834c2c5da7c285da161d73785401ea568fab59690b4dbbae85b8e90c260f964ca40d6b18ece646073526952de0cd7feeb762faa30a0470f2411 # Do not keep production secrets in the repository, # instead read values from the environment. production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Sapphire/spring.moe
config/secrets.yml
YAML
mit
964
--- :concurrency: 5 :pidfile: ./tmp/pids/sidekiq.pid staging: :concurrency: 10 production: :concurrency: 25 :queues: - share - paperclip - mailer
Sapphire/spring.moe
config/sidekiq.yml
YAML
mit
155
class DeviseCreateUsers < ActiveRecord::Migration def change create_table(:users) do |t| ## Database authenticatable t.string :email, null: false, default: "" t.string :encrypted_password, null: false, default: "" ## Recoverable t.string :reset_password_token t.datetime :reset_password_sent_at ## Rememberable t.datetime :remember_created_at ## Trackable t.integer :sign_in_count, default: 0, null: false t.datetime :current_sign_in_at t.datetime :last_sign_in_at t.string :current_sign_in_ip t.string :last_sign_in_ip ## Confirmable # t.string :confirmation_token # t.datetime :confirmed_at # t.datetime :confirmation_sent_at # t.string :unconfirmed_email # Only if using reconfirmable ## Lockable # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts # t.string :unlock_token # Only if unlock strategy is :email or :both # t.datetime :locked_at t.timestamps end add_index :users, :email, unique: true add_index :users, :reset_password_token, unique: true # add_index :users, :confirmation_token, unique: true # add_index :users, :unlock_token, unique: true end end
Sapphire/spring.moe
db/migrate/20140801095807_devise_create_users.rb
Ruby
mit
1,344
class AddScreenNameToUsers < ActiveRecord::Migration def change add_column :users, :screen_name, :string add_index :users, :screen_name, unique: true end end
Sapphire/spring.moe
db/migrate/20140801103309_add_screen_name_to_users.rb
Ruby
mit
170
class CreateQuestions < ActiveRecord::Migration def change create_table :questions do |t| t.string :content t.boolean :author_is_anonymous t.string :author_name t.string :author_email t.integer :user_id t.timestamps end add_index :questions, [:user_id, :created_at] end end
Sapphire/spring.moe
db/migrate/20140801174930_create_questions.rb
Ruby
mit
327
class CreateAnswers < ActiveRecord::Migration def change create_table :answers do |t| t.string :content t.integer :question_id t.integer :comments t.integer :likes t.integer :user_id t.timestamps end add_index :answers, [:user_id, :created_at] end end
Sapphire/spring.moe
db/migrate/20140801175112_create_answers.rb
Ruby
mit
305
class CreateComments < ActiveRecord::Migration def change create_table :comments do |t| t.string :content t.integer :answer_id t.integer :user_id t.timestamps end add_index :comments, [:user_id, :created_at] end end
Sapphire/spring.moe
db/migrate/20140801175137_create_comments.rb
Ruby
mit
257
class AddCountsToUsers < ActiveRecord::Migration def change add_column :users, :friend_count, :integer, default: 0, null: false add_column :users, :follower_count, :integer, default: 0, null: false add_column :users, :asked_count, :integer, default: 0, null: false add_column :users, :answered_count, :integer, default: 0, null: false add_column :users, :commented_count, :integer, default: 0, null: false end end
Sapphire/spring.moe
db/migrate/20141102153520_add_counts_to_users.rb
Ruby
mit
438
class AddDisplayNameToUsers < ActiveRecord::Migration def change add_column :users, :display_name, :string end end
Sapphire/spring.moe
db/migrate/20141104143648_add_display_name_to_users.rb
Ruby
mit
123
class CreateInboxes < ActiveRecord::Migration def change create_table :inboxes do |t| t.integer :user_id t.integer :question_id t.boolean :new t.timestamps end end end
Sapphire/spring.moe
db/migrate/20141110210154_create_inboxes.rb
Ruby
mit
205
class AddSmileCountToAnswers < ActiveRecord::Migration def change add_column :answers, :smile_count, :integer, default: 0, null: false end end
Sapphire/spring.moe
db/migrate/20141113164048_add_smile_count_to_answers.rb
Ruby
mit
151
class AddSmiledCountToUsers < ActiveRecord::Migration def change add_column :users, :smiled_count, :integer, default: 0, null: false end end
Sapphire/spring.moe
db/migrate/20141113164314_add_smiled_count_to_users.rb
Ruby
mit
149
class AddAdminToUsers < ActiveRecord::Migration def change add_column :users, :admin, :boolean, default: false, null: false end end
Sapphire/spring.moe
db/migrate/20141126154451_add_admin_to_users.rb
Ruby
mit
140
class AddMotivationHeaderToUsers < ActiveRecord::Migration def change add_column :users, :motivation_header, :string, default: '', null: false end end
Sapphire/spring.moe
db/migrate/20141129211448_add_motivation_header_to_users.rb
Ruby
mit
159
class CreateRelationships < ActiveRecord::Migration def change create_table :relationships do |t| t.integer :source_id t.integer :target_id t.timestamps end add_index :relationships, :source_id add_index :relationships, :target_id add_index :relationships, [:source_id, :target_id], unique: true end end
Sapphire/spring.moe
db/migrate/20141130130221_create_relationships.rb
Ruby
mit
348
class CreateSmiles < ActiveRecord::Migration def change create_table :smiles do |t| t.integer :user_id t.integer :answer_id t.timestamps end add_index :smiles, :user_id add_index :smiles, :answer_id add_index :smiles, [:user_id, :answer_id], unique: true end end
Sapphire/spring.moe
db/migrate/20141130175749_create_smiles.rb
Ruby
mit
307
class RenameColumnsInAnswers < ActiveRecord::Migration def change rename_column :answers, :comments, :comment_count remove_column :answers, :likes change_column :answers, :comment_count, :integer, default: 0, null: false end end
Sapphire/spring.moe
db/migrate/20141130180152_rename_columns_in_answers.rb
Ruby
mit
245
class AddFieldsToUsers < ActiveRecord::Migration def change add_column :users, :website, :string, default: '', null: false add_column :users, :location, :string, default: '', null: false add_column :users, :bio, :text, default: '', null: false end end
Sapphire/spring.moe
db/migrate/20141201191324_add_fields_to_users.rb
Ruby
mit
268
class AddAnswerCountToQuestions < ActiveRecord::Migration def change add_column :questions, :answer_count, :integer, default: 0, null: false end end
Sapphire/spring.moe
db/migrate/20141207194424_add_answer_count_to_questions.rb
Ruby
mit
157
class ChangeAnswerContentColumnType < ActiveRecord::Migration def change change_table :answers do |t| t.change :content, :text end end end
Sapphire/spring.moe
db/migrate/20141208111714_change_answer_content_column_type.rb
Ruby
mit
157
class CreateServices < ActiveRecord::Migration def change create_table :services do |t| t.string :type, null: false t.integer :user_id, null: false t.string :uid t.string :access_token t.string :access_secret t.string :nickname t.timestamps end end end
Sapphire/spring.moe
db/migrate/20141212193625_create_services.rb
Ruby
mit
312
class CreateNotifications < ActiveRecord::Migration def change create_table :notifications do |t| t.string :target_type t.integer :target_id t.integer :recipient_id t.boolean :new t.timestamps end end end
Sapphire/spring.moe
db/migrate/20141213182609_create_notifications.rb
Ruby
mit
248
class AddModeratorToUsers < ActiveRecord::Migration def change add_column :users, :moderator, :boolean, default: false, null: false end end
Sapphire/spring.moe
db/migrate/20141226115905_add_moderator_to_users.rb
Ruby
mit
148
class CreateReports < ActiveRecord::Migration def change create_table :reports do |t| t.string :type, null: false t.integer :target_id, null: false t.integer :user_id, null: false t.timestamps end end end
Sapphire/spring.moe
db/migrate/20141227130438_create_reports.rb
Ruby
mit
250
class CreateModerationVotes < ActiveRecord::Migration def change create_table :moderation_votes do |t| t.integer :report_id, null: false t.integer :user_id, null: false t.boolean :upvote, null: false, default: false t.timestamps end add_index :moderation_votes, :user_id add_index :moderation_votes, :report_id add_index :moderation_votes, [:user_id, :report_id], unique: true end end
Sapphire/spring.moe
db/migrate/20141227130545_create_moderation_votes.rb
Ruby
mit
440