Skip to content
Snippets Groups Projects
Commit ec801b24 authored by Eike Cochu's avatar Eike Cochu
Browse files

added info directive, updated article show table margins

parent 157b8cfe
Branches
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<h3>Info</h3> <h3>Info</h3>
<table class="table table-bordered table-condensed table-fixed"> <table class="table table-bordered table-condensed table-fixed nomargin">
<tbody> <tbody>
<tr> <tr>
<th class="infocol">ID</th> <th class="infocol">ID</th>
...@@ -46,12 +46,15 @@ ...@@ -46,12 +46,15 @@
</tr> </tr>
<tr> <tr>
<th>Word count</th> <th>Word count</th>
<td ng-bind-template="{{::article.stats.wordCount}} ({{::article.stats.processedWordCount}} &darr; {{::Vipra.toPercent(article.stats.reductionRatio)}}%)" ng-attr-title="{{::article.stats.wordCount}} words in this article, {{::article.stats.processedWordCount}} after cleaning ({{::Vipra.toPercent(article.stats.reductionRatio)}}% reduction)"></td> <td>
<span ng-bind-template="{{::article.stats.wordCount}} ({{::article.stats.processedWordCount}} &darr; {{::Vipra.toPercent(article.stats.reductionRatio)}}%)" ng-attr-title="{{::article.stats.wordCount}} words in this article, {{::article.stats.processedWordCount}} after cleaning ({{::Vipra.toPercent(article.stats.reductionRatio)}}% reduction)"></span>
<info text="Total word count, processed word count (words after reduction) and reduction ratio (processed text share to original text)"/>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h3>Topics</h3> <h3>Topics</h3>
<table class="table table-bordered table-condensed table-fixed" ng-show="article.topics.length" ng-cloak> <table class="table table-bordered table-condensed table-fixed nomargin" ng-show="article.topics.length" ng-cloak>
<thead> <thead>
<tr> <tr>
<th class="infocol" ng-model="articlesShowModels.topicsSort" sort-by="share">Share</th> <th class="infocol" ng-model="articlesShowModels.topicsSort" sort-by="share">Share</th>
...@@ -75,10 +78,10 @@ ...@@ -75,10 +78,10 @@
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<h3>Share</h3> <h3>Share</h3>
<div class="pie-chart" id="topic-share" highcharts="topicShare" ng-class="{'pie-small':!article.topics.length}"></div> <div class="pie-chart" id="topic-share" highcharts="topicShare" ng-class="{'pie-small':!article.topics.length}" style="width:360px;height:220px"></div>
</div> </div>
</div> </div>
<h3>Similar articles</h3> <h3>Similar articles <info text="Similar articles are determined based on topic share. Higher topic share results in higher share ratio."/></h3>
<table class="table table-bordered table-condensed" ng-show="article.similarArticles.length" ng-cloak> <table class="table table-bordered table-condensed" ng-show="article.similarArticles.length" ng-cloak>
<thead> <thead>
<tr> <tr>
...@@ -147,7 +150,7 @@ ...@@ -147,7 +150,7 @@
<th ng-model="articlesShowModels.wordsSort" sort-by="id">Word</th> <th ng-model="articlesShowModels.wordsSort" sort-by="id">Word</th>
<th ng-model="articlesShowModels.wordsSort" sort-by="count">Count</th> <th ng-model="articlesShowModels.wordsSort" sort-by="count">Count</th>
<th>Share</th> <th>Share</th>
<th>Reduced share</th> <th>Reduced share <info text="Word share applied on the processed text"/></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
...@@ -3,5 +3,35 @@ ...@@ -3,5 +3,35 @@
<span class="label label-default">Word</span> <span class="label label-default">Word</span>
<h1 ng-bind="::word.id"></h1> <h1 ng-bind="::word.id"></h1>
</div> </div>
<div>
<ul class="nav nav-tabs" role="tablist">
<li class="active">
<a data-target=".tab-info" data-toggle="tab" bs-tab><i class="fa fa-file-text-o"></i></a>
</li>
<li>
<a ui-sref="words.show.topics({id:word.id})">
Topics
</a>
</li>
<li>
<a ui-sref="words.show.articles({id:word.id})">
Articles
</a>
</li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active tab-info">
<h3>Info</h3>
<table class="table table-bordered table-condensed table-fixed">
<tbody>
<tr>
<th class="infocol">ID</th>
<td ng-bind="::word.id"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div> </div>
<div ng-cloak ui-view></div> <div ng-cloak ui-view></div>
\ No newline at end of file
...@@ -454,4 +454,14 @@ ...@@ -454,4 +454,14 @@
}; };
}]); }]);
app.directive('info', [function() {
return {
scope: {
text: '@'
},
replace: true,
template: '<i class="fa fa-info info" ng-attr-title="{{::text}}"></i>'
};
}]);
})(); })();
\ No newline at end of file
...@@ -11,6 +11,7 @@ body { ...@@ -11,6 +11,7 @@ body {
padding-bottom: 20px; padding-bottom: 20px;
} }
.info,
.pointer, .pointer,
input[type=checkbox], input[type=checkbox],
.checkbox label::before, .checkbox label::before,
...@@ -564,6 +565,12 @@ entity-menu { ...@@ -564,6 +565,12 @@ entity-menu {
color: #555; color: #555;
} }
.info {
color: #777;
padding: 0 5px;
font-size: 14px;
}
@-moz-keyframes spin { @-moz-keyframes spin {
100% { 100% {
-moz-transform: rotateY(360deg); -moz-transform: rotateY(360deg);
......
...@@ -32,6 +32,9 @@ public class BugReport implements Model<ObjectId>, Serializable { ...@@ -32,6 +32,9 @@ public class BugReport implements Model<ObjectId>, Serializable {
@QueryIgnore(multi = true) @QueryIgnore(multi = true)
private Date created; private Date created;
@QueryIgnore(multi = true)
private Date modified;
@QueryIgnore(multi = true) @QueryIgnore(multi = true)
private String screenshot; private String screenshot;
...@@ -94,8 +97,10 @@ public class BugReport implements Model<ObjectId>, Serializable { ...@@ -94,8 +97,10 @@ public class BugReport implements Model<ObjectId>, Serializable {
} }
@PrePersist @PrePersist
private void prePersist() { public void prePersist() {
created = new Date(); modified = new Date();
if (created == null)
created = modified;
} }
} }
package de.vipra.util.model; package de.vipra.util.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Embedded; import org.mongodb.morphia.annotations.Embedded;
import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id; import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.PrePersist;
import org.mongodb.morphia.annotations.Reference; import org.mongodb.morphia.annotations.Reference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
...@@ -40,6 +42,10 @@ public class SequenceFull implements Model<ObjectId>, Comparable<SequenceFull>, ...@@ -40,6 +42,10 @@ public class SequenceFull implements Model<ObjectId>, Comparable<SequenceFull>,
@QueryIgnore(multi = true) @QueryIgnore(multi = true)
private List<SequenceWord> words; private List<SequenceWord> words;
private Date created;
private Date modified;
@Override @Override
public ObjectId getId() { public ObjectId getId() {
return id; return id;
...@@ -109,4 +115,11 @@ public class SequenceFull implements Model<ObjectId>, Comparable<SequenceFull>, ...@@ -109,4 +115,11 @@ public class SequenceFull implements Model<ObjectId>, Comparable<SequenceFull>,
+ topic + ", words=" + words + "]"; + topic + ", words=" + words + "]";
} }
@PrePersist
public void prePersist() {
modified = new Date();
if (created == null)
created = modified;
}
} }
package de.vipra.util.model; package de.vipra.util.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id; import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.PrePersist;
import org.mongodb.morphia.annotations.Reference; import org.mongodb.morphia.annotations.Reference;
import de.vipra.util.an.QueryIgnore; import de.vipra.util.an.QueryIgnore;
...@@ -25,6 +27,10 @@ public class TextEntityFull implements Model<String>, Serializable { ...@@ -25,6 +27,10 @@ public class TextEntityFull implements Model<String>, Serializable {
@QueryIgnore(multi = true) @QueryIgnore(multi = true)
private List<String> types; private List<String> types;
private Date created;
private Date modified;
public TextEntityFull() {} public TextEntityFull() {}
public TextEntityFull(final TextEntity textEntity) { public TextEntityFull(final TextEntity textEntity) {
...@@ -96,4 +102,11 @@ public class TextEntityFull implements Model<String>, Serializable { ...@@ -96,4 +102,11 @@ public class TextEntityFull implements Model<String>, Serializable {
return true; return true;
} }
@PrePersist
public void prePersist() {
modified = new Date();
if (created == null)
created = modified;
}
} }
...@@ -7,6 +7,7 @@ import java.util.List; ...@@ -7,6 +7,7 @@ import java.util.List;
import org.mongodb.morphia.annotations.Embedded; import org.mongodb.morphia.annotations.Embedded;
import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id; import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.PrePersist;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
...@@ -39,6 +40,10 @@ public class TopicModelFull implements Model<String>, Comparable<TopicModelFull> ...@@ -39,6 +40,10 @@ public class TopicModelFull implements Model<String>, Comparable<TopicModelFull>
@QueryIgnore(multi = true) @QueryIgnore(multi = true)
private TopicModelConfig modelConfig; private TopicModelConfig modelConfig;
private Date created;
private Date modified;
public TopicModelFull() {} public TopicModelFull() {}
public TopicModelFull(final String id) { public TopicModelFull(final String id) {
...@@ -128,6 +133,13 @@ public class TopicModelFull implements Model<String>, Comparable<TopicModelFull> ...@@ -128,6 +133,13 @@ public class TopicModelFull implements Model<String>, Comparable<TopicModelFull>
@Override @Override
public int compareTo(final TopicModelFull o) { public int compareTo(final TopicModelFull o) {
return id.compareTo(o.getId()); return id.compareTo(o.getId());
}; }
@PrePersist
public void prePersist() {
modified = new Date();
if (created == null)
created = modified;
}
} }
package de.vipra.util.model; package de.vipra.util.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id; import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.PrePersist;
import org.mongodb.morphia.annotations.Reference; import org.mongodb.morphia.annotations.Reference;
import de.vipra.util.an.QueryIgnore; import de.vipra.util.an.QueryIgnore;
...@@ -19,6 +21,10 @@ public class WordFull implements Model<String>, Comparable<WordFull>, Serializab ...@@ -19,6 +21,10 @@ public class WordFull implements Model<String>, Comparable<WordFull>, Serializab
@QueryIgnore(multi = true) @QueryIgnore(multi = true)
private TopicModel topicModel; private TopicModel topicModel;
private Date created;
private Date modified;
public WordFull() {} public WordFull() {}
public WordFull(final String word) { public WordFull(final String word) {
...@@ -43,9 +49,32 @@ public class WordFull implements Model<String>, Comparable<WordFull>, Serializab ...@@ -43,9 +49,32 @@ public class WordFull implements Model<String>, Comparable<WordFull>, Serializab
this.topicModel = topicModel; this.topicModel = topicModel;
} }
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
@Override @Override
public int compareTo(final WordFull o) { public int compareTo(final WordFull o) {
return id.compareTo(o.getId()); return id.compareTo(o.getId());
} }
@PrePersist
public void prePersist() {
modified = new Date();
if (created == null)
created = modified;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment