Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Markech
refinerycms-photo-gallery
Commits
5b62f3a2
Commit
5b62f3a2
authored
Sep 25, 2012
by
Martin Markech
Browse files
refactored admin views and fix admin ajax pagination
parent
ddfd8168
Changes
8
Hide whitespace changes
Inline
Side-by-side
app/views/refinery/photo_gallery/admin/_submenu.html.erb
View file @
5b62f3a2
...
...
@@ -7,45 +7,45 @@
:url
=>
refinery
.
photo_gallery_admin_collections_path
}
%>
<%
elsif
params
[
:controller
]
==
"refinery/photo_gallery/admin/albums"
%>
<%=
render
:partial
=>
"/refinery/admin/search"
,
:locals
=>
{
:url
=>
refinery
.
photo_gallery_admin_albums_path
}
%>
<%
end
%>
</li>
</ul>
<%=
render
:partial
=>
"/refinery/admin/search"
,
:locals
=>
{
:url
=>
refinery
.
photo_gallery_admin_albums_path
}
%>
<%
end
%>
</li>
</ul>
<ul
class=
'collapsible_menu'
>
<li
class=
'not_a_link'
>
<%=
link_to
t
(
'.
collection
s.title'
),
'#'
,
:class
=>
'
folder
_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
collection
s.manage'
),
refinery
.
photo_gallery_admin_
collection
s_path
,
:class
=>
'
folder
_edit_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
collection
s.new'
),
refinery
.
new_photo_gallery_admin_
collection
_path
,
:class
=>
'
folder
_add_icon'
%>
</li>
</ul>
<ul
class=
'collapsible_menu'
>
<li
class=
'not_a_link'
>
<%=
link_to
t
(
'.
album
s.title'
),
'#'
,
:class
=>
'
album
_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
album
s.manage'
),
refinery
.
photo_gallery_admin_
album
s_path
,
:class
=>
'
album
_edit_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
album
s.new'
),
refinery
.
new_photo_gallery_admin_
album
_path
,
:class
=>
'
album
_add_icon'
%>
</li>
</ul>
<ul
class=
'collapsible_menu'
>
<li
class=
'not_a_link'
>
<%=
link_to
t
(
'.
album
s.title'
),
'#'
,
:class
=>
'
album
_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
album
s.manage'
),
refinery
.
photo_gallery_admin_
album
s_path
,
:class
=>
'
album
_edit_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
album
s.new'
),
refinery
.
new_photo_gallery_admin_
album
_path
,
:class
=>
'
album
_add_icon'
%>
</li>
</ul>
<ul
class=
'collapsible_menu'
>
<li
class=
'not_a_link'
>
<%=
link_to
t
(
'.
collection
s.title'
),
'#'
,
:class
=>
'
folder
_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
collection
s.manage'
),
refinery
.
photo_gallery_admin_
collection
s_path
,
:class
=>
'
folder
_edit_icon'
%>
</li>
<li>
<%=
link_to
t
(
'.
collection
s.new'
),
refinery
.
new_photo_gallery_admin_
collection
_path
,
:class
=>
'
folder
_add_icon'
%>
</li>
</ul>
</nav>
</nav>
<%
content_for
:stylesheets
,
stylesheet_link_tag
(
'refinery/photo_gallery/admin/backend'
)
%>
<%
content_for
:stylesheets
,
stylesheet_link_tag
(
'refinery/photo_gallery/admin/backend'
)
%>
app/views/refinery/photo_gallery/admin/albums/_albums.html.erb
0 → 100644
View file @
5b62f3a2
<%=
will_paginate
@albums
%>
<ul>
<%=
render
:partial
=>
'album'
,
:collection
=>
@albums
%>
</ul>
\ No newline at end of file
app/views/refinery/photo_gallery/admin/albums/_sortable_list.html.erb
deleted
100644 → 0
View file @
ddfd8168
<ul
id=
'sortable_list'
>
<%=
render
:partial
=>
'album'
,
:collection
=>
@albums
%>
</ul>
<%=
render
:partial
=>
"/refinery/admin/sortable_list"
,
:locals
=>
{
:continue_reordering
=>
(
defined?
(
continue_reordering
)
?
continue_reordering
:
true
)
}
%>
app/views/refinery/photo_gallery/admin/albums/index.html.erb
View file @
5b62f3a2
<%=
render
:partial
=>
'/refinery/photo_gallery/admin/submenu'
%>
<div
id=
'records'
>
<section
id=
'records'
>
<%
if
searching?
%>
<h2>
<%=
t
(
'results_for'
,
:scope
=>
'refinery.admin.search'
,
:query
=>
params
[
:search
])
%>
</h2>
<%
if
@albums
.
any?
%>
<ul>
<%=
render
:partial
=>
"album"
,
:collection
=>
@albums
%>
</ul>
<%
else
%>
<p>
<%=
t
(
'no_results'
,
:scope
=>
'refinery.admin.search'
)
%>
</p>
<%
end
%>
<%
else
%>
<%
if
@albums
.
any?
%>
<%=
will_paginate
@albums
%>
<%=
render
:partial
=>
"sortable_list"
%>
<%=
will_paginate
@albums
%>
<%
else
%>
<p>
<strong>
<%=
t
(
'.no_items_yet'
,
:create
=>
t
(
'new'
,
:scope
=>
'refinery.photo_gallery.admin.submenu.albums'
))
%>
</strong>
</p>
<%
end
%>
<%
end
%>
</div>
<div
class=
'pagination_container'
>
<%
if
@albums
.
any?
%>
<%=
render
"albums"
%>
<%
else
%>
<p>
<%
unless
searching?
%>
<strong>
<%=
t
(
'.no_items_yet'
,
:create
=>
t
(
'new'
,
:scope
=>
'refinery.photo_gallery.admin.submenu.albums'
))
%>
</strong>
<%
else
%>
<%=
t
(
'no_results'
,
:scope
=>
'refinery.admin.search'
)
%>
<%
end
%>
</p>
<%
end
%>
</div>
</section>
<%=
render
:partial
=>
'/refinery/photo_gallery/admin/submenu'
%>
\ No newline at end of file
app/views/refinery/photo_gallery/admin/collections/_collections.html.erb
0 → 100644
View file @
5b62f3a2
<%=
will_paginate
@collections
%>
<ul>
<%=
render
:partial
=>
'collection'
,
:collection
=>
@collections
%>
</ul>
\ No newline at end of file
app/views/refinery/photo_gallery/admin/collections/_sortable_list.html.erb
deleted
100644 → 0
View file @
ddfd8168
<ul
id=
'sortable_list'
>
<%=
render
:partial
=>
'collection'
,
:collection
=>
@collections
%>
</ul>
<%=
render
:partial
=>
"/refinery/admin/sortable_list"
,
:locals
=>
{
:continue_reordering
=>
(
defined?
(
continue_reordering
)
?
continue_reordering
:
true
)
}
%>
app/views/refinery/photo_gallery/admin/collections/index.html.erb
View file @
5b62f3a2
<%=
render
:partial
=>
'/refinery/photo_gallery/admin/submenu'
%>
<div
id=
'records'
>
<section
id=
'records'
>
<%
if
searching?
%>
<h2>
<%=
t
(
'results_for'
,
:scope
=>
'refinery.admin.search'
,
:query
=>
params
[
:search
])
%>
</h2>
<%
if
@collections
.
any?
%>
<ul>
<%=
render
:partial
=>
"collection"
,
:collection
=>
@collections
%>
</ul>
<%
else
%>
<p>
<%=
t
(
'no_results'
,
:scope
=>
'refinery.admin.search'
)
%>
</p>
<%
end
%>
<%
else
%>
<%
if
@collections
.
any?
%>
<%=
will_paginate
@collections
%>
<%=
render
:partial
=>
"sortable_list"
%>
<%=
will_paginate
@collections
%>
<%
else
%>
<p>
<strong>
<%=
t
(
'.no_items_yet'
,
:create
=>
t
(
'new'
,
:scope
=>
'refinery.photo_gallery.admin.submenu.collections'
))
%>
</strong>
</p>
<%
end
%>
<%
end
%>
</div>
\ No newline at end of file
<div
class=
'pagination_container'
>
<%
if
@collections
.
any?
%>
<%=
render
"collections"
%>
<%
else
%>
<p>
<%
unless
searching?
%>
<strong>
<%=
t
(
'.no_items_yet'
,
:create
=>
t
(
'new'
,
:scope
=>
'refinery.photo_gallery.admin.submenu.collections'
))
%>
</strong>
<%
else
%>
<%=
t
(
'no_results'
,
:scope
=>
'refinery.admin.search'
)
%>
<%
end
%>
</p>
<%
end
%>
</div>
</section>
<%=
render
:partial
=>
'/refinery/photo_gallery/admin/submenu'
%>
\ No newline at end of file
app/views/refinery/photo_gallery/admin/collections/test.html.erb
deleted
100644 → 0
View file @
ddfd8168
<%=
form
.
label
:title
,
:Title
,
{
:class
=>
'big'
}
%>
<br
/>
<%=
form
.
text_field
:title
,
{
:class
=>
'big'
}
%>
<br
/>
<%=
form
.
label
:description
%>
<br
/>
<%=
form
.
text_area
:description
%>
<br
/>
<%
unless
@collection
.
albums
.
empty?
%>
<%=
form
.
label
:albums
%>
<br
/>
<div
id=
"collection_albums"
>
<%
for
album
in
@collection
.
albums
%>
<%=
form
.
fields_for
:album_list
do
|
album_fields
|
%>
<span>
<%=
image_tag
"delete-24x24.png"
,
:class
=>
"delete"
,
:alt
=>
"Delete"
-%>
<%
if
album
.
photos
.
empty?
%>
<%=
album
.
title
%>
<%
else
%>
<%=
image_tag
album
.
photos
.
first
.
file
.
album
.
url
,
:alt
=>
album
.
title
%>
<%
end
%>
<%=
album_fields
.
hidden_field
album
.
id
%>
</span>
<%
end
%>
<%
end
%>
</div>
<p
class=
"clear"
>
<%
grouped_options
=
[
[
'Available albums'
,[[
'Choose album to add'
,
''
]]],
[
'Not used'
,
Album
.
unused
.
map
{
|
album
|
[
album
.
title
,
album
.
id
]}
],
[
'In use'
,
Album
.
used
.
map
{
|
album
|
[
album
.
title
,
album
.
id
]}
]
]
grouped_options_for_select
(
grouped_options
)
%>
<%=
select_tag
'available_albums'
,
grouped_options_for_select
(
grouped_options
)
%>
</p>
<%
end
%>
\ No newline at end of file
Write
Preview
Supports
Markdown
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