Browse files

draft marking

add draft only filter
prevent from submitting on pressing enter key.
  • Loading branch information...
1 parent c23593e commit e9c97ba40cc59978866143013e2f87e68ec836c5 @yssk22 committed May 12, 2011
View
18 apps/posts/_attachments/css/posts.css
@@ -126,6 +126,12 @@
padding: 5px;
font-size: 10.5pt;
}
+.posts.admin .main div.list.onlyDraft article.post {
+ display: none;
+}
+.posts.admin .main div.list.onlyDraft article.post.draft {
+ display: block;
+}
.posts.admin .main article.post header {
float: left;
margin-right: 10px;
@@ -157,12 +163,12 @@
padding-bottom: 3px;
margin-bottom: 3px;
}
-.posts.admin .main article.post footer:nth-of-type(odd) {
- background-color: #dddddd;
-}
-.posts.admin .main article.post footer:nth-of-type(even) {
- background-color: #ffffff;
-}
.posts.admin .main article.post .content {
display: none;
}
+.posts.admin .main article.post.draft {
+ background-color: #dddddd;
+}
+.posts.admin .main article.post.draft h3:before {
+ content: '[Draft]';
+}
View
67 apps/posts/_attachments/css/posts.less
@@ -103,39 +103,50 @@
.posts.admin {
- .main article.post {
- header {
- .span-7;
- padding-top: 3px;
- padding-left: 10px;
- h3 {
- display:inline;
- font-size: 10pt;
- border: none;
+ .main {
+ div.list.onlyDraft {
+ article.post {
+ display: none;
}
- }
- ul.tags {
- .span-4;
- padding-top: 3px;
- text-align: left;
- li {
- display:inline;
+ article.post.draft {
+ display: block;
}
}
- footer {
- .last;
- border: 1px solid @border-color;
- padding-right: 10px;
- padding-bottom: 3px;
- margin-bottom: 3px;
+
+ article.post {
+ header {
+ .span-7;
+ padding-top: 3px;
+ padding-left: 10px;
+ h3 {
+ display:inline;
+ font-size: 10pt;
+ border: none;
+ }
+ }
+ ul.tags {
+ .span-4;
+ padding-top: 3px;
+ text-align: left;
+ li {
+ display:inline;
+ }
+ }
+ footer {
+ .last;
+ border: 1px solid @border-color;
+ padding-right: 10px;
+ padding-bottom: 3px;
+ margin-bottom: 3px;
+ }
+ .content { display: none; }
}
- footer:nth-of-type(odd){
+
+ article.post.draft {
+ h3:before {
+ content: '[Draft]';
+ }
background-color: @border-color;
}
- footer:nth-of-type(even){
- background-color: #ffffff;
- }
-
- .content { display: none; }
}
}
View
5 apps/posts/_attachments/js/admin.js
@@ -0,0 +1,5 @@
+$(function(){
+ $('#onlyDraft').click(function(){
+ $('div.list').toggleClass('onlyDraft');
+ });
+});
View
9 apps/posts/_attachments/js/posts.js
@@ -67,6 +67,15 @@
target.unbind('submit', onSubmit);
target.bind('submit', onSubmit);
$('#cancel').click(onCancel);
+
+ target.find('input').keypress(function(e){
+ if( e.which === 13 || e.keyCode === 13 ){
+ return false;
+ }else{
+ return true;
+ }
+ });
+
};
$.fn.bindDelete = function(){
View
1 apps/posts/_attachments/messages/en.json
@@ -24,6 +24,7 @@
"---- form elements" : "",
"posts.submit": "Submit",
"posts.cancel": "Cancel",
+ "posts.displayOnlyDraft": "Display only draft posts",
"_____" : "EOF"
}
View
5 apps/posts/_attachments/templates/admin/index.ejs
@@ -1,9 +1,14 @@
<% title(_("posts.admin.managePosts")) %>
+<% js(url('js/admin.js')) %>
<div class="posts admin">
<h2><%= _("posts.admin.managePosts") %></h2>
<div class="main">
<% if( posts.data.length > 0 ){ %>
<div class="list">
+ <form>
+ <input type="checkbox" id="onlyDraft" name="onlyDraft" />
+ <label for="onlyDraft"><%= _("posts.displayOnlyDraft") %></label>
+ </form>
<%- partial('parts/posts', {object: posts.data, as: this}) %>
<div class="readmore" data-apipath="<%= url('/admin/-/') %>">
<%= _('posts.read_more') %>

0 comments on commit e9c97ba

Please sign in to comment.