Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
38e0da3a
Commit
38e0da3a
authored
Dec 23, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image field css and preview
resolves #71
parent
0b5f048f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
8 deletions
+62
-8
app.css
app/app.css
+22
-1
directives.js
app/shared/directives.js
+2
-0
filefield.html
app/shared/templates/filefield.html
+6
-2
form_service.js
app/zetalib/form_service.js
+3
-1
app.js
dist/app.js
+2
-2
app.css
dist/css/app.css
+21
-0
templates.js
dist/templates.js
+6
-2
No files found.
app/app.css
View file @
38e0da3a
...
@@ -1734,4 +1734,25 @@ table.dataTable thead .sorting:after {
...
@@ -1734,4 +1734,25 @@ table.dataTable thead .sorting:after {
/* end page transitions */
/* end page transitions */
.move-to-bottom
,
.move-to-top
,
.move-to-bottom-modal
,
.move-to-top-modal
{
.move-to-bottom
,
.move-to-top
,
.move-to-bottom-modal
,
.move-to-top-modal
{
margin-right
:
10px
!important
;
margin-right
:
10px
!important
;
}
}
\ No newline at end of file
/* file upload button */
.fileUpload
{
position
:
relative
;
overflow
:
hidden
;
margin
:
10px
;
}
.fileUpload
input
.upload
{
position
:
absolute
;
top
:
0
;
right
:
0
;
margin
:
0
;
padding
:
0
;
font-size
:
20px
;
cursor
:
pointer
;
opacity
:
0
;
filter
:
alpha
(
opacity
=
0
);
}
/* end file upload */
\ No newline at end of file
app/shared/directives.js
View file @
38e0da3a
...
@@ -357,6 +357,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
...
@@ -357,6 +357,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
$rootScope
.
searchInputs
=
data
;
$rootScope
.
searchInputs
=
data
;
$rootScope
.
current_user
=
data
.
current_user
;
$rootScope
.
current_user
=
data
.
current_user
;
$rootScope
.
settings
=
data
.
settings
;
$scope
.
menuItems
=
$scope
.
prepareMenu
({
other
:
$scope
.
allMenuItems
.
other
});
$scope
.
menuItems
=
$scope
.
prepareMenu
({
other
:
$scope
.
allMenuItems
.
other
});
...
@@ -553,6 +554,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
...
@@ -553,6 +554,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
file_name
:
changeEvent
.
target
.
files
[
0
].
name
,
file_name
:
changeEvent
.
target
.
files
[
0
].
name
,
file_content
:
scope
.
$parent
.
model
[
changeEvent
.
target
.
name
]
file_content
:
scope
.
$parent
.
model
[
changeEvent
.
target
.
name
]
}
}
document
.
querySelector
(
'#image-preview'
).
src
=
URL
.
createObjectURL
(
changeEvent
.
target
.
files
[
0
]);
});
});
}
}
reader
.
readAsDataURL
(
changeEvent
.
target
.
files
[
0
]);
reader
.
readAsDataURL
(
changeEvent
.
target
.
files
[
0
]);
...
...
app/shared/templates/filefield.html
View file @
38e0da3a
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
{{form.title}}
{{form.title}}
</label>
</label>
<div
class=
"form-group input-group"
>
<div
class=
"form-group input-group fileUpload btn btn-primary"
>
<span>
Dosya seç
</span>
<input
type=
"file"
<input
type=
"file"
ng-model=
"$$value$$"
ng-model=
"$$value$$"
fileread=
"$$value$$"
fileread=
"$$value$$"
...
@@ -12,11 +13,14 @@
...
@@ -12,11 +13,14 @@
ng-model-options=
"form.ngModelOptions"
ng-model-options=
"form.ngModelOptions"
ng-disabled=
"form.readonly"
ng-disabled=
"form.readonly"
sf-changed=
"form"
sf-changed=
"form"
class=
"form-control {{form.fieldHtmlClass}}"
class=
"form-control {{form.fieldHtmlClass}}
upload
"
schema-validate=
"form"
schema-validate=
"form"
ng-change=
"form.fileInsert()"
ng-change=
"form.fileInsert()"
name=
"{{form.name}}"
/>
name=
"{{form.name}}"
/>
</div>
</div>
<img
ng-show=
"form.avatar"
src=
"{{form.imageSrc || 'img/empty-profile-pic.jpg'}}"
alt=
""
id=
"image-preview"
style=
"width:
100px;"
class=
"pull-left"
>
<div
class=
"help-block"
sf-message=
"form.description"
></div>
<div
class=
"help-block"
sf-message=
"form.description"
></div>
</div>
</div>
\ No newline at end of file
app/zetalib/form_service.js
View file @
38e0da3a
...
@@ -215,7 +215,9 @@ angular.module('formService', ['ui.bootstrap'])
...
@@ -215,7 +215,9 @@ angular.module('formService', ['ui.bootstrap'])
key
:
k
,
key
:
k
,
fileInsert
:
function
()
{
fileInsert
:
function
()
{
$scope
.
$broadcast
(
'schemaForm.error.'
+
k
,
'tv4-302'
,
true
);
$scope
.
$broadcast
(
'schemaForm.error.'
+
k
,
'tv4-302'
,
true
);
}
},
imageSrc
:
scope
.
model
[
k
]
?
$rootScope
.
settings
.
static_url
+
scope
.
model
[
k
]
:
''
,
avatar
:
k
===
'avatar'
?
true
:
false
};
};
v
.
type
=
'string'
;
v
.
type
=
'string'
;
}
}
...
...
dist/app.js
View file @
38e0da3a
This diff is collapsed.
Click to expand it.
dist/css/app.css
View file @
38e0da3a
...
@@ -1749,6 +1749,27 @@ table.dataTable thead .sorting:after {
...
@@ -1749,6 +1749,27 @@ table.dataTable thead .sorting:after {
margin-right
:
10px
!important
;
margin-right
:
10px
!important
;
}
}
/* file upload button */
.fileUpload
{
position
:
relative
;
overflow
:
hidden
;
margin
:
10px
;
}
.fileUpload
input
.upload
{
position
:
absolute
;
top
:
0
;
right
:
0
;
margin
:
0
;
padding
:
0
;
font-size
:
20px
;
cursor
:
pointer
;
opacity
:
0
;
filter
:
alpha
(
opacity
=
0
);
}
/* end file upload */
/*
/*
* metismenu - v1.1.3
* metismenu - v1.1.3
* Easy menu jQuery plugin for Twitter Bootstrap 3
* Easy menu jQuery plugin for Twitter Bootstrap 3
...
...
dist/templates.js
View file @
38e0da3a
...
@@ -1571,7 +1571,8 @@ angular.module("shared/templates/filefield.html", []).run(["$templateCache", fun
...
@@ -1571,7 +1571,8 @@ angular.module("shared/templates/filefield.html", []).run(["$templateCache", fun
" {{form.title}}
\n
"
+
" {{form.title}}
\n
"
+
" </label>
\n
"
+
" </label>
\n
"
+
"
\n
"
+
"
\n
"
+
" <div class=
\"
form-group input-group
\"
>
\n
"
+
" <div class=
\"
form-group input-group fileUpload btn btn-primary
\"
>
\n
"
+
" <span>Dosya seç</span>
\n
"
+
" <input type=
\"
file
\"\n
"
+
" <input type=
\"
file
\"\n
"
+
" ng-model=
\"
$$value$$
\"\n
"
+
" ng-model=
\"
$$value$$
\"\n
"
+
" fileread=
\"
$$value$$
\"\n
"
+
" fileread=
\"
$$value$$
\"\n
"
+
...
@@ -1579,12 +1580,15 @@ angular.module("shared/templates/filefield.html", []).run(["$templateCache", fun
...
@@ -1579,12 +1580,15 @@ angular.module("shared/templates/filefield.html", []).run(["$templateCache", fun
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
" ng-disabled=
\"
form.readonly
\"\n
"
+
" ng-disabled=
\"
form.readonly
\"\n
"
+
" sf-changed=
\"
form
\"\n
"
+
" sf-changed=
\"
form
\"\n
"
+
" class=
\"
form-control {{form.fieldHtmlClass}}
\"\n
"
+
" class=
\"
form-control {{form.fieldHtmlClass}}
upload
\"\n
"
+
" schema-validate=
\"
form
\"\n
"
+
" schema-validate=
\"
form
\"\n
"
+
" ng-change=
\"
form.fileInsert()
\"\n
"
+
" ng-change=
\"
form.fileInsert()
\"\n
"
+
" name=
\"
{{form.name}}
\"
/>
\n
"
+
" name=
\"
{{form.name}}
\"
/>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
"
\n
"
+
" <img ng-show=
\"
form.avatar
\"
src=
\"
{{form.imageSrc || 'img/empty-profile-pic.jpg'}}
\"
alt=
\"\"
id=
\"
image-preview
\"
style=
\"
width:
\n
"
+
" 100px;
\"
class=
\"
pull-left
\"
>
\n
"
+
"
\n
"
+
" <div class=
\"
help-block
\"
sf-message=
\"
form.description
\"
></div>
\n
"
+
" <div class=
\"
help-block
\"
sf-message=
\"
form.description
\"
></div>
\n
"
+
"</div>"
);
"</div>"
);
}]);
}]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment