Verified Commit 7bf20013 authored by Ole Martin Ruud's avatar Ole Martin Ruud
Browse files

Minor changes

parent e0e9260e
......@@ -14,7 +14,7 @@ log = "0.4.8"
fern = "0.5.8"
unhtml = { version = "0.7.2", features = ["derive"] }
serde = { version = "1.0.99", features = ["derive"] }
directories = "2.0.2"
serde_json = "1.0.40"
directories = "2.0.2"
chrono = "0.4.8"
derive_builder = "0.7.2"
......@@ -301,6 +301,8 @@ impl App {
struct Receipt {
#[html(selector = "h3", attr = "inner")]
title: String,
#[html(selector = "section", attr = "inner")]
message: String,
};
info!("Parsing room order receipt");
......@@ -311,10 +313,10 @@ impl App {
file.write_all(content.as_bytes())?;
info!("Recived receipt:\n{:#?}", receipt);
if receipt.title.contains("Bekreftelse") {
if receipt.title.contains("Bekreftelse") && !receipt.message.contains("allerede bestilt") {
Ok(())
} else {
Err("Did not get confirmation of room order".into())
Err(format!("Unable to verify room order: {}", receipt.message).into())
}
}
}
......@@ -124,7 +124,7 @@ fn run() -> Result<()> {
let client = Client::builder().cookie_store(true).build()?;
let project_dirs = directories::ProjectDirs::from("", "", env!("CARGO_PKG_NAME"));
if project_dirs.is_none() {
warn!("Unable to crate project directories");
warn!("Unable to create project directories");
}
let mut app = App {
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TP: Rombestilling</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="image/x-icon" href="https://tp.uio.no/ntnu/img/favicon.png" rel="shortcut icon"/>
<link type="image/x-icon" href="https://tp.uio.no/ntnu/img/favicon.png" rel="icon"/>
<!--[if lt IE 9]>
<link rel="stylesheet" href="https://tp.uio.no/ntnu/css/screen-ie.css"/><![endif]-->
<!--[if IE 9 ]>
<link rel="stylesheet" href="https://tp.uio.no/ntnu/css/screen.css"/><![endif]-->
<!--[if IE 10 ]>
<link rel="stylesheet" href="https://tp.uio.no/ntnu/css/screen.css"/><![endif]-->
<!--[if !IE ]><!-->
<link rel="stylesheet" href="https://tp.uio.no/ntnu/css/screen.css"/><!--<![endif]-->
<!--[if lt IE 9]>
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="https://tp.uio.no/ntnu/css/common.css?v=56.0">
<link rel="stylesheet" href="css/rb.css?v=56.1"/>
</head>
<body class="inst_NTNU env_PROD">
<div class="page-head" >
<div class="grid pad-x--small">
<section id="header-logo">
<div>
<figure class="tp-logo">
<a href="https://tp.uio.no/ntnu/" title="TP - Forside">
<img alt="logo" src="https://tp.uio.no/ntnu//img/TP-Logo-02.svg">
</a>
</figure>
<h1 class="gray"><a href="./">Rombestilling</a></h1>
</div>
<div>
</div>
</section>
<section id="head-login">
<ul>
<li>
<strong title="NTNU">NTNU</strong>
<nav>
<ul>
<li><a href="https://tp.uio.no/ntnu/undervisning/">Undervisning</a></li>
<li><a href="https://tp.uio.no/ntnu/eksamensplan/">Eksamen</a></li>
<li><a href="https://tp.uio.no/ntnu/rombestilling/">Rombestilling</a></li>
<li><a href="https://tp.uio.no/ntnu/admin/">Administrasjon</a></li>
<li><a href="https://tp.uio.no/ntnu/timeplan/">Timeplaner</a></li>
<li><a href="https://tp.uio.no/ntnu/report/">Rapporter</a></li>
<li><a href="https://tp.uio.no/ntnu/minside">Preferanser</a></li>
<li><a href="http://www.uio.no/tjenester/it/applikasjoner/tp/veiledninger/" target="_blank">Brukerveiledninger</a></li>
<li><a href="http://www.uio.no/tjenester/it/applikasjoner/tp/" target="_blank">Om TP</a></li>
</ul>
</nav>
</li>
<li>
<label for="choose_lang">Språk / language
<ul id="languageChooser" class="">
<li class="selected"><a onClick="setLanguage('no');">Norsk</a></li>
<li ><a onclick="setLanguage('en');">English</a></li>
</ul>
</label>
</li>
<li id="user-fullname">
<span id="head-login-user-fullname">Ole Martin Ødevald Ruud</span>
<span><a id="head-login-logout" href="https://tp.uio.no/ntnu/logout.php">Logg&nbsp;ut</a></span>
</li>
</ul>
</section>
</div>
</div>
<div class="page-content" >
<div class="tabs">
<section class="open">
<a href="./">Ny bestilling</a>
</section>
<section class=""">
<a href="./?mybookings=true">Vis mine bestillinger</a>
</section>
</div>
<form id="origform" name="origform" method="post" action="?" class="tabbed">
<div class="grid">
<h3>Bekreftelse</h3>
<section class="col-10--md col-8--lg">
<div class="whiteback">
<span><div><strong>Reservasjon:</strong><br>
Navn: Woot woot<br>
Id: 19h-STUDENT-OMORUUD-12</div>
<div><br>
<strong>Dato(er) og tid:</strong><br>
<span class="text--muted">Mandag</span><br>
02.09.2019, 08:00-09:00<br>
</div><div><br>
<strong>Rom:</strong><br>
<span title="502K110"><a target="_blank" href="../timeplan/?type=room&id=502K110">Kobolt: K110</a>
<br /></span></div>
</span>
</div>
</section>
</div>
<div>
<hr>
<input class="button button--primary" type="button" value="Ny bestilling" onClick="location = './'" name="x" />
<input class="button button--primary" type="submit" value="Ny bestilling med samme kriterier" name="back" />
<iframe frameborder="0" id="timeplaner" scrolling="no" src="mail.php?adr=omoruud%40stud.ntnu.no&message=Reservasjon%3A%0D%0ANavn%3A%20Woot%20woot%0D%0AId%3A%2019h-STUDENT-OMORUUD-12%0D%0A%0D%0ADato%28er%29%20og%20tid%3A%0D%0AMandag%0D%0A02.09.2019%2C%2008%3A00-09%3A00%0D%0A%0D%0ARom%3A%0D%0AKobolt%3A%20K110%0D%0A%0D%0A"
style="vertical-align: top;"></iframe>
</div>
<input type="hidden" name="start" value="08:00"/>
<input type="hidden" name="size" value=""/>
<input type="hidden" name="roomtype" value=""/>
<input type="hidden" name="duration" value="01:00"/>
<input type="hidden" name="area" value=""/>
<input type="hidden" name="building" value=""/>
<input type="hidden" name="preset_day" value="MON"/>
<input type="hidden" name="preset_date" value="2019-09-02"/>
</form>
<hr />
<div class="grid pad-x">
<div id="rombesttekst"></div>
</div>
</div>
<footer class="page-footer" >
<hr class="bottom"/>
<div class="grid pad-x">
<section class="col-3--lg ">
<figure class="uio-sickle">
<img src="https://tp.uio.no/ntnu/img/ntnu-sickle.svg" alt="Seglet" style="max-height: 75px;">
</figure>
</section>
<section class="col-3--lg ">
<h4>TP-versjon:</h4>
56:PROD
</section>
<section class="col-3--lg ">
<h4>Kontaktinformasjon</h4>
E-post: <span id="tp-email">tp-hjelp@ntnu.no</span>
</section>
<section class="col-3--lg ">
<h4>Ansvarlig for denne tjenesten</h4>
<a id="tp-responsible" href="https://www.ntnu.no/adm/sa">Avdeling for studieadministrasjon</a>
<a href="https://tp.uio.no/ntnu/cookies" style="margin-top: 1em; display: block;">Bruk av informasjonskapsler/cookies</a>
</section>
</div>
</footer>
<script type="text/javascript" src="https://tp.uio.no/ntnu/js/common.js?v=56.0"></script>
<script>setSemesterColour();</script>
<script type="text/javascript" src="https://tp.uio.no/ntnu/js/ajax.js?v=56.0"></script>
</body>
</html>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment