{rclass, React, ReactDOM, redux, rtypes} = require('./smc-react') {Alert, Button, ButtonToolbar, Col, Modal, Row, Input, Well} = require('react-bootstrap') {ErrorDisplay, Icon, Loading, ImmutablePureRenderMixin, Footer, UNIT, SAGE_LOGO_COLOR, BS_BLUE_BGRND} = require('./r_misc') {HelpEmailLink, SiteName, SiteDescription, TermsOfService, AccountCreationEmailInstructions} = require('./customize') #DESC_FONT = "'Roboto Mono','monospace'" DESC_FONT = 'sans-serif' misc = require('smc-util/misc') images = ['static/sagepreview/01-worksheet.png', 'static/sagepreview/02-courses.png', 'static/sagepreview/03-latex.png', 'static/sagepreview/05-sky_is_the_limit.png' ] # 'static/sagepreview/04-files.png' $.get window.smc_base_url + "/auth/strategies", (obj, status) -> if status == 'success' redux.getActions('account').setState(strategies : obj) $.get window.smc_base_url + "/registration", (obj, status) -> if status == 'success' redux.getActions('account').setState(token : obj.token) reset_password_key = () -> url_args = window.location.href.split("#") if url_args.length == 2 and url_args[1].slice(0, 6) == 'forgot' return url_args[1].slice(7, 7+36) return undefined Passports = rclass displayName : 'Passports' propTypes : strategies : rtypes.array actions : rtypes.object.isRequired styles : facebook : backgroundColor : "#395996" color : "white" google : backgroundColor : "#DC4839" color : "white" twitter : backgroundColor : "#55ACEE" color : "white" github : backgroundColor : "black" color : "black" render_strategy : (name) -> if name is 'email' return url = "#{window.smc_base_url}/auth/#{name}" { if name isnt 'github'} render : ->

Connect with

{@render_strategy(name) for name in @props.strategies}

SignUp = rclass displayName: 'SignUp' propTypes : strategies : rtypes.array actions : rtypes.object.isRequired sign_up_error : rtypes.object token : rtypes.bool has_account : rtypes.bool signing_up : rtypes.bool style : rtypes.object make_account : (e) -> e.preventDefault() name = @refs.name.getValue() email = @refs.email.getValue() password = @refs.password.getValue() token = @refs.token?.getValue() @props.actions.create_account(name, email, password, token) display_error : (field)-> if @props.sign_up_error?[field]?
{@props.sign_up_error[field]}
display_passports : -> if not @props.strategies? return if @props.strategies.length > 1 return display_token_input : -> if @props.token render : -> {@display_token_input()} {@display_error("token")} {@display_passports()}
{@display_error("first_name")} {@display_error("email_address")} {@display_error("password")}
Email if you need help.
SignIn = rclass displayName : "SignIn" propTypes : actions : rtypes.object.isRequired sign_in_error : rtypes.string signing_in : rtypes.bool has_account : rtypes.bool sign_in : (e) -> e.preventDefault() @props.actions.sign_in(@refs.email.getValue(), @refs.password.getValue()) display_forgot_password : -> @props.actions.setState(show_forgot_password : true) display_error : -> if @props.sign_in_error? @props.actions.setState(sign_in_error: undefined)} /> remove_error : -> if @props.sign_in_error @props.actions.setState(sign_in_error : undefined) render : ->
Forgot Password? {@display_error()} ForgotPassword = rclass displayName : "ForgotPassword" mixins: [ImmutablePureRenderMixin] propTypes : actions : rtypes.object.isRequired forgot_password_error : rtypes.string forgot_password_success : rtypes.string forgot_password : (e) -> e.preventDefault() @props.actions.forgot_password(@refs.email.getValue()) display_error : -> if @props.forgot_password_error? {@props.forgot_password_error} display_success : -> if @props.forgot_password_success? {@props.forgot_password_success} hide_forgot_password : -> @props.actions.setState(show_forgot_password : false) @props.actions.setState(forgot_password_error : undefined) @props.actions.setState(forgot_password_success : undefined) render : ->

Forgot Password?

Enter your email address to reset your password
{@display_error()} {@display_success()}
Not working? Email us at
ResetPassword = rclass propTypes : -> actions : rtypes.object.isRequired reset_key : rtypes.string.isRequired reset_password_error : rtypes.string mixins: [ImmutablePureRenderMixin] reset_password : (e) -> e.preventDefault() @props.actions.reset_password(@props.reset_key, @refs.password.getValue()) hide_reset_password : (e) -> e.preventDefault() history.pushState("", document.title, window.location.pathname) @props.actions.setState(reset_key : '', reset_password_error : '') display_error : -> if @props.reset_password_error {@props.reset_password_error} render : -> x=0}>

Reset Password?

Enter your new password
{@display_error()}
Not working? Email us at
ContentItem = rclass displayName: "ContentItem" mixins: [ImmutablePureRenderMixin] propTypes: icon: rtypes.string.isRequired heading: rtypes.string.isRequired text: rtypes.string.isRequired render : ->

{@props.heading}

{@props.text}
LANDING_PAGE_CONTENT = teaching : icon : 'university' heading : 'Tools for Teaching' text : 'Create projects for your students, hand out assignments, then collect and grade them with ease.' collaboration : icon : 'weixin' heading : 'Collaboration Made Easy' text : 'Edit documents with multiple team members in real time.' programming : icon : 'code' heading : 'All-in-one Programming' text : 'Write, compile and run code in nearly any programming language.' math : icon : 'area-chart' heading : 'Computational Mathematics' text : 'Use SageMath, IPython, the entire scientific Python stack, R, Julia, GAP, Octave and much more.' latex : icon : 'superscript' heading : 'Built-in LaTeX Editor' text : 'Write beautiful documents using LaTeX.' SMC_Commercial = () -> # LandingPageContent = rclass displayName : 'LandingPageContent' mixins: [ImmutablePureRenderMixin] render : -> { for k, v of LANDING_PAGE_CONTENT} SagePreview = rclass displayName : "SagePreview" render : ->
Interactively explore mathematics, science and statistics. Collaborate with others in real time. You can see their cursors moving around while they type — this works for Sage Worksheets and even Jupyter Notebooks! helps to you to conveniently organize a course: add students, create their projects, see their progress, understand their problems by dropping right into their files from wherever you are. Conveniently handout assignments, collect them, grade them, and finally return them. (SMC used for Teaching and learn more about courses).
supports authoring documents written in LaTeX, Markdown or HTML. The preview helps you understanding what's going on. The LaTeX editor also supports forward and inverse search to avoid getting lost in large documents. does not arbitrarily restrict you. Upload your own files, generate data and results online, then download or publish your results. Besides Sage Worksheets and Jupyter Notebooks, you can work with a full Linux terminal and edit text with multiple cursors.
example_image_style = border : '1px solid #aaa' borderRadius : '3px' padding : '5px' background : 'white' height : '236px' ExampleBox = rclass displayName : "ExampleBox" propTypes : title : rtypes.string.isRequired index : rtypes.number.isRequired render : ->

{@props.title}

{@props.title}
{@props.children}
LogoWide = rclass displayName: "LogoWide" render : ->
RememberMe = () ->
Signing you in...
exports.LandingPage = rclass propTypes: actions : rtypes.object.isRequired strategies : rtypes.array sign_up_error : rtypes.object sign_in_error : rtypes.string signing_in : rtypes.bool signing_up : rtypes.bool forgot_password_error : rtypes.string forgot_password_success : rtypes.string #is this needed? show_forgot_password : rtypes.bool token : rtypes.bool reset_key : rtypes.string reset_password_error : rtypes.string remember_me : rtypes.bool has_account : rtypes.bool render : -> if not @props.remember_me reset_key = reset_password_key()
{ if reset_key} { if @props.show_forgot_password}
else