new home page, add expiration date, add github login

This commit is contained in:
tdurieux
2019-09-26 16:32:51 -04:00
parent c03db1d282
commit a3a52f496c
5 changed files with 532 additions and 67 deletions
+244 -47
View File
@@ -4,59 +4,256 @@
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>GitHub Anonymous</title>
<title>Anonymous GitHub</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="main">
<div class="container-fluid">
<h1>Anonymous GitHub for Open-Science</h1>
Code and documentation: <a href="https://github.com/tdurieux/anonymous_github/">https://github.com/tdurieux/anonymous_github/</a>
<h2>Create an Anonymous GitHub repository</h2>
<p>
Fill 1. the Github repo URL and 2. the word list (which can be updated afterwards).
The anonymization of the content is done by replacing all occurrences of words in a list by "XXX".
The word list typically contains the institution name, author names, logins, etc...
The README is anonymized as well as all files of the repository. Even filenames are anonymized.
In a double-blind submission, put the anonymous repository URL (e.g. <a href="http://anonymous.4open.science/repository/840c8c57-3c32-451e-bf12-0e20be300389/">http://anonymous.4open.science/repository/840c8c57-3c32-451e-bf12-0e20be300389/</a>).
</p>
<form action="" method="post">
<div class="form-group">
<label for="githubRepository">GitHub Repository</label>
<small id="githubRepositoryHelp" class="form-text text-muted">The github url to the repository that you want to anonymize.</small>
<input type="url" value="{{ repo.repository }}" class="form-control" name="githubRepository" id="githubRepository" aria-describedby="githubRepository" placeholder="GitHub Repository">
</div>
<div class="form-group">
<label for="ignoredTerms">The text to remove from the repository will be replaced by XXX.</label>
<small id="ignoredTermsHelp" class="form-text text-muted">One term per line (case insensitive).</small>
<textarea class="form-control" name="terms" id="ignoredTerms" rows="5">{{ repo.terms|join('\n') }}</textarea>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% if not repo %}
<h2>Edit an Anonymous GitHub repository</h2>
<form action="" method="get">
<div class="form-group">
<label for="name">Anonymous GitHub Repository</label>
<small id="nameHelp" class="form-text text-muted">The id of the Anonymous GitHub repository.</small>
<input class="form-control" name="id" id="name" aria-describedby="name" placeholder="Id Anonymous GitHub Repository">
</div>
<div class="form-group">
<label for="githubRepository">GitHub Repository</label>
<small id="githubRepositoryHelp" class="form-text text-muted">Password: the real Github url.</small>
<input type="url" class="form-control" name="githubRepository" id="githubRepository" aria-describedby="githubRepository" placeholder="GitHub Repository">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endif %}
<!-- Main navigation -->
<header class="d-flex">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top scrolling-navbar ">
<div class="container">
<a class="navbar-brand" href="#">Anonymous GitHub</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav mr-auto smooth-scroll">
<li class="nav-item">
<a class="nav-link" href="#home">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#usage" data-offset="90">Usage</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#features" data-offset="90">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about" data-offset="90">About</a>
</li>
<li class="nav-item">
<a class="nav-link nav-icon" href="https://github.com/tdurieux/anonymous_github/" data-offset="30"><i class="fa fa-github" aria-hidden="true"></i></a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Navbar -->
<!-- Full Page Intro -->
<div id="home" class="view rgba-gradient d-flex align-self-stretch justify-content-center align-items-center">
<!-- Content -->
<div class="container px-md-3 px-sm-0">
<!--Grid row-->
<form action="" method="post">
<div class="row fadeIn main-options">
<!--Grid column-->
<div class="col-md-12 mb-4 white-text text-center fadeIn">
<h3 class="display-3 font-weight-bold white-text mb-0 pt-md-5 pt-5">Anonymous GitHub</h3>
<hr class="hr-light my-4 w-75">
<h4 class="subtext-header mt-2 mb-4">Double-blind your repository in 5 min!</h4>
<input id="url_input" type="text" placeholder="Repository URL..." name="githubRepository" class="white_border" value="{{ repo.repository }}" >
or
<a href="github/login" class="white_border">Login to GitHub</a>
or
<button id="edit-button" class="white_border">Edit your existing repository</button>
</div>
<!--Grid column-->
</div>
<div class="row add_form">
{% if not repo %}
<div class="col-md-12 mb-4 white-text fadeIn">
<div class="alert alert-danger" role="alert">
The repository has to be public, <a href="github/login">login to GitHub</a> for private repositories!
</div>
</div>
{% endif %}
<div class="col-md-12 mb-4 white-text fadeIn">
<div class="form-group">
<label for="ignoredTerms">The text to remove from the repository will be replaced by XXX.</label>
<small id="ignoredTermsHelp" class="form-text text-muted">One term per line (case insensitive).</small>
<textarea class="form-control .form-control-lg" name="terms" id="ignoredTerms" rows="5">{{ repo.terms|join('\n') }}</textarea>
</div>
<div class="form-group">
<label for="expiration">Expiration options</label>
<select class="form-control" id="expiration" name="expiration">
<option value="never" {% if repo.expiration=="never" %} selected="selected"{% endif %}>Never</option>
<option value="redirect" {% if repo.expiration=="redirect" %} selected="selected"{% endif %}>Redirect to the GitHub repository</option>
<option value="remove" {% if repo.expiration=="remove" %} selected="selected"{% endif %}>Remove anonymized repository</option>
</select>
</div>
<div class="form-group" id="expiration-date-form" style="display: none;">
<label for="date">Expiration date.</label>
<small class="form-text text-muted">When the anonymous repository.</small>
<input class="form-control .form-control-lg" type="date" name="expiration_date" id="date" value="{{ repo.expiration_date.date().isoformat() }}" />
</div>
<button type="submit" class="white_border">Submit</button>`
</div>
</div>
</form>
<form class="row edit_form" style="display: none;">
<h2>Edit Anonymized Repository</h2>
<div class="col-md-12 mb-4 white-text fadeIn">
<div class="form-group">
<label>Repository ID</label>
<input class="form-control .form-control-lg" type="text" name="id" id="id"/>
</div>
<div class="form-group">
<label>Repository URL</label>
<input class="form-control .form-control-lg" type="url" name="githubRepository" id="url" value=""/>
</div>
<button type="submit" class="white_border">Submit</button>
<button id="edit_cancel" type="submit" class="white_border">Cancel</button>`
</div>
</form>
<!--Grid row-->
</div>
<!-- Content -->
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<!-- Full Page Intro -->
</header>
<!-- Main navigation -->
<!--Main Layout-->
<main>
<div class="container">
<!--Grid row-->
<div class="row py-5">
<div class="col-md-12">
<h2 id="usage">Usage</h2>
<p class="card-text mb-auto">
<ol>
<li>
Fill the Github repo URL
</li>
<li>
Complete the list of terms that will be anonymized.
<span class="text-muted">The anonymization of the content is done by replacing all occurrences of words in a list by "XXX".The word list typically contains the institution name, author names, logins, etc...</span>
</li>
<li>
Define if you want an expiration date for your anonymized repository.
You can keep it for ever, remove the repository after a specific date or redirect the user to the GitHub repository.
</li>
</ol>
As result, a unique url is created with the content of your repository, for example, <a href="http://anonymous.4open.science/repository/840c8c57-3c32-451e-bf12-0e20be300389/">http://anonymous.4open.science/repository/840c8c57-3c32-451e-bf12-0e20be300389/</a>.
</p>
</div>
<!--Grid column-->
<div class="col-md-12">
<h2 id="features">Features</h2>
</div>
<div class="col-md-6">
<div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
<div class="col p-4 d-flex flex-column position-static">
<h3 class="mb-0">Anonymized</h3>
<p class="card-text mb-auto">
Anonymous GitHub Anonymizes the content of the repository but also hide the issues, pull-requests, history. This way you are sure that your repository stays anonymized.
</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
<div class="col p-4 d-flex flex-column position-static">
<h3 class="mb-0">Always up-to-date</h3>
<p class="card-text mb-auto">
Anonymous GitHub follows to track of the changes on your repository and updates the anonymous version automatically.
</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
<div class="col p-4 d-flex flex-column position-static">
<h3 class="mb-0">Fast</h3>
<p class="card-text mb-auto">
With Anonymous GitHub, it requires only 5min to anonymize your repository. No more time lost to create a anonymized version of your repository.
</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
<div class="col p-4 d-flex flex-column position-static">
<h3 class="mb-0">Open-source</h3>
<p class="card-text mb-auto">
Anonymous GitHub is open-source, you can easily deploy it for your conference and simplify the life of your authors.
</p>
</div>
</div>
</div>
<div class="col-md-12">
<h2 id="about">Metrics</h2>
</div>
<div class="col-md-12">
<div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
<div class="col p-4 d-flex flex-column position-static">
<h3 class="mb-auto text-center">2609 Anonymized Repositories</h3>
<p class="card-text mb-auto">
<strong></strong>
</p>
</div>
</div>
</div>
<!--Grid column-->
</div>
<!--Grid row-->
</div>
</main>
<!--Main Layout-->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<script>
if ($("#url_input")[0].value != "") {
$('.view').addClass('active')
}
$("#url_input").on('focus', e => {
$('.view').addClass('active')
})
if ($("#expiration")[0].value =='never') {
$("#expiration-date-form").hide();
} else {
$("#expiration-date-form").show();
}
$("#expiration").change(e => {
value = e.currentTarget.value;
if (value == 'never') {
$("#expiration-date-form").hide();
} else {
$("#expiration-date-form").show();
}
})
if ($(document).scrollTop() < 35) {
$('.navbar').removeClass('top-nav-collapse')
} else {
$('.navbar').addClass('top-nav-collapse')
}
$(document).scroll(e => {
if ($(document).scrollTop() < 35) {
$('.navbar').removeClass('top-nav-collapse')
} else {
$('.navbar').addClass('top-nav-collapse')
}
})
$('#edit_cancel').on('click', e=> {
e.preventDefault();
$(".edit_form").hide();
$('.main-options').show();
return false;
})
$('#edit-button').on('click', e=> {
e.preventDefault();
$('.view').removeClass('active')
$(".edit_form").show();
$('.main-options').hide();
$('#id').focus();
return false;
})
</script>
</body>
</html>
</html>