sum7/warehost-frontend
sum7
/
warehost-frontend
Archived
1
0
Fork 0

markdown try

This commit is contained in:
Martin Geno 2016-09-27 10:02:50 +02:00
parent ad49e34e53
commit 1aa06051b5
7 changed files with 41 additions and 30 deletions

View File

@ -21,6 +21,7 @@
"ng-table": "^1.0.0", "ng-table": "^1.0.0",
"angular-ui-select": "^0.19.4", "angular-ui-select": "^0.19.4",
"angular-sanitize": "^1.5.8", "angular-sanitize": "^1.5.8",
"angular-ui-tree": "^2.21.2" "angular-ui-tree": "^2.21.2",
"Angular-Markdown-Editor": "angular-markdown-editor#*"
} }
} }

View File

@ -33,5 +33,9 @@
}, },
"scripts": { "scripts": {
"start": "grunt serve" "start": "grunt serve"
},
"dependencies": {
"grunt": "^0.4.5",
"grunt-cli": "^1.2.0"
} }
} }

View File

@ -6,6 +6,7 @@ angular.module('warehost', [
'ui.bootstrap', 'ui.bootstrap',
'ui.select', 'ui.select',
'ui.tree', 'ui.tree',
'ui.markdown',
'ngTable', 'ngTable',
'config', 'config',
'session', 'session',

View File

@ -57,6 +57,5 @@
span.glyphicon.glyphicon-log-in span.glyphicon.glyphicon-log-in
div(style="margin-top:53px;") div(style="margin-top:53px;")
.container(ng-if="error.msg") .container(ng-if="error.msg")
.alert.alert-danger(style="margin-top:20px;") .alert.alert-danger(style="margin-top:20px;") {{error.msg}}
{{error.msg}}
div(ui-view="") div(ui-view="")

View File

@ -1,28 +1,30 @@
.container .container
h1 Pages h1 Pages
a.btn.btn-default(ng-click="isAdding=true") .row
.well.col-md-6(ui-tree)
.btn-toolbar
.btn-group
a.btn.btn-default(ng-click="add(null)")
span.glyphicon.glyphicon-plus span.glyphicon.glyphicon-plus
form(ng-submit="add()",name="addform",ng-if="isAdding") br
.list-group
.list-group-item(ng-repeat="item in list") {{item.title}}
form.col-md-6(ng-submit="save()")
h3(ng-if="obj.ID") Edit
h3(ng-if="!obj.ID") New
.form-group .form-group
label(for="name") Name label(for="title") Title
input.form-control(id="name",name="name",ng-model="obj.name",ng-minlength="3") input.form-control(id="title",ng-model="obj.title")
button.btn.btn-primary(type="submit") .form-group
span.glyphicon.glyphicon-floppy-disk label Under Menu
| Save i (http(s)://PLACEHOLDER/{{obj.menu.url}})
table.table.table-bordered(ng-table="tableParams") ui-select(ng-model="obj.menu",theme="bootstrap")
tr(ng-hide='group.$hideRows',ng-repeat="item in $data") ui-select-match {{$select.selected.name}}
td(data-title="'#'") {{item.website.ID}} ui-select-choices(repeat="item in menulist | filter:$select.search")
td(data-title="'Name'") div(ng-bind-html="item.name | highlight: $select.search")
span(ng-if="!item.isEditing") {{item.website.name}} .form-group
form(name="myform",ng-if="item.isEditing") label(for="content") Content
.form-group(ng-class="{'has-error': (error.fields.indexOf('name') >= 0 || !myform.name.$valid)}") textarea.form-control(id="content",ui-markdown-editor="{}",ng-model="obj.content")
label(for="name") Name input.btn.btn-default(type="submit",value="Save")
input.form-control(id="name",name="name",ng-model="item.website.name") h3 Preview
td(data-title="'Option'") div(ng-bind-markdown="obj.content")
.btn-group.btn-group-xs
span.btn.btn-default(ng-click="item.isEditing = true",ng-if="!item.isEditing")
span.glyphicon.glyphicon-pencil
span.btn.btn-default(ng-click="edit(item)",ng-if="item.isEditing")
span.glyphicon.glyphicon-remove-circle
span.btn.btn-default(ng-click="delete(item)")
span.glyphicon.glyphicon-trash

View File

@ -2,7 +2,7 @@
angular.module('config', []) angular.module('config', [])
.factory('config', function() { .factory('config', function() {
return { return {
api: 'http://[::1]:8080', api: 'https://apiv2.warehost.de',
table: { table: {
count: 25 count: 25
} }

View File

@ -18,6 +18,7 @@
<link rel="stylesheet" href="bower_components/ng-table/dist/ng-table.css" /> <link rel="stylesheet" href="bower_components/ng-table/dist/ng-table.css" />
<link rel="stylesheet" href="bower_components/angular-ui-select/dist/select.css" /> <link rel="stylesheet" href="bower_components/angular-ui-select/dist/select.css" />
<link rel="stylesheet" href="bower_components/angular-ui-tree/dist/angular-ui-tree.css" /> <link rel="stylesheet" href="bower_components/angular-ui-tree/dist/angular-ui-tree.css" />
<link rel="stylesheet" href="bower_components/codemirror/lib/codemirror.css" />
<!-- endbower --> <!-- endbower -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" /> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="bower_components/bootswatch/paper/bootstrap.min.css" /> <link rel="stylesheet" href="bower_components/bootswatch/paper/bootstrap.min.css" />
@ -45,6 +46,9 @@
<script src="bower_components/ng-table/dist/ng-table.js"></script> <script src="bower_components/ng-table/dist/ng-table.js"></script>
<script src="bower_components/angular-ui-select/dist/select.js"></script> <script src="bower_components/angular-ui-select/dist/select.js"></script>
<script src="bower_components/angular-ui-tree/dist/angular-ui-tree.js"></script> <script src="bower_components/angular-ui-tree/dist/angular-ui-tree.js"></script>
<script src="bower_components/showdown/src/showdown.js"></script>
<script src="bower_components/codemirror/lib/codemirror.js"></script>
<script src="bower_components/Angular-Markdown-Editor/demo/dist/angular-markdown-editor.js"></script>
<!-- endbower --> <!-- endbower -->
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script> <script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<!-- endbuild --> <!-- endbuild -->