Comments (7)
The Service
model has a field called position which is used to set the order that services are displayed in the interface. Unfortunately, this attribute isn't exposed anywhere.
I think I was just thinking of adding a simple JQuery UI sortable widget which would let you just drag and drop the order of services on the service list page.
I'd pop a form around the whole table, put a hidden field - hidden_field_tag('order[]', service.id)
- on each table row and then automatically submit the form when the order was changed. A controller action will receive the order
param array with the IDs in order and that can be passed to the model...
Finally, I would likely add a class method to Service
called reorder
which accepts an array of IDs in the which they should be displayed and update all the services with their new positions.
def self.reorder(ids)
ids.map(&:to_i).each_with_index do |id, index|
service = Service.find(id)
service.update(:position => index + 1)
end
end
from staytus.
+1
from staytus.
@adamcooke Can you explain a little more as to how you intended this to work? I wouldn't mind submitting a PR for such functionality.
from staytus.
👍I was thinking the same. I'll try and submit this unless you or anyone else beats me to it.
from staytus.
Did this get anywhere? Looks like it went dead but i think its an important feature so that messing with the database in the background is not required.
from staytus.
+1 on the feature, it looks like the internals already allow for this to work so it would be a nice to have.
from staytus.
Any news about reorder? I need sorting inside "service group". How I can do this?
If I add services with name 4, 2, 3, 1 this list not sorted by name.
from staytus.
Related Issues (20)
- Gemfile.lock blocks all installations and upgrades HOT 2
- Does staytus supports SSO login using OKTA
- Manteinances API Get endpoint HOT 1
- Ability to select subscribers when posting issue/maintenance HOT 1
- Private status pages and incidents
- mysql2 & MariaDB 10.5 Compatibility HOT 1
- Health Check
- How to install Staytus with Dokku
- Feature Request - Web Hooks
- Replace Google Fonts with self-hosted versions HOT 1
- [Feature Request] Password Resets
- Undefined method `arity'
- demo.staytus.co - Let`s Encrypt certificate expired on Sun, 03 Jul 2022 HOT 2
- environment.yml produces 502 Bad Gateway HOT 2
- Website not redirecting to https
- https://demo.staytus.co/ has no valid SSL Cert
- Status won't update with issue
- NoMethodError: undefined method `arity' for {:polymorphic=>true, :optional=>true}:Hash
- BCrypt::Error::InvalidHash in Setup Progress Admin User Creation HOT 1
- Some question
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from staytus.